How to check visibility of an Object - 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: How to check visibility of an Object (/Thread-How-to-check-visibility-of-an-Object) |
How to check visibility of an Object - ritugoyal - 08-03-2009 Hi All, Please help me to resolve my following problem. On my application I have an Object(Next button), its always available on the page in visible or hidden mode. Now if I put the condition: Code: if browser().Page().WebButton().Exist then but my first condition is always true and QTP always click Next button even though its in hidden mode. I dont want to click this button when its in hidden mode, Please can you tell me how can I resolve my this issue. Thanks All, RE: How to check visibility of an Object - Saket - 08-03-2009 Hi Ritu, Try adding one more description property for identifying button - 'visible' into repository or you can use descriptive programming for this. create object for button and use it Code: Set oButton = Description.Create() RE: How to check visibility of an Object - Ankur - 08-03-2009 This is a nice question Ritu. Exist will fail here because even though the object is not visible on the screen it is present inside the DOM and as you may know, QTP takes object from the DOM. To check for this I would advise you go to inside DOM using .object notation and check for display:none property. RE: How to check visibility of an Object - ritugoyal - 08-03-2009 Hi Ankur, Thanks a lot for quick reply. Yes. I know about DOM and that QTP pick objects from DOM. But can you plz tell me syntax how to use this display:none property. Regards, RE: How to check visibility of an Object - Ankur - 08-03-2009 Please try it once on your own, let us know the EXACT problem you faced while using .object notation and then we will provide help. We generally don't encourage giving direct answers on this forum. |