How to make Browser and Page objects generic (undependent of title/etc) - 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: How to make Browser and Page objects generic (undependent of title/etc) (/Thread-How-to-make-Browser-and-Page-objects-generic-undependent-of-title-etc) |
How to make Browser and Page objects generic (undependent of title/etc) - MGMN - 07-31-2008 I'm new to QTP and use the QTP tool to automate the testing in a web based application. My question is how to make a Browser and/or Page "generic" so that QTP recognize it even if the title of the page changes depending on which brand/model you choose on the intro page. Is this done via regular expression on some browser/page properties or how have you handled/solved this in your web based applications? At the moment new browser and page objects are created in the local Object Repository each time I re-record choosing a new brand/model. I want a generic Browser and Page object where all the other objects on the sub-pages are collected. This also leads to that a link on a page isn't recognized when a random brand/model has been picked on the page (via a function) and since the link isn't found the test stops/fails. I would appreciate any guidance that will help me to solve this issue. Thanks! RE: How to make Browser and Page objects generic (undependent of title/etc) - surya_7mar - 07-31-2008 Code: Browser("name:=.*").Page("name:=.*") This is generic declaration which recognises all the pages. If you want to create that in Object Repositroy you can out name property as .* (Regular Expressions) RE: How to make Browser and Page objects generic (undependent of title/etc) - MGMN - 07-31-2008 Now the link was recognized when running the test. Thanks for your answer, suya_7mar! My next step is to try to gather all the page objects in the same Browser/Page in Object Repository, hopefully this will work fine now that I use the regular expression. |