AJAX TruClient Protocol – Tips and tricks

TipsAndTricks

Post publishing my articles the high level review on AJAX TruClient protocol of LR and incorporating basic functionalities in AJAXTruClient, I am receiving a number of messages, comments and queries via email and on LinkedIn. Most of the queries are related to implementations of basic functions in the scripts developed on TruClient. Through this article, I would resolve some of those very common queries and thus try to save a lot of time that you performance testers may have to invest.

 

Displaying the value in a parameter or variable

While replaying the script, if you wish to understand the value that gets stored in a parameter, you can use alert() function. This function can be used as shown below.

var abc=”Hello World”;

window.alert(abc);

The above code will give us get following output –

Disable pop-ups during recording

Unwanted pop-ups during script development create hurdles. If you want to disable the pop-ups, you can do it by following the below mentioned steps –

  1. In the firefox address bar, enter ‘about:config’. Click ‘I’ll be careful, I promise’ tab.
  2. In the filter field, enter disable_open_during_load.
  3. Right click on ‘disable_ open_during_load’ and select ‘Toggle’. The value changes to ‘false’.
  4. Record initial Navigation step again.

Your pop-ups will be disabled.

Another issue with pop-ups ProShapeRX

While recording business process with pop-ups, mozilla tries to block the pop-ups and displays a pop-up blocker bar with a message ‘Firefox prevented this site from opening a pop-up window’ and presents you with its three options of pop-up management. If out of those three, you select – ‘Don’t show this message when pop-ups are blocked’, then pop-up blocker bar will not be displayed upon replay and you may not be able to edit pop-up blocker options.

If in such a scenario, you wish edit pop-up blocker options, you won’t have to re-record the script. Just follow these steps –

1) Open the script directory
2) Go to profiles\interactive folder
3) Edit the file ‘perfs.js’
4) Search for the line – user_pref(“privacy.popups.showBrowserMessage”, false);
5) Change the value to true – user_pref(“privacy.popups.showBrowserMessage”, true);

The pop-up blocker bar will be displayed the next time you replay the script.

Turning on Run-time viewer in load mode –

By default, replay snapshots don’t appear during script replay in load mode. In order to turn on the run time viewer, follow these steps –

1) Open the script directory
2) Edit ‘default.cfg’ file
3) Add this line to the file – PaintWindowsInLoad=1
4) Save the file

Replay snapshots would be enabled by making this change.

14 thoughts on “AJAX TruClient Protocol – Tips and tricks

  1. Hi,

    The comment above about Disable pop-ups during recording is not correct!

    I was having an issue where Mozilla Firefox windows were popup was being blocked under load mode but not interactive mode.

    To fix it I had to type about:config in the Firefox window that opens when interactive mode is activated by clicking “Develop Script” under Ajax Truclient protocol.

    Once there I had to set disable_ open_during_load’ to false and this ENABLED pop-up not disable it as this post seems to suggest.

    Right click on ‘disable_ open_during_load’ and select ‘Toggle’. The value changes to ‘false’.
    Record initial Navigation step again.

    Your pop-ups will be disabled.

    This forum comes up at the top of Google when searching and as such I deemed it prudent to let others know to save them the time I lost 🙂

    Best,

    Ali

    1. Ali,

      I had tried & tested it while writing this post. Today I tried it again, pop up gets blocked w/o any issue by the steps I have mentioned. Please re-check.

      Appreciate your pro-activeness.

      Regards,
      Swaraj

      1. Hi again,

        I am not sure maybe I am miss understanding…

        You state:

        Disable pop-ups during recording –

        Unwanted pop-ups during script development create hurdles. If you want to disable the pop-ups, you can do it by following the below mentioned steps –

        In the firefox address bar, enter ‘about:config’. Click ‘I’ll be careful, I promise’ tab.
        In the filter field, enter disable_open_during_load.
        Right click on ‘disable_ open_during_load’ and select ‘Toggle’. The value changes to ‘false’.
        Record initial Navigation step again.

        Your pop-ups will be disabled.

        If ‘disable_ open_during_load’ is set to ‘false’ the pop-ups are ENABLED not disabled.

        Am I getting this wrong somehow?

        If you want pop-ups disabled then you want to set the flag to true which is the default value.

        Best,
        Ali

  2. i’m having issues where the ajax true client script will not execute properly during a test, and get the following error: t=00069863ms: Error -203256: ** 17: ** failed – target object was not found. [MsgId: MERR-203256]

    do you have any encounter with trying to execute scripts via the controller with this protocol?

  3. Hi,
    I have an issue with Ajax TruClinet.
    In my application,click on a button(say login) is taking lots of time. When i record it , the script has recorded it as “Click Login”& then goes to another page.
    Now i want to record how much time it has taken between the login and page refresh.
    What should be between the lr_start_transaction & lr_end_transaction. Apart from “Login Click”.

  4. Hi frnds,
    Am trying to record a script using Ajax TruClient (both Mozilla firefox, IE). But when I clicked on “Develop Script”, an error popup stating “Communication between VuGen and the TruClient browser could not be established. This error occured because you do not have proper permissions”. Please help me out of this problem.

    OS- Windows7
    Mozilla firefox version – 17.0.1
    LR version – 11.5
    Please send ur solutions to my mail ID- [email protected]

    Thanks in advance.

    Regards,
    Sairam.

  5. You need to set network permissions.
    run the following command in a command prompt

    netsh http add urlacl url= user=

    Hope this help you

  6. Hey Guys, Quick question…
    in my application, there is a business process that throws a warning popup (like the alert you shown above.). But the issue is the alert is not shown always.. for some conditions it will show and for some it will not. the script currently fails for transactions where alert dialog is NOT shown. How to put a condition around this to NOT to fail if the dialog is not shown?

    Thanks Raj

  7. Facing issue with popups blocker-
    How to handle the pop up in load mode? it is a necessary login popup prompting userid and password, during replay if we enable screenshot it shows pop up blocker window and script failed.

  8. Hello, I set the disable_open_during_load value to false and after I can’t open firefox (I’ve tried to set true value) but now, nothing works! help!!
    Thaks

Leave a Reply

Your email address will not be published. Required fields are marked *