Highlighted
Absent Member.
Absent Member.
553 views

File upload and Java Applet (AJAX click&script)

My LoadRunner is 9.5.2 in Windows XP and Application is Web.
I record web click&script protocol script and replay failed at step "s04_5 Finish" (with Java Applet) which "the client upload file to

the server(backend)".
1. HP Mercury escalation engineer told me web click&script protocol does not support Java Applet but AJAX click&script protocol

does. However, there is Javascript support issue in AJAX click&script protocol. So we copy/paste web click&script code into a

blank AJAX click&script protocol script. Replay still failed at the same step "Finish".
2. I found there is a step ("Add Files") before "Finish" did not be recorded. This looks like the major reason the replay fail.

This step is picking up a file from local client machine. However, this before step can be recorded in HTTP protocol as below:
---------------------------------------------------
web_custom_request("wdk5-appletresultsink",
"URL=http://mwifqt.etc.uspto.gov/ScoreWDKWeb/wdk5-appletresultsink",
"Method=POST",
"Resource=0",
"RecContentType=application/x-java-serialized-object",
"Referer=",
"Snapshot=t84.inf",
"Mode=HTTP",
"EncType=application/x-deflated-java-serialized-object",


"BodyBinary=x\\x9C\\x8DP\\xBDn\\x13A\\x10\\x1E.\\xCE\\x0F\\x90\\xC2!4tFB\"4{I\\x91&\\x0E\\x95O\\x88\\x93Nr\\x84\\x85!9G\\xD6z=v\\x

CE\\xD9\\xDB=\\xEF\\xCD\\x85K\\x01\\xA2\\xE0\\x01\\xE8R\\xE6\\x05\"\\xF1\\x02<\\x03=O@\\xE5\\x8A\\x17`\\xD7\\x9C\\x15\\x17)\\xB2\\

xCD\\xEC\\xCC|\\xF3}\\xF3\\xCD\\xCD\\x0CV\t\\x9E\\xBF\\x17\\xA30\\xCD\\xB4\\xA1\\x96V\\xC4\\x13\\x85\\xA6?J$\\xE6(Q\\x906\\xFD\\xD

D\\xDC@}\\xC2/8+(\\x91\\xAC;\\xAF\\xFE\\xBE\\xFA\\x1C\\x7Fm\\xFEx\\xB0\\x02+!l\t\\x9Eq\\x91\\xD0e\\xA8\\x84\\xC1\\x14\\x15\\x85\\x

B0i\\xC7\\xDD\\xAF\\xA5\\x0BE1<\\xAE\\xD2\\x80\\x13'\\xD8\\x8E#G\\xE8K\\xAE\\xC6~{0\\xB1\\x94\\xCD2\\x83\\xFF\\xCF+\\xCC\\x02\\xC0

\\x1C\\x80U\\x80\\xEF\\xBF>^\\xD7\\xF3W\\xD2\\x03\\x98c=\\xBBW

t\\xCA\\x86Z\\x14\\x8E\\xBBH\\xD9'\\x1C0\\x9Ee\\x12\\x89-{`ol\\xD2\\xA9\\x92\\xC0\\xC61'|\\xE1\\x8A\\xD6\\xB9\\xFC\\x16\\xEE\\xFD,

O\\x1F\\xBD\\xF5\\xA0v\\x02\\x0F\\x87\\x89\\x99\\xC3.c\\xD8\\x10g\\x89\\x1C\\x1AK\r\\xFBqd\\xA5\\xFC[)\\xDFJ\\xF9#mR_\\xD8\\xB3\\x

19-\\xFDeA?t\\xE4\\xCD\\x08j\\x8A\\xA7H\\xF0d\\xC9o"


"\\x87L\\xA2\\xC6\\xAE\\x97q:\\x9B\\xC2\\x17\\xD8\\xB0~2\\x82\\xA7\\x1D\\x9C\\x16\\xA8\\x046\\xA2$'\\x8BaT\\x12\\xC1a\\xEB\\xA0\\x

17T\\xBAy\\x83\\xABa\\xA3\\x83\\xE4\\xDAyO\\x966\\xF4\\x02\\xCC\\xCFIg\\xBD\\xBB\\xC6\\xED\\x8D^\\xDF\\xF3FG\\x06Gh\\x1CA\\x97\\xC

B\\x02?\\x18\\x0BB3;n\\xFF}7\\xDB\\xF9\\xE3\\x81\\x17\\xC1Z\\xDAw~\\xE6;G\\xB0\\x9E\\xF6/\\x1C\\xB2\\xB2@\\xF0l\\x99/\\xE29\\x05\\

