How do I relaunch the applciation if it fails

RMB

New Member
Hi mates, new to BP and learning continuously.

I have scenario like I need to open a web page and if I see a page cant be displayed error I need to try few iterations. So, in this case I need to launch the applciation after start as a navigation and then I am kind of stuck like how do I define a error page if there is a error page then terminate the application and wait for 2 seconds and re-launch the application.

any pointers would be appreciated.
 

VJR

Well-Known Member
how do I define a error page if there is a error page then terminate the application and wait for 2 seconds and re-launch the application.
Hi RMB,

Spy the element that shows the "Page cannot be displayed" message. Have a Reader stage to read this error message. While running the diagram if the message is read into a Data item then that means the error page is opened.
By "terminate the application" I assume you are referring to the IE browser application because you are talking about a webpage. You will have a Terminate action in the Navigate stage when used for the root element. Then use a Wait stage and then Launch the application which will again be available as a Launch action in the Navigate stage for the root element, just like you may have done for the first time launch. Launching an application attaches itself to the Object. So I don't think so but if it anywhere requires the Attach/Detach actions then use it at appropriate places if it becomes necessary.
You may already know but this retry has to be only for a certain number of times else the diagram would have the potential to go into an infinite loop.

But if the message is not read then it means that another page has been opened and the Reader stage will throw a "No elements match the supplied query terms".
Use the Block -> Recover -> Resume stage making the diagram understand that this was the error message. This will be known from the Exception Details functions. If it was this error message then you can continue using the application as normal. If not then there is some other error than the above two and that needs to be handled as an Exception handling practice.

As an alternative you can also use the Wait stage with a 'Check exists' action on an element combined with the above logic to check whether the required page is loaded or not.
 
Top