Highlighted
Absent Member.. Absent Member..
Absent Member..
195 views

BPT - get and use current browser and page

Jump to solution

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

0 Likes
1 Solution

Accepted Solutions
Highlighted
Absent Member.
Absent Member.

Re: BPT - get and use current browser and page

Jump to solution

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

View solution in original post

1 Reply
Highlighted
Absent Member.
Absent Member.

Re: BPT - get and use current browser and page

Jump to solution

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

View solution in original post

The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.