4

I always get a doubt that:

What exactly is the difference between the working of Browser and Page.

I know it is a hierarchy and that stuff, but how does the tool differentiates the browser and page and what is use of having both of them.

For example, if I use descriptive programming, and type:

Browser("title:=Google").Page("title:=Google").something

irrespective of the Browser (which may be IE / Chrome / Firefox) it will use the browser with the title = Google. And same is for the page.

Please elaborate. I am confused.

explorer
  • 127
  • 2
  • 3
  • 13

1 Answers1

2

There's an explanation of what Browser and Page are supposed to represent on HP's blog.

In short Page has no semantic meaning, it is just used in order to organize the object repository more cleanly (so that you don't get hundreds of objects under one Browser object). If you're using descriptive programming (as I see from your example) then the Page has no meaning (since every browser has only one Page) and having a description for the page adds nothing.

I would replace the line with:

Browser("title:=Google").Page("title:=.*").something

Or

Browser("title:=Google").Page("micclass:=Page").something
Motti
  • 110,860
  • 49
  • 189
  • 262
  • `Browser("title=.*").Page("title:=Google").something` is also same? I was thinking for this from so long. This is actually useless. Thanks. – explorer Jun 17 '14 at 08:22
  • @explorer not exactly, if there are multiple browsers this will fail due to the object not being unique, however if the description is on the `Browser` it will succeed. – Motti Jun 17 '14 at 09:39
  • Okay. And I guess it will succeed when there is only one browser. Thanks for help. I guess you have become my UFT guide! :) – explorer Jun 17 '14 at 10:34