Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
If Then Is Always True For Web Objects
#1
Not Solved Smile 
With our web testing automation, we do a lot of repetitive testing and occasionally, I guess due to poor development or whatever, we get redirected to a 404 page or Server Error page or 500 page, etc.  I added objects from each of these pages to the Object Repository and added If Then statements for each of them.

The issue is, when the program comes to the line with the If Then, even though the page is not displayed anywhere, the objects still exist so the If Then is ALWAYS True.

What unique object property can I use in the If Then that will not be True unless the page is actually being displayed?

Thank you.
Smile
Reply
#2
Not Solved
I even got the properties of one of the web pages that the web app is redirecting to, and added them to the repository. The Browser and Page are completely different than the web app. So I did a msgbox at runtime on the Browser and Page, which by the way were NOT open, and did Browser("Browser").Page("Page").Object.ReadyState and it was "complete". Ugh!

I want to have my script chug along being happy, and IF and ONLY IF the web app should redirect me, THEN do some action. The only issue is, every property of the page I am checking for says the page is open when it isn't. I even tried "visible" in GetROProperty. It always is visible even when it isn't.

I have a subroutine that will close all browsers and reset my script. When I get redirected, I want to Call this sub.

Thanks again.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Exist and Visible Are True When Objects Aren't There - Is there A Better Way? zunebuggy 3 3,201 04-24-2018, 02:12 PM
Last Post: Ankur
  How to connect two web element objects? zawarepradeep@gmail.com 1 2,690 07-23-2014, 11:23 PM
Last Post: Ankur
  Spy is not deteting Web objects ssandula 0 1,960 11-25-2013, 04:33 PM
Last Post: ssandula
  spell checking of web objects kriday 3 4,000 07-05-2013, 01:37 PM
Last Post: Staff
  Unable to identify the Web Objects in QTP 10 +IE 8 in Windows7 mahesh1612 2 4,376 02-08-2013, 03:26 PM
Last Post: mahesh1612

Forum Jump:


Users browsing this thread: 1 Guest(s)