The online community for software testing & quality assurance professionals
 
 
Calendar   Today's Topics
Sponsors:
Lost Password?

Home
BetaSoft
Blogs
Jobs
Training
News
Links
Downloads



Testing Tools >> HP / Mercury LoadRunner

Pages: 1 | 2 | >> (show all)
swales
Junior Member


Reged: 07/11/02
Posts: 173
Loc: Moline,IL
SWales - TruClient Knowlege Base
      #664213 - 03/14/11 01:22 PM

I have been doing considerable amount of work using LoadRunner 11 and TruClient. There doesn't seem to be much technical information on TruClient out there yet, so I thought I would start a thread focusing on how to's and any useful information pertaining to TruClient.

I only ask that we keep this thread limited to how to's and useful information. Discussions should happen on other threads and their links referenced here. That will help keep this thread as more of an index to the other discussions.

Hopefully the admin will make this a 'sticky' so it's easy to find.

Edited by swales (03/14/11 01:31 PM)


Post Extras: Print Post   Remind Me!   Notify Moderator  
swales
Junior Member


Reged: 07/11/02
Posts: 173
Loc: Moline,IL
Re: SWales - TruClient Knowlege Base [Re: swales]
      #664214 - 03/14/11 01:23 PM Attachment (792 downloads)

How to do a random Think Time in TruClient (see attachment).

This has been submitted to HP as a KB Article.

Also to do a 'Global' think time:

Use the "Inter-step interval" run-time setting to specify the time (in ms) between steps. This setting will be used for ALL the steps in the script.


Edited by swales (03/14/11 01:37 PM)


Post Extras: Print Post   Remind Me!   Notify Moderator  
swales
Junior Member


Reged: 07/11/02
Posts: 173
Loc: Moline,IL
Re: SWales - TruClient Knowlege Base [Re: swales]
      #664215 - 03/14/11 01:24 PM Attachment (880 downloads)

How to dynamically select a link (based on a parameter value). (see attachment)

This has been submitted to HP as a KB Article

Edited by swales (03/14/11 01:37 PM)


Post Extras: Print Post   Remind Me!   Notify Moderator  
swales
Junior Member


Reged: 07/11/02
Posts: 173
Loc: Moline,IL
Re: SWales - TruClient Knowlege Base [Re: swales]
      #664218 - 03/14/11 01:30 PM

Documentation
--------------
AJAX TruClient Tips and Tricks
c:\Program Files\HP\LoadRunner\help\LoadRunner11.00_AjaxTruClient_TipsTricks.pdf

YouTube Videos
----------------
HP TruClient Technology

HP LoadRunner 11.00 - Ajax TruClient Protocol
* Same video as what included in LR11 product

Edited by swales (03/14/11 01:55 PM)


Post Extras: Print Post   Remind Me!   Notify Moderator  
swales
Junior Member


Reged: 07/11/02
Posts: 173
Loc: Moline,IL
Re: SWales - TruClient Knowlege Base [Re: swales]
      #664219 - 03/14/11 01:35 PM

Q. How do I set LoadRunner to save snapshots and Where are they stored?
A. LoadRunner can be set to save snapshots for recording and replay.
To setup snapshot capture when replaying do the following:
1. In VuGen - Vuser - Runtime Settings - Other Settings - Snapshots generation - Replay snapshots generation - Always

Snapshots will be saved in the following locations:
* If using TruClient, snapshots are stored in different locations based on where the script is executed from.
1. If executed from FireFox (Develop script) the snapshot is located at:
Script Directory/results/interactive

2. If executed from VuGen the snapshot is located at:
Script Directory/results/load


Post Extras: Print Post   Remind Me!   Notify Moderator  
swales
Junior Member


Reged: 07/11/02
Posts: 173
Loc: Moline,IL
Re: SWales - TruClient Knowlege Base [Re: swales]
      #664221 - 03/14/11 01:56 PM

Q. How do I parameterize a script?
A. Follow this process to parameterize a script. (Movies-TruClient.wmv)
1. Create the parameter in VuGen (Vuser - Parameter List) - same process as any other protocol
2. Click Develop Script to Launch Firefox
3. Expand the toolbox - Miscellaneous - Evaluate JavaScript
4. Drag and Drop the Evaluate JS above the statement where you need the parameter
5. Add the following code to the Code: tag
example: transferAmount=LR.getParam("Amount")
6. Go to the step you want to parameterize and replace the Value: (10) with the parameter name (transferAmount)

