BPT - get and use current browser and page

Dear HP Experts,

In order to test a web application I stored the objects (browsers, pages, links, ect) in repository and created a BPT containing few business components. Object (browser/page/link) name is parameterized at component level.

I would like to use the current browser and current page for all my components instead of passing every time (at test level) the browser name and page name. Can you find any solution to this?

 

P.S. : Browser("creationtime:=0").Page("micclass:=Page").Link("link_name").Click

will not work since the link is stored in repository under a hierarchy that looks like : Browser("br_name")->Page("pg_name")->Link("link_name") and obviously the test will look for the whole hierarchy to click this specific link.

 

Many many thanks!

Alex

Parents
  • Verified Answer

    Hi Alex,

    If you use programmatic description for a specific object, you have to use it down its entire hierarchy. As you mention, your example would not work because the Link object does not use programmatic description while its parents, Browser and Page, do. It is however possible to use it on the children and not on the parents (in your example you could use programmatic description on Link and not on Browser and Page; or on Link and Page and not on Browser). You have several approaches to address this:

    1. Use programmatic description through the entire hierarchy completely bypassing the object repository. For example: Browser("creationtime:=0").Page("micclass:=Page").​Link("name:=link_name").Click

    2. Use regular expressions in the object repository on the property values enabling you to identify the Browser and Page objects and at the same time enabling some parameterisation.

    I hope it helps!

    Kind Regards,

    Francisca

Reply
  • Verified Answer

    Hi Alex,

    If you use programmatic description for a specific object, you have to use it down its entire hierarchy. As you mention, your example would not work because the Link object does not use programmatic description while its parents, Browser and Page, do. It is however possible to use it on the children and not on the parents (in your example you could use programmatic description on Link and not on Browser and Page; or on Link and Page and not on Browser). You have several approaches to address this:

    1. Use programmatic description through the entire hierarchy completely bypassing the object repository. For example: Browser("creationtime:=0").Page("micclass:=Page").​Link("name:=link_name").Click

    2. Use regular expressions in the object repository on the property values enabling you to identify the Browser and Page objects and at the same time enabling some parameterisation.

    I hope it helps!

    Kind Regards,

    Francisca

Children
No Data