Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What is the best way to launch the browser
#1
Not Solved
Good afternoon everybody,

I have come across a post in this forum where someone has used the following code to launch the browser


Code:
function open()
   Dim oexplorer
   Set oexplorer=createobject("InternetExplorer.application")
   oexplorer.visible=true
   oexplorer.navigate "http:\\yahoo.in"
   Set open=oexplorer
   Set oexplorer=nothing
   End Function

   Call open()

It is an interesting way, no doubt. But which is the best way to launch the browser and why. Calling a function like this or a simple systemutil.run?


Thank you so much

Soumya
Reply
#2
Not Solved
There are many ways to launch Browser, I decide my comfortable level and used below code.

Code:
SystemUtil.Run "iexplore.exe"
Browser("title:=.*").page("title:=.*").Sync
Browser("title:=.*").Navigate "www.google.co.in"
Reply
#3
Not Solved
Hi Ramesh,
I also used to follow the same conventional method. but i was told that it is not an optimal solution. Calling a function is one of the methods, but i do not know the advantages of one method over the other.
Reply
#4
Not Solved
Code:
function open(strURL)
Dim oexplorer
Set oexplorer=createobject("InternetExplorer.application")
oexplorer.visible=true
oexplorer.navigate strURL
Set open=oexplorer
Set oexplorer=nothing
End Function


Call open("http:\\yahoo.in")

I think this approach will make the function dynamic.

Regards,
Sankalp
Reply
#5
Not Solved
The LOC that I prefer is as below. Some benefits here are,
* with this we can open any browser,
* open the browser in maximized state, and also,
* in the first step itself we navigate to the test application directly at launch. This way we also optimize the Automation test execution by minimizing a test step to navigate to the required test application.

<Code Starts Here>

Code:
SystemUtil.Run Environment("BrowserName"),Environment("TD_URL"),Environment("BrowserLocation"),"", 3

<Code Ends Here>


Note:
There are 3 environment variables used by me in the above code.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Cannot find the "[ WebEdit ]" object's parent "[ Browser ]" (class Browser). Verify t Divya Roopa 1 8,474 03-11-2014, 12:13 PM
Last Post: devarapallliramana
  VBS to launch QTP 9.2 and invoke script automatically test123 2 11,983 05-08-2008, 09:17 PM
Last Post: Sri

Forum Jump:


Users browsing this thread: 1 Guest(s)