
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
javascript is not working as expected in loadrunner v12.50
Team,
I'm using the below function in action part to test javascript. LR failed to execute
Action()
{
web_js_run(
"Code= var a=1234; var n=a.length; alert(n); ",
"ResultParam=uri",
LAST);
return 0;
}
Output:
Starting action Action.
Action.c(4): web_js_run started [MsgId: MMSG-26355]
Alert from JS (len=9): undefined
Action.c(4): web_js_run was successful [MsgId: MMSG-26392]
Ending action Action
Answer should 9 but I used to get undefined.
Could anyone please help on this to resolve the issue. Thanks
Note: Enabled javaEngine in RUNTIME

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hello,
The varaiable "a" appears to be a number by your defination, pleae try change it to:
web_js_run(
"Code= var a='1234'; var n=a.length; alert(n); ",
"ResultParam=uri",
LAST);
Regards,
Bingle(LoadRunner R&D)