How to add IF ELSE block in Truclient Protocol Loadrunner?

Steps to add IF ELSE Condition Block in Truclient Protocol

1. Right Click the step which has to be validated and Select If Clause --> Group Into.

2. Now the selected step comes under the IF condition
3. Click the Add Else Link and drag and drop the step to executed in the Else Condition.



4. Now add a condition in the IF blocks JavaScript to validate and execute the steps.


How to resolve Drag and Scroll not working issue in TruClient Protocol Loadrunner

I was doing truclient protocol based scripting for one of the applications developed on WebSwings. So the entire webpage was considered as one single element or object and all the clicks made on that page were being recorded using their X & Y coordinates.

Issue:

  • So when I click and drag the page slider down in the scroll bar it was getting recorded as a 'Drag' step.
  • But during replay script was not able to perform the drag since it was not able to identify the object.


Solution:

  • Instead of doing a click and drag of the page slider, scroll the page by clicking on the down button in the scroll bar. 

  • It will get recorded as 'Click' step.
  • Now change the step Action from 'Click' to 'Mouse Down'. 


  • Increase the Step Minimum Time to 10 sec. This needs to be done because we need to give sometime for the page to scroll before the next step gets executed. Since Truclient is asynchronous in nature.



Similarly for drag or scroll up click the up button in the scroll bar and change the step action to 'Mouse Up'.

Thats it now your page drag will work without any issues.

Why & How to do browser Resizing in TruClient Protocol Loadrunner

Need for browser Resizing:

I was doing truclient protocol based scripting for one of the applications developed on WebSwings. So the entire webpage was considered as one single element or object and all the clicks made on that page were being recorded using their X & Y coordinates.

The issue was that browser size varied between Developer and Load modes and identifying the objects using X & Y coordinates failed.

The solution is to make the browser size same in both the modes for which Browser Resize step comes handy.

How to do browser Resizing:

In Development mode, before recording we need to add the first step as Browser Resize and set the browser to our desired size.

Step 1: Goto Toolbox --> Functions --> Generic Browser Action and by default it will be Navigate step.


Step 2: Expand the Navigate step Goto Step --> Action and change the Action from Navigate to Resize.





Step 3: Now click on the Width or on the Height and set the Width and Height to the desired px value. In my case I have set Width to 800px and Height to 600px.





Step 4:  Now record all your flow steps after the Resize step.

Thats it, now when you run the script in Development mode first the browser will be set to the desired Width & Height and then the steps will be executed.

Now lets see how to set the Browser width and Height in Load mode.

Step 1: Disable the Resize step in Development mode and save it.

Step 2: Goto RunTimeSettings --> Others --> Non Interactive Window Size.

Step 3: Check both the options and set the Width to 800px and Height to 600px and save the script.



Thats it. Now browser will be set to the desired size in load mode as well.

Since we have done Browser Resizing identifying the objects using X & Y coordinates will no more fail.