![]() |
Check existence of web objects on page - 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: Check existence of web objects on page (/Thread-Check-existence-of-web-objects-on-page) |
Check existence of web objects on page - eltee - 03-16-2011 I have 10 Webedit and 2 Weblist fields in the web application page. I need QTP to (a) Validate their existence on the page and if yes, check if they are greyed out (disabled) (b) Compare the values against a global datasheet Could you please help me write a generic function which can be used to do (a) and (b) for different web objects like WebEdit, WebList, Radiobutton etc? Thanks a ton! Liju RE: Check existence of web objects on page - basanth27 - 03-16-2011 Would you paste the code you have tried so far? Would be easier to correct it. Furthermore, you dont have to consider how many webedits and weblists are on the webpage. You can make it very generic, such as, you pass the object and it should check for the conditions you have. RE: Check existence of web objects on page - eltee - 03-16-2011 I'm sure there's lots wrong in here ![]() Object doesnt support this property or method: ExistsAndDisabled Browser("IPSDK WEB GUI (Search)").Page("Customer Info").Frame("Quote Header").Table("Quote_Header_Table").WebEdit("Quote_RefId") My code for one webedit field : ------------------------------ Code: Dim QuoteName RE: Check existence of web objects on page - basanth27 - 03-16-2011 See if this works, Code: Dim QuoteName ![]() RE: Check existence of web objects on page - eltee - 03-16-2011 I was able to resolve this as soon as I made changes to the syntax: Code: Set QuoteRefId = Browser("IPSDK WEB GUI (Search)").Page("Customer Info").Frame("Quote Header").WebEdit("Quote_RefId") Earlier, the Webedit was shown under a Webtable, hence QTP was not supporting it. Without manually calling the function ExistsandDisabled for each web object like Webedit, Weblist etc, is it possible to write a function which would do ExistsandDisabled() functions for all webobjects on the shown page? Right now, I have to write separate code for 10-12 webobjects on the page ![]() RE: Check existence of web objects on page - basanth27 - 03-16-2011 Its called registeruserfunc. You can register userdfined function against objects. Search and learn about it. |