or
1. Go to the step you want to parameterize and replace the Value: (10) with the code:
example: LR.getParam("Amount")


Post Extras: Print Post   Remind Me!   Notify Moderator  
swales
Junior Member


Reged: 07/11/02
Posts: 173
Loc: Moline,IL
Re: SWales - TruClient Knowlege Base [Re: swales]
      #664222 - 03/14/11 02:00 PM

Q. How do I put in an output message so it shows up in the Controller?
A. LR.log function is used for logging.
window.alert() will print to a popup dialog box.


Post Extras: Print Post   Remind Me!   Notify Moderator  
swales
Junior Member


Reged: 07/11/02
Posts: 173
Loc: Moline,IL
Re: SWales - TruClient Knowlege Base [Re: swales]
      #664223 - 03/14/11 02:00 PM

Q. How do I randomly pick an item on the screen?
A. If the item is a List. (Ajax TruClient Tips and Tricks.pdf)
1. Set the Ordinal argument to 0. TruClient will automatically select a random option from the list.

If the item is a bunch of links.
1. You can use JavaScript (see Ajax TruClient Tips and Tricks.pdf)
ex. A page returned with multiple links with the same "title" attribute we want the script to randomly click a link.

var my_results = document.querySelectorAll('a[title="SearchResult"]');
my_results[Math.floor(Math.random() * my_results.length)];


Post Extras: Print Post   Remind Me!   Notify Moderator  
swales
Junior Member


Reged: 07/11/02
Posts: 173
Loc: Moline,IL
Re: SWales - TruClient Knowlege Base [Re: swales]
      #673605 - 06/02/11 12:25 PM

Want to improve scalability of your load generators?

The runtime setting Interstep Interval has a default of 500ms. Try increasing this to 1000ms or 2000ms.

Yes it is true you will be 'pausing' longer between each step, however it seems to give your CPU a little breathing room to multitask a little better. We found around a 15 to 25% improvement in scalability depending on the app.


Post Extras: Print Post   Remind Me!   Notify Moderator  
swales
Junior Member


Reged: 07/11/02
Posts: 173
Loc: Moline,IL
Re: SWales - TruClient Knowlege Base [Re: swales]
      #673611 - 06/02/11 12:48 PM

TruClient scalability tests

I recently completed a series of tests comparing our 'old' load test generators with our 'new' prototype generator.

Old Generators
Intel Pentium DuoCore 3.0ghz
2gb Ram
Windows XP

Prototype Generator
Amd Phenom II B95 3.0ghz (Quad core)
16GB Ram
Windows 7-64bit


My test applications were limited to between 8 users and 25 users on the old generators (based on the application) before CPU was maxed out. Memory would also be an issue at around 25 users since most apps seem to take at least 60mb of ram per user (your app may vary) and our old generators only had 2gb..

The new generators were able to handle 8x (8 times) more users before CPU was maxed out. Memory should be able to handle over 200 users... so most likely CPU will be bottleneck before that. The scalability was very close between applications... so based on this hardware you could expect the 8x scalability improvement.

Good news is you can get back/close to the 100+ users on a generator.

I suspect the new Intel Sandy Bridge processors (i5-2500k/i7-2600k) will scale much higher than the AMD Phenom II.. and hope to acquire one for comparison results in the future.


Post Extras: Print Post   Remind Me!   Notify Moderator  
Chid
Active Member


Reged: 06/27/06
Posts: 812
Loc: USA
Re: SWales - TruClient Knowlege Base [Re: swales]
      #678793 - 07/14/11 08:37 AM

Posted by Shane on LR Google Groups

------------------------------------------

TruClient uses Mozilla to only record the script. Note that I said record, as during playback there *is no browser*.

Mozilla is simply a vehicle for the recording engine as it allows LoadRunner full access to the DOM, where Internet Explorer (8 and below) do not. So if the application *works* in Firefox, even if it is not your corporate
standard, TruClient would be the better choice here.

There is no browser used in any LoadRunner performance tests. Only a lightweight agent that communicates with the AUT in the same manner as a client application would.

--------------------
Chid | My LR Profile | LoadRunner Reading


Post Extras: Print Post   Remind Me!   Notify Moderator  
swales
Junior Member


