Micro Focus QTP (UFT) Forums
Window check - 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: Window check (/Thread-Window-check)

Pages: 1 2


Window check - Anna - 07-22-2008

I am trying to do a check point similar to win_exists in Winrunner

Code:
If  not Browser("Car").Page("Page").Exist(3)
then do something ..
End If

This does not work. I have no idea why. The window ALWAYS exists .. Is there another method I can use?


RE: Window check - prince3105 - 07-22-2008

Its a Webapplication or Window application?


RE: Window check - Anna - 07-22-2008

Web application ..


RE: Window check - niranjan - 07-22-2008

I presume that you are using OR.
In the Object Repository, disable smart identification for this page object and add more properties like title, etc.
And your code should work fine.


RE: Window check - Anna - 07-22-2008

I will give it a try .. Thanks


RE: Window check - Anna - 07-22-2008

The Smart Identifier was already disabled. What is best practice for the web? Should I enable or disable?


RE: Window check - niranjan - 07-22-2008

Well, it depends on what one is trying to achieve.
If you are are using .Exist, then its better to disable smart identification.

In your case, do one more thing.
Open OR and highlight the objects. For instance, if you have one browser(google) and two pages (google, and inbox).
navigate to google page and click on highlight for page inbox in OR.
If it highlights the page, that means you need to add more properties like title, etc.
It should only recognize the inbox page.
Got it?


RE: Window check - Anna - 07-22-2008

I have anther problem. When I change Enable Smart ID to False in the Object - Repository All Object Repositories window it changes back to True when I close the OR window and reopen it. Since there is no save option I tried saving the project again.. and that did not work. Any ideas? It almost looks like it's a bug


RE: Window check - quickmy - 07-22-2008

Try this,
Go to Tools-> Object Identification. Select Environment as Web,and check whether Enable Smart Identification is Unchecked for Test Object Classes.I think this will resolve your problem.


RE: Window check - Anna - 07-22-2008

1. Every Test object had the Enable Smart ID option. Do you mean to un-check that option for everyone or just the one I am having trouble with?