LoadRunner scripting inside VUser script to manipulate ajax page elements (538 Views)
Reply
Occasional Contributor
fugmag
Posts: 7
Registered: ‎02-08-2013
Message 1 of 3 (538 Views)

LoadRunner scripting inside VUser script to manipulate ajax page elements

[ Edited ]

 

I wonder, is it possible to script (in either c or java) inside a vuser recorded script to controll/manipulate elements, clicking radio-buttons and so forth on a web app/page using Ajax and being under test?

Problem is that when running a recorded vuser script against a web app implemented using Ajax I need to manipulate page elements in order to get the script running further (using http-protocol) and because http-protocol is focused on recording http-traffic as in web requests and responses the manipulation/client side behavior is not captured during recording.

I hope someone knows/have done something like this?

Best Regards Magnus

Occasional Contributor
fugmag
Posts: 7
Registered: ‎02-08-2013
Message 2 of 3 (497 Views)

Re: LoadRunner scripting inside VUser script to manipulate ajax page elements

Hi, I found that James Pulley somewhat answerd (pats) my question, at in least in a more general way here:

(1) Convert your Javascript code to a set of C functions.
(2) Add your functions to your existing C based script
(3) Reference your functions at the appropriate location in your script
(4) take the output of your functions and integrate the values into your GET
or POST

I also found a "converter" here to maybe use with point (1)?

http://www.jds.net.au/tools/convert-to-java/

Is this a path to go?

 

I found an old (Mercury) user guide to vuser scripting and it states:

VuGen allows you to program your own functions into the script, instead of

recording an actual session. You can use the LoadRunner API or standard

programming functions.

http://genesis.co.kr/image/product/pds/LoadRunner/Manual/LoadRunner_Generator.pdf

....

 

So javascript or java code for that matter embedded in the VUser script can actually refer and manipulate i.e. GUI elements on the webpage under test?

 

Cheers Magnus

 

Occasional Contributor
fugmag
Posts: 7
Registered: ‎02-08-2013
Message 3 of 3 (493 Views)

Re: LoadRunner scripting inside VUser script to manipulate ajax page elements

To make my question concrete:

Lets say I record a VUser script and it has a structure as i.e.:

 

web_url ....1

.

.

.

web_submit....2

.

.

.

web_url...3

.

.

.

Lets say between web_url...1 and web_submit...2

can I put in some custom java  code to, lets say, check a radiobutton and click a submit button on an element within a hidden field on the webpage, as in manipulating a web page in a "custom" way, and no, the normal recording I do is not capturing i.e. behavior inside the hidden field.

 

BR

Magnus

 

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.