Forum Discussion
Hey Colin_McCrae,
Can you share the code for same (Multiple instances of browser)
Not much code to share really?
Using VBScript and a Windows Shell object to launch the executable ....
For Internet Explorer:
<Shell Object>.Run(project.Variables.<browser-in-use> & ".exe " & Project.Variables.<path-to-HTML-file> & "page.html", 1)
For Chrome:
<Shell Object>.Run (project.Variables.<browser-in-use> & ".exe --disable-hang-monitor --new-window file:///" & replace(Project.Variables.<path-to-HTML-file>, " ", "%20") & "page.html")
... and you would probably need to modify again for FireFox. I don't use that. (The IE version may be out of date? Not run this against IE for some time now. Not sure if it would cope with a file path with spaces in it ... the Chrome one will.)
The two project variables specify the browser in use (is used elsewhere) and the location of the basic little HTML file (which is literally about 4 lines long - just a basic 'You are on the Automation start page ...' type thing.)
Once loaded it simply finds the browser displaying the locally hosted HTML file. Resizes and locates as required. Then navigates elsewhere. Once navigated away from the start page (which is used solely for identification purposes) each browser/page is addressed by it's URL as they are all different.
If they are all on the same URL, you need to use something else. (As I mentioned above.)
So not much to say really? It's pretty straightforward. No fancy code. It's more about technique than code.
- Ravik9 years agoSuper Contributor
Thanks Colin_McCrae, :manwink: