Micro Focus QTP (UFT) Forums
How to invoke browser without using OR - 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: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: How to invoke browser without using OR (/Thread-How-to-invoke-browser-without-using-OR)



How to invoke browser without using OR - alpha1 - 07-20-2015

Hi,
I wanted to know if we can simply open a browser without first recording it, I wrote

Code:
Browser("IE").Page("Google").WebButton("Google Search").Click



Also, I tried below code,

Code:
SystemUtil.Run "iexplore", "www.google.com"

With Browser("Internet Explorer").Page("Google")
  .WebButton("Google Search").Click
End With

Or, Simply

Code:
Browser("Internet Explorer").OpenNewTab

In all above cases I get error that "Internet Explorer" object not found in repository & find a correct name of object"

So, what to write in place of "Internet Explorer" in all three above cases. Attached is screenshot of result.

Thanks for help!!


RE: How to invoke browser without using OR - ravi.gajul - 07-20-2015

Use Descriptive programming approach if you donot want to use Object Repository. For browser go for ordinal identifier "creation time" for identifying the same.
For browser it is
Code:
Browser("creationtime:=0")



RE: How to invoke browser without using OR - alpha1 - 07-20-2015

Hi,
Thanks for replying, I tried simple code below

Code:
Browser("creation time:=0").OpenNewTab

However got error that browser object cant be identified. Pls see error in screenshot attached.
So, is there no way to start/invoke browser without first having it in OR.

thnx for help


RE: How to invoke browser without using OR - ravi.gajul - 07-20-2015

My bad...there is no space between creation and time.Try this.
Code:
Browser("creationtime:=0").Highlight



RE: How to invoke browser without using OR - alpha1 - 07-21-2015

Hi,
This worked, Thanks for help Smile