Micro Focus QTP (UFT) Forums
Close Tab Recognizes GetROProperty. WHY??? - 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 Others (https://www.learnqtp.com/forums/Forum-UFT-QTP-Others)
+--- Thread: Close Tab Recognizes GetROProperty. WHY??? (/Thread-Close-Tab-Recognizes-GetROProperty-WHY)



Close Tab Recognizes GetROProperty. WHY??? - Ayesha - 07-23-2013

Code:
MsgBox Browser("Username Dropdown").Page("Impersonate User").WebElement("UserName").GetROProperty("name")
- This displays result as UserName

Code:
Browser("Username Dropdown").Page("Impersonate User").WebElement("Cancel").Click
- we Closed the window here

Code:
MsgBox Browser("Username Dropdown").Page("Impersonate User").WebElement("UserName").GetROProperty("name")
- This also displays the name even after the modal window is closed.

Why is QTP doing that? any thoughts?


RE: Close Tab Recognizes GetROProperty. WHY??? - basanth27 - 07-24-2013

Probably you may want to do a .Exist first and see if it returns true. If yes, then it is not visible to the naked eye and merely hidden at the background which QTP can find as it blindly looks for that object properties. Hence it may be returning the value.


RE: Close Tab Recognizes GetROProperty. WHY??? - Ayesha - 07-24-2013

Hi Basanth,

Thank you so much for the reply.

I tried the .exist as well. I said true for both times.
Code:
MsgBox Browser("Username Dropdown").Page("Impersonate User").WebElement("UserName").GetROProperty("visible") = "True"
- This displays result as True

Code:
Browser("Username Dropdown").Page("Impersonate User").WebElement("Cancel").Click
- we Closed the window here

Code:
MsgBox Browser("Username Dropdown").Page("Impersonate User").WebElement("UserName").GetROProperty("visible") = "True"
- This also displays True value even after the modal window is closed.

I am confused on why? Please help!


RE: Close Tab Recognizes GetROProperty. WHY??? - basanth27 - 07-24-2013

Yes. Thats what i had thought. So, the object does exist but is masked by the developer. Hence, you cannot see it on the screen but it does exist at the background.

What is your objective of test? Probably based on that I will be able to suggest.

BTW, If you have tried the visible, would you check it as below.

Code:
MsgBox Browser("Username Dropdown").Page("Impersonate User").WebElement("UserName").GetROProperty("visible")



RE: Close Tab Recognizes GetROProperty. WHY??? - Staff - 07-24-2013

Please ensure to include your code between [code] tags while asking or replying to questions. I have done this for you for this time.


RE: Close Tab Recognizes GetROProperty. WHY??? - vinod123 - 07-24-2013

because close tab window is nothing but a dialog box. For every dialog box has properties for it. GetROProperty is used for getting the property details of the object.As you included GetROProperty statement after closing the dialog box that is the reason it displaying property value after closing the window