Re: how to catch error of previous step in next step and print in log as output (288 Views)
Reply
Frequent Advisor
himanshuk
Posts: 64
Registered: ‎12-17-2013
Message 1 of 3 (322 Views)

how to catch error of previous step in next step and print in log as output

[ Edited ]

I have got error Server not found, in next step I want to print it as lr_output_message in Ajax truClient,

in same step:

1.I take Releated Object tag I trace window (Add Related object) and add tag "Server not found"

in

2.next step I take catch error and in select Object Identification and try equate here Object Identification == server not found tag in previous step and want to take it as output in runtime log but could not get success

 It is printing Object Identification as error but in addition to this I want to print Server not found (error attached with this post)

prod support
telecom

Smile tomorrow will be worse !!!
Occasional Advisor
DagoCR
Posts: 7
Registered: ‎01-17-2014
Message 2 of 3 (288 Views)

Re: how to catch error of previous step in next step and print in log as output

Hello,

I think this can be a good way to do it.

- 1. Identify the object or step in which the error should come up.

- 2. Add a catch step after that step. Remeber a catch step can check for different errors. In my example I am looking for errors of "Any" type.

- 3. Add a "If-Verify" step into the Catch step to instruct what to do in case an error occurs. 

    * For the "If-Verify" step you should provide the object that contains the error message. The arguments are If Object´s Visible Text contains "Server not found"

- 4. Into the if-verify step we should give instructions about what to do in case the text "Server not found" is found. Add a "Evaluate JavaScript" step and add the following code:

    LR.log ("Server not found", "Error");

 

The text of the error message can be customized in the first  argument and the second argument is the level of the error:

- Error

- Warning

- Standard

- Extended

- Status

 

See the attachment for reference.

 

PD: if you are trying to capture any error message (not just Server not found) the logic is different. Please let me know.

Occasional Visitor
AGibbs
Posts: 1
Registered: ‎03-13-2014
Message 3 of 3 (241 Views)

Re: how to catch error of previous step in next step and print in log as output

Hi DagoCR,

I'm looking for the logic to catch any error if you could possibly give me some pointers?

Thanks

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.