Micro Focus QTP (UFT) Forums
Validating Browser Name thru QTP - 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: Validating Browser Name thru QTP (/Thread-Validating-Browser-Name-thru-QTP)



Validating Browser Name thru QTP - NeedQTPHelp - 04-17-2009

Hi,
I am new to QTP and I need some help. I am trying to create a script that validates the Browser title of a website. When I go to different applications the Browser title keeps changing and I need to validate the change.

My question is how do I get the browser title. When I do an object spy I get the title of the browser but I want help with the code that I should right to validate the browser title.

Thanks in advance for the help


RE: Validating Browser Name thru QTP - Tarik Sheth - 04-17-2009

Hi,

You can try doing following.

Code:
Browser("title:=Yahoo.*").Page("title:=Yahoo.*").webedit(..).click()
If you have 3 different browsers you can have the browser name starting from and use regular expression.
You should some thing called as expected result


RE: Validating Browser Name thru QTP - dvkbabu - 04-17-2009

Hi,

Using GetROProperty we can get the runtime properties for any object.

If you are working with only one browser on your desktop then we can use the following code to get the Title

Code:
BrowserName=Browser("micclass:=Browser").GetROProperty("name")
PageName=Browser("micclass:=Browser").Page("micclass:=Page").GetROProperty("title")

Title ="xxxxx"

validate the BrowserName with the variable 'Title' that you have

Thanks,
Vijay


RE: Validating Browser Name thru QTP - NeedQTPHelp - 04-18-2009

You suggestion was very useful. Appreciate the help that this forum provides to people like me Smile