Highlighted
Absent Member.
Absent Member.
1045 views

Loadrunner 9.52 replay error on Ajax Click and Script

Hi, I have an issue recording an applicaction using AJAX Click & Script protocol on LR 9.52

The recording is ok, but there's a JavaScript error on replay.

Action.c(97): Warning -26276: JavaScript error (id=39) in line 482: TypeError: form.__EVENTTARGET has no properties [MsgId: MWAR-26276]
Action.c(97): Warning -26276: JavaScript error (id=0) in line 1: JavaScript evaluation error when executing function (by pointer) [MsgId: MWAR-26276]
Action.c(97): web_list("ctl00$RightContent$ddlCycleNo") highest severity level was "warning" [MsgId: MMSG-26391]

The script that generate this error is this:
web_list("ctl00$RightContent$ddlCycleNo",
"Snapshot=t14.inf",
DESCRIPTION,
"Name=ctl00$RightContent$ddlCycleNo",
"id=ctl00_RightContent_ddlCycleNo",
"FrameName=contentFRAME",
ACTION,
"Select=B",
LAST);

I can see on page source that it uses a very common JS postback function.

<SCRIPT type="text/javascript">
//<BR />var theForm = document.forms['aspnetForm'];<BR />if (!theForm) {<BR /> theForm = document.aspnetForm;<BR />}<BR />function __doPostBack(eventTarget, eventArgument) {<BR /> if (!theForm.onsubmit || (theForm.onsubmit() != false)) {<BR /> theForm.__EVENTTARGET.value = eventTarget;<BR /> theForm.__EVENTARGUMENT.value = eventArgument;<BR /> theForm.submit();<BR /> }<BR />}<BR />//
</SCRIPT>


Because of this a button stay disabled and I can't finish the replay.

Did anybody face a similar issue?

Thanks in advance,


Ricardo
0 Likes
4 Replies
Highlighted
Absent Member.
Absent Member.

Re: Loadrunner 9.52 replay error on Ajax Click and Script

Try URL mode from html/http protocol if you have some time.

OR try using Eval function in Ajax to execute javascript from vugen.
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Loadrunner 9.52 replay error on Ajax Click and Script

I tried something like this:

web_browser("Test",
ACTION, "EvalJavaScript=javascript&colon;__doPostBack('ctl00$RightContent$ddlField','ABC');",
LAST);

But it returned the same error 😞
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Loadrunner 9.52 replay error on Ajax Click and Script

In web click and script protocol use web_button function and have evaljavascript to submit the form on click.

It looks like your submitting a form on clicking the button.
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Loadrunner 9.52 replay error on Ajax Click and Script

i am facing a similar issue. Please let me know if you foound a workaround.

JavaScript error (id=39) in line 482: TypeError: form.__EVENTTARGET has no properties [MsgId: MWAR-26276]
Action.c(31): Warning -26276: JavaScript error (id=0) in line 1: JavaScript evaluation error when executing function (by pointer) [MsgId: MWAR-26276]
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.