Reged: 07/11/02
Posts: 173
Loc: Moline,IL
Re: SWales - TruClient Knowlege Base [Re: Chid]
      #678806 - 07/14/11 10:03 AM

Chid/Shane

You are incorrect on how TruClient works. It DOES run a copy of FireFox for each virtual user. This is why it does not scale as well as the old (HTTP/HTML) protocols. It is also why AJAX apps work in TruClient... because it is using a 'real' browser.

The reason HP supports FireFox and not IE right now is because Mozilla allows them to turn off certain features during the load test (such as screen rendering) which reduces memory footprint and improves scalability (albiet slightly). Microsoft is rumored to enable this behavior in IE9... so we could expect to see LoadRunner TruClient support for IE9 possibly in LoadRunner 12.


Post Extras: Print Post   Remind Me!   Notify Moderator  
swales
Junior Member


Reged: 07/11/02
Posts: 173
Loc: Moline,IL
Re: SWales - TruClient Knowlege Base [Re: swales]
      #679394 - 07/19/11 11:16 AM

Quote:

Q. How do I randomly pick an item on the screen?
A. If the item is a List. (Ajax TruClient Tips and Tricks.pdf)
1. Set the Ordinal argument to 0. TruClient will automatically select a random option from the list.





I have found that with Patch 3 installed you need to also clear the TEXT argument field in order to get TruClient to select a Random Link. If you leave the TEXT there it will select randomly from the text that matches what you have in the TEXT field. So if you have multiple items with the exact same TEXT value, it would randomly select one of them.


Post Extras: Print Post   Remind Me!   Notify Moderator  
swales
Junior Member


Reged: 07/11/02
Posts: 173
Loc: Moline,IL
Re: SWales - TruClient Knowlege Base [Re: swales]
      #681231 - 08/04/11 11:21 AM

Quote:

TruClient scalability tests

I recently completed a series of tests comparing our 'old' load test generators with our 'new' prototype generator.

Old Generators
Intel Pentium DuoCore 3.0ghz
2gb Ram
Windows XP

Prototype Generator
Amd Phenom II B95 3.0ghz (Quad core)
16GB Ram
Windows 7-64bit


My test applications were limited to between 8 users and 25 users on the old generators (based on the application) before CPU was maxed out. Memory would also be an issue at around 25 users since most apps seem to take at least 60mb of ram per user (your app may vary) and our old generators only had 2gb..

The new generators were able to handle 8x (8 times) more users before CPU was maxed out. Memory should be able to handle over 200 users... so most likely CPU will be bottleneck before that. The scalability was very close between applications... so based on this hardware you could expect the 8x scalability improvement.

Good news is you can get back/close to the 100+ users on a generator.

I suspect the new Intel Sandy Bridge processors (i5-2500k/i7-2600k) will scale much higher than the AMD Phenom II.. and hope to acquire one for comparison results in the future.




I finally received an Intel I5-2400 3.1ghz for testing purposes. It had the same config as the Amd Phenom II B95 3.0ghz as far as Windows version and Ram. Both were HP desktop machines.

In summary the Intel i5-2400 scalability was 10% to 15% better than the AMD for the same application. My test was able to max the CPU to 100% during the ramp up test. At each level of the ramp up the Intel took 10 to 15% less CPU.


Post Extras: Print Post   Remind Me!   Notify Moderator  
Venkat_Sravan
Newbie


Reged: 07/01/11
Posts: 4
Re: SWales - TruClient Knowlege Base [Re: swales]
      #683425 - 08/29/11 04:42 AM

Hi All,

Don't Know if this is the right thread to ask this question.
I have been working on LR 11.0 truclient protocol for our application. I came across a weird problem where in when I run th tests in controller I am unable to see any graphs except for the response time graph. Did any one had this kind of an issue??? Any help here would be really great!!


Post Extras: Print Post   Remind Me!   Notify Moderator  
swales
Junior Member


Reged: 07/11/02
Posts: 173
Loc: Moline,IL
Re: SWales - TruClient Knowlege Base [Re: swales]
      #701275 - 03/13/12 03:46 PM

Quote:

How to dynamically select a link (based on a parameter value). (see attachment)

This has been submitted to HP as a KB Article




I have an update for this technique. Originally the problem was that in 'certain' areas of TruClient you were unable to access any of the LR functions... like LR.getParam(). TruClient would throw an error. So in my above example I figured out a workaround by adding an Evaluate JavaScript statement and storing the LR Parameter into a global Java Variable (window.variable). I could then use the java variable in my statement. This made it a two step process. You also had to be careful because your app might clear the window objects between calls.