x8B[\\x12\\xBC\\xBC\\xA7\\x8B\\xF2\\x1F\\xF2\\x81\\xEAd",
LAST);
---------------------------------------------------
3. I added above request code into AJAX click&script protocol script and replay. It still failed at the "Finish" step. Note: I

also added below header file which is missing in replay log (comparing with recording log in web click&script protocol)
web_add_header("Proxy-authorization",
"NTLM TlRMTVNTUAABAAAAB7IIogMAAwAtAAAABQAFACgAAAAFASgKAAAAD1BUMDAxRVRD");
The Java Applet support option is ON in runtime setting.

4. The following is web click&script code after Application Login.
lr_start_transaction("s04 Submit");

web_element("Submit",
"Snapshot=t12.inf",
DESCRIPTION,
"Text=Submit",
"Tag=TD",
"Ordinal=2",
ACTION,
"UserAction=Click",
LAST);

lr_end_transaction("s04 Submit",LR_AUTO);

lr_start_transaction("s05 Submit_2");

web_element("Submit_2",
"Snapshot=t13.inf",
DESCRIPTION,
"Text=Submit",
"Tag=TD",
"Ordinal=2",
ACTION,
"UserAction=Click",
LAST);

lr_end_transaction("s05 Submit_2",LR_AUTO);

web_edit_field("Load_numCopiesText_0",
"Snapshot=t14.inf",
DESCRIPTION,
"Type=text",
"Name=Load_numCopiesText_0",
ACTION,
"SetValue=1",
LAST);

web_edit_field("Load_numCopyDisksText_0",
"Snapshot=t15.inf",
DESCRIPTION,
"Type=text",
"Name=Load_numCopyDisksText_0",
ACTION,
"SetValue=1",
LAST);

lr_start_transaction("s06 Compare");

web_edit_field("Load_numCopyDisksText_0_2",
"Snapshot=t16.inf",
DESCRIPTION,
"Type=text",
"Name=Load_numCopyDisksText_0",
ACTION,
"FireEvent=onfocus",
LAST);

web_element("Compare",
"Snapshot=t17.inf",
DESCRIPTION,
"Text=Compare",
"Tag=TD",
"Ordinal=2",
ACTION,
"UserAction=Click",
LAST);

lr_end_transaction("s06 Compare",LR_AUTO);

lr_start_transaction("s07 Copy cont Ok");

web_element("OK",
"Snapshot=t18.inf",
DESCRIPTION,
"Text=OK",
"Tag=TD",
"Ordinal=1",
ACTION,
"UserAction=Click",
LAST);

lr_end_transaction("s07 Copy cont Ok",LR_AUTO);

/*Add Files*/

/*ok*/

/*highlight file*/

lr_start_transaction("s07 Finish");

web_element("Finish",
"Snapshot=t19.inf",
DESCRIPTION,
"Text=Finish",
"Tag=TD",
"Ordinal=2",
"FrameName=",
"FrameOrdinal=1",
ACTION,
"UserAction=Click",
LAST);

lr_end_transaction("s07 Finish",LR_AUTO);

Could someone give me suggestion how I can solve this replay fail problem?

Thanks in Advance,
Larry
0 Likes
2 Replies
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: File upload and Java Applet (AJAX click&script)

Yes, I could see how this would be troublesome. You have to /*highlight file*/ before uploading it, correct?
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: File upload and Java Applet (AJAX click&script)

James,
I double checked the step "/*highlight file*/", it does not matter for the later transaction. But "Add Files" does. Right now I want to adding request code for "Adding Files" (it picks up a file from client local machine) and I believe it will be the major part of solution. Thanks.
Larry
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.