Highlighted
Absent Member.
Absent Member.
21459 views

Ajax True Client parameterization problem

Hi, I am new on load runner and started working on LR n using ajax true client protocol to test a web application which contains ajax pages n dynamic data lyk google maps. I am having parameterization problem. I am testing it on ff... For example on login screen if I want to pass parameter to userid field: username=LR.getParam("paramter name") then it shows error that Evaluate JS Username=LR.getParam("ParameterName1") ** failed - an argument is invalid: 'Code': JavaScript exception 'ReferenceError : LR is not defined' during evaluation. Please help me that how can i get rid of this problem. thanks.. Ashhad
0 Likes
16 Replies
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Ajax True Client parameterization problem

Ashhad,

 

LR 11.0 only supports the version of FireFox that is distributed with LR, FireFox 3.6.3. If the installation has been updated LR may not work properly with it.

 

Make sure you do not replay the singe step which has the parameter. Parameters will work only if you replay the entire script.

 

Once verified, you can try the below:

 

1) Add a wait time (think time) for 5 -10 seconds before you enter the username

2)For this event, make sure under Object  the ID Method used is set to Automatic, If Automatic identification fails, even after using Improve Identification and Related Objects, try using the XPath identification method.

3)For this event, under Step try to increase the object timeout to 60 and step timeout to 180.

4) Try to change the End Event under Step to Action completed.

 

 

The object takes a little longer to load and the step is executed faster. Therefore, during execution the
step cannot locate the object although, during debugging, the Highlight option on the failed step finds
the object.
In this case it is recommended to “slow down” the script so there’s enough time for the object to load.
Use one of the following options to do this:
• Change the Object Timeout of the failing step. This is available via the Step section on the step’s
properties.
• Add a Wait or Wait for Object step before the failed step

 

I have attached 2 documents that will help you better understand Ajax Truclent Scripting.

 

good luck

 

-Arjun

 

Tags (1)
0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Ajax True Client parameterization problem

I'll second what Arjun said because it comes from personal experience and it was a PITA to figure it out.

Make ABSOLUTELY certain that the version of Firefox you have installed is 3.6.3. anything else *WILL* fail. That includes installing 3.6.3 in a different directory.

TruClient work great if you follow that one simple rule.

Greg.

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Ajax True Client parameterization problem

I tried it again and followed ur steps..

but still it did not work...I got ff 7.0 so it might be a problem...I will install again ff 3.6.3 version and will check again same script...

 

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Ajax True Client parameterization problem

I installed the firefox 3.6.3 version and again played my script...still it does not work

I have done following steps:

step1: Evaluate JS script having code uid=LR.getParam("ParameterName")

steps2: Under username tab, Value= uid

but when the script runs it stops on step1 and shows following error.

"uid=LR.getParam("ParameterName") ** failed - an argument is invalid: 'Code': JavaScript exception 'ReferenceError : LR is not defined' during evaluation."

Please need help..I dont know why it is not working at my end even I have checked the same steps for HP Webtour site.

0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Ajax True Client parameterization problem

Ashsad,

 

Were you able to replay the entire script without any parameterization for multiple iterations? 

Is the entire script in the Action part? or is it distributed in vuser_init , Action and vuser_end ?

 

-Arjun

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Ajax True Client parameterization problem

script is distributed in action part.......and whole script works good without parameterization...even the recorded value easily  get inserted in user text field but when I replace the same value with ''replace with parameter'' then it does not work and shows the same error every time that Referece failed: LR is not defined.....

 

while I also tried to declare globale variable in a Evaluate JS script:

window.myGlobalVar=LR.getParam("pa")

 

but it did not work....

 

im using LR 11.3 patch with ff 3.6.3

 

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Ajax True Client parameterization problem

and if i try another way where i simply replace the value with ""replace with parameter'' under Arguments section then value becomes:

LR.getParam("NewParam")

then it gives following error:
t=00010025ms: Error -203253: ** 6: Type [Exception] in User ID textbox ** failed - an argument is invalid:
'Value': JavaScript exception 'ReferenceError: LR is not defined' during evaluation [MsgId: MERR-203253]
0 Likes
Highlighted
Established Member..
Established Member..

Re: Ajax True Client parameterization problem

Hi,

We have followed the exact same steps mentioned here(like adding think time, trying to run the whole script and not just a step etc), but even after that we are receiving the same error :'ReferenceError : LR is not defined'. We have checked that our vugen version is 11.04 (that is LR 11 + patch 4) and the Mozilla version is 3.6.3. Only thing that we are missing is a local admin rights on the desktop from where we are trying to record the scripts. But can that really be an issue ? Please help and suggest.

0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Ajax True Client parameterization problem

I have seen this failure before. Try the following and report back to this thread:

 

 

1.)  Detele the step which contains the LR.getParam call, then add it back in with the same code.

 

2.)  Create a new simple TruClient script and add a LRgetParam call.

0 Likes
Highlighted
Established Member..
Established Member..

Re: Ajax True Client parameterization problem

Hi,

We have even tried the same(deleting the step and writing again) but having the same issue. Can you suggest any other wayaround ?

0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Ajax True Client parameterization problem

Admin rights are VERY important. Have your user added to the local admin group for this machine.

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.