Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to make Browser and Page objects generic (undependent of title/etc)
#1
Solved: 11 Years, 4 Months ago
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!
Reply
#2
Solved: 11 Years, 4 Months ago
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)
Reply
#3
Solved: 11 Years, 4 Months ago
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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to make QTP Script to work when system gets locked? ramkumarad 6 12,467 11-02-2017, 03:37 PM
Last Post: Divv
  Objects are being recognized as "Windows for Menu item list (Browser-firefox, UFT 12) akhandesh 0 2,528 05-27-2015, 06:29 PM
Last Post: akhandesh
  Local script to make compatible with QC automation2012 1 2,291 01-28-2015, 02:11 PM
Last Post: automation2012
  How to make QTP take the value of a formula in a spreadsheet? utestqa 1 3,121 07-06-2013, 04:13 PM
Last Post: Ankur
  Cannot find the "[ WebButton ]" object's parent "[ Page ]" (class Page) sumitparolkar@gmail.com 4 5,073 05-03-2013, 11:53 PM
Last Post: agarwl.anurag

Forum Jump:


Users browsing this thread: 1 Guest(s)