Re: TruClient - extracting a value out of an object to determine a flow of execution (4229 Views)
Reply
Occasional Advisor
gc_pi
Posts: 16
Registered: ‎06-14-2011
Message 1 of 5 (4,256 Views)
Accepted Solution

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.



HP Expert
KMadan
Posts: 1,090
Registered: ‎05-27-2009
Message 2 of 5 (4,229 Views)

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");



Madan
Occasional Advisor
gc_pi
Posts: 16
Registered: ‎06-14-2011
Message 3 of 5 (4,218 Views)

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
manas123
Posts: 14
Registered: ‎03-27-2013
Message 4 of 5 (3,271 Views)

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
NicholasLi
Posts: 13
Registered: ‎07-21-2011
Message 5 of 5 (3,148 Views)

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

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.