Quantcast
Viewing all articles
Browse latest Browse all 12134

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.


Viewing all articles
Browse latest Browse all 12134

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>