HomeOATS

How to make Openscript skip current child script failure and continue execution

Like Tweet Pin it Share Share Email

Assuming that you are aware of test data parameterization in OpenScript using databank, in case you are not aware, request you to go through the following article

Openscript test data parameterization with databanks

Now when we execute scripts for multiple iterations, it is highly possible that one of the test data iteration might fail / one of the child script might fail when there were bunch of child scripts called from a parent script.

Depending on the situation, some wants the entire execution to stop and report the error, but in most scenarios, you wish to skip the failed iteration / child script and continue the execution with next iteration or next child script.

Now lets see how we can make OpenScript skip the failure of current iteration or current child script and continue with next iteration / next child script.

There is an error recovery setting in OpenScript, which will help you to skip the current iteration and then move to next.

Steps to perform are as below:

  1. Navigate to View > OpenScript Preferences
  2. Under Playback > Error Recovery
  3. On the right of the window you see a section by name General , which has a setting for “Child Script Failed” , Select option “Report Error and Continue”
  4. Click Apply, Ok buttons and close the window.

Now when you execute the parameterized script with Iterate Playback, even if the script fails for 1 iteration, it would continue from next iteration till the end of all iterations.

I hope this will help you. In case of any queries, please do revert to us in form of comments, we would try our best to help you out.

lambdatest

Comments (8)

  • Hi ,

    Here, we are setting Report Error and Continue in tool level(in Error Recovery Widget).
    It is better to keep in the script level(Parent/master script). If we keep at tool level, every time we have check where setting is there or not.

    We can add below code/statement in the parent/master script.

    setErrorRecovery(BasicErrorRecovery.ERR_CHILD_SCRIPT_EXCEPTION, ErrorRecoveryAction.ReportErrorAndContinue);

    Thanks & Regards,
    Ramesh Jadala

    Reply
  • Hi Srinivas,

    Is there any way to stop the script execution as soon as a failure is encountered?
    Will it hold good for OTM aswell?

    Thanks
    Aisha

    Reply
    • Author

      Hi Aisha,

      As discussed with you, if you are using master driver script, one of the options is to have a global variable declared as false and in every child script @ initialize method set it to false and in the finish method set it to true.
      So in the master driver when you try to call each child script check if the global variable is true or not, otherwise you can skip execution of the script.

      Hope it helps, there can be other ways too.

      Thank You,
      Regards,
      Srinivas P.

      Reply
  • Hi,

    Can you please tell me, how to get value from databank and store it in a variable?

    Reply
    • Author

      Hi Rajkumar,

      Thank you so much for reaching out to us, it is quite interesting and easy, request you to go through the following article Test Data Parameterization with databanks in OATS

      I also, recommend another step, once you go through all the steps in this article, do click on “Code View” and you should be able to see the equivalent code, if you have to write any custom code based on your requirement.

      Please do revert to us in case of any further queries.

      Thank You,
      Regards,
      Srinivas P.

      Reply
  • Hi Srinivas,

    Thank you for your help.However,I could still see that Firefox version(45.0.esr) which was installed yesterday with Addons are disappeared but I could able to record and playback the Oracle forms now without any issues.I am wondering how is that possible as the OpenScript WebDOM is not verified again.

    Secondly,I was using Databank with a csv file with a list of order numbers to query and found that when I play the script,it skips one everytime and execute.Say for eg,if I have 6 orders to be queried,it displays only 1st ,4th and 6th skipping the other 3.

    Reply

Leave a Reply

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