It appears HP exposes the LR functions throught an ArgContext. So in those statements where TruClient does not like LR.getParam() you now use ArgContext.LR.getParam().

I would like to give credit to Abdul Rahim for documenting this at: http://softwaretesttips.com/2011/04/19/h...-script-editor/

How to extract and manipulate the data contained in an object verification window (java script editor)?
April 19, 2011
Abdul Rahim
Leave a comment
Go to comments
How to extract and manipulate the data contained in an object verification window (java script editor)?

Accessing to the LR API. It is available from the JavaScript ID Method by qualifying the API with “ArgsContext”

Important Points:JavaScript code running in “Evaluate JavaScript” steps (or any other step) is executed in a context called “ArgsContext”.

•JavaScript code running in “Evaluate JavaScript” steps (or any other step) is executed in a context called “ArgsContext”.
•JavaScript code running in “JavaScript ID Method” is executed in a separate context (upon each call, a new context is created).
•When you are using an “Evaluate JavaScript” step, your code is already executed inside the ArgsContext, so there is no need to qualify it by adding the prefix “ArgsContext”.
•You only need to use the “ArgsContext” prefix if you are using the “JavaScript ID Method” and you wish to access something that is defined in the ArgsContext (e.g. the LR API).
•For example, in “Evaluate JavaScript” step you can write LR.log(“TEST”), but in the “JavaScript ID Method” you need to write ArgsContext.LR.log(“TEST”).


Post Extras: Print Post   Remind Me!   Notify Moderator  
tebiet
Newbie


Reged: 02/18/09
Posts: 7
Re: SWales - TruClient Knowlege Base [Re: Venkat_Sravan]
      #709252 - 06/07/12 09:34 AM

You will be able to see other graphs after installing the latest patch.

Post Extras: Print Post   Remind Me!   Notify Moderator  
BooKa
Newbie


Reged: 07/26/12
Posts: 4
Re: SWales - TruClient Knowlege Base [Re: swales]
      #713059 - 07/26/12 05:50 AM

One more trick for LR 11 P03

Load mode replay for Ajax Tru Client protocol fails with error
“Activate browser window #2 ** failed – runtime error:
‘Ordinal’: The specified value (2) is invalid [MsgId: MERR-203254]“
The script replays fine in interactive mode.
This issue is specific to LR/PC 11.03 version (Works fine with LR/PC 11.02).
There is a problem with function “Activate tab” which doesn’t recognise any other tab than the first one.
To fix this issue follow the below steps

1. Open your script and click on “develop script”.
2. This will launch the Firefox browser.
3. Type at the Firefox browser
about:config
4. Find “disable_open_during_load” and set it to false.
5. Save the script again (Copy to controller again etc.).

Original post by Abdul Rahim

--------------------
Just because I don't care doesn't mean I don't understand.


Post Extras: Print Post   Remind Me!   Notify Moderator  
BooKa
Newbie


Reged: 07/26/12
Posts: 4
Re: SWales - TruClient Knowlege Base [Re: swales]
      #713060 - 07/26/12 06:09 AM

If you need to turn on Flash in TruClient script:

  • Download NPSWF32.dll
  • Interactive mode: Add it to <LR installation>\bin\firefox\plugins
  • Load mode: Add it to <LR installation>\bin\gecko\plugins


--------------------
Just because I don't care doesn't mean I don't understand.


Post Extras: Print Post   Remind Me!   Notify Moderator  
BooKa
Newbie


Reged: 07/26/12
Posts: 4
Re: SWales - TruClient Knowlege Base [Re: swales]
      #713061 - 07/26/12 06:12 AM

If you need to see FireFox window with actions that your script is executing at this moment in load mode, just add
PaintWindowsInLoad="1" key into default.cfg file (RTS) into [TruClient] section.

--------------------
Just because I don't care doesn't mean I don't understand.


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1 | 2 | >> (show all)



Extra information
0 registered and 13 anonymous users are browsing this forum.

Moderator:  AJ, James Pulley, ptrussell_nc, JimHowell1970 

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating: ****
Topic views: 22538

Rate this topic

Jump to

Contact Us | Privacy statement SQAForums

Powered by UBB.threads™ 6.5.5