LoadRunner Support Forum
Showing results for 
Search instead for 
Do you mean 

TruClient - extracting a value out of an object to determine a flow of execution

SOLVED
Go to Solution
Occasional Advisor

TruClient - extracting a value out of an object to determine a flow of execution

 

I am trying to find the way to get a value out of an object and then determine the flow of execution based on the extracted value. While truClient provides a way to verify an object (using the Verify function) , I can’t find a way get results of the verification and put it as the condition my “if()” statement.

 

The pseudo code for what I am trying to do is:

Navigate to web page;

for (i=0 ; i < 5 ; i++) {

  Find the token "XXXX"  in the web page;

  if (found) {

    exit with "Pass" status;

  } else {

    wait 2 seconds;

    reload the web page;

  }

  exit with "Fail" status;

 

I have everything in the this code figured out besides how to find the "XXXX" in the web page and assign the result (whether it was found or not) into a boolean variable that I can use in my if() statement.

 

I tried to use "Eveluate JS on object" to extract the value of "XXXX" out of my web page, by selecting the token on my page. What I don't understand is where is the extracted value being assigned to or how can I assign it to a JS variable.

 

I appreciate any help.



1 ACCEPTED SOLUTIONS
Highlighted
HPE Expert

Re: TruClient - extracting a value out of an object to determine a flow of execution

[ Edited ]

I'm not sure what object you are searching for. for example if you are searching for a simple text in the web page, following should work.

 

i = window.find("XXXX")
if (i == true)
  LR.log("Found", "Status");
else
  LR.log("Not Found", "Status");


4 REPLIES
Highlighted
HPE Expert

Re: TruClient - extracting a value out of an object to determine a flow of execution

[ Edited ]

I'm not sure what object you are searching for. for example if you are searching for a simple text in the web page, following should work.

 

i = window.find("XXXX")
if (i == true)
  LR.log("Found", "Status");
else
  LR.log("Not Found", "Status");


Occasional Advisor

Re: TruClient - extracting a value out of an object to determine a flow of execution

Thanks for your solution. I ended up using the full version of find(...), so that I can have the aSearchInFrames parameter set to "true", since my page includes frame.
Advisor

How to capture the event TAB on AJAX TRU CLIENT

Hi,

 

I'm recording an application , where pressing tab on a text box after inputing a value some event got display on application scren. But this action is not getting captured on AJAXTRUCLIENT . So while replaying the script fails .

 

Please help me to find a solution to it .

 

 

Regards,

Manas

 

manasranjan.jena@capgemini.com   or manasranjan81@gmail.com

Advisor

Re: How to capture the event TAB on AJAX TRU CLIENT

Hi,

 

I assume the inputting a value action is captured and the pressing tab on a text box action is not captured, right?

 

Is the tab a customized object?

 

Thanks,

Nicholas