Micro Focus QTP (UFT) Forums
Handler Page Redirects - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Handler Page Redirects (/Thread-Handler-Page-Redirects)



Handler Page Redirects - zunebuggy - 09-04-2020

We have an in-house web app that I am testing.

There is a form with a field and button.  
I have a long list of accounts and I know what is expected to be displayed on the screen for each account.
Each iteration I simply enter the account number, click the button and verify the screen for correct content.

We run this overnight.  At least once during the night, after clicking the button, it redirects to a main company page and my code does not know what to do.  It halts.

So I added code to look for an object on that redirect page and if it is there, close the browser and open it back up (what I would do manually).

Even though this redirect page is NOT displayed and NOT loaded, every time it comes to the IF statement, it is TRUE.  I have tried even "visible" = True and that is always true even when the redirect page is not visible.  The developers must have it pre-loaded somewhere and even though its state is visible (because visible is always True), it must be hidden.

There has to be a way to detect this page, if it exists, close all browsers (I have the code for this), relaunch the browser and let it resume.  Maybe I can check the URL in each iteration and if it equals the URL of the redirect page I can close and re-open the browser?  I do not know how to do this.

Or maybe there is an even better and easier way?

Thank you


RE: Handler Page Redirects - Ankur - 09-15-2020

I didn't understand from this part onward...
Quote:Even though this redirect page is NOT displayed and NOT loaded, every time it comes to the IF statement, it is TRUE.  I have tried even "visible" = True and that is always true even when the redirect page is not visible.  The developers must have it pre-loaded somewhere and even though its state is visible (because visible is always True), it must be hidden.


... but still it sounds like a fit case of using Recovery Scenarios. By any chance did you try them?