Forum Discussion
YMinaev
Staff
15 years agoHi,
You can use Robert's suggestion together with WaitAliasChild to get the launched browser:
Also, you can get the path to the default browser from the HKEY_CLASSES_ROOT\http\shell\open\command registry key (see and example of getting a registry value here).
You can use Robert's suggestion together with WaitAliasChild to get the launched browser:
...
' Step #5 ends here
Project.Variables.envBrowser = "iexplore"
Set browser = Aliases.WaitAliasChild("WebBrowser", 10000)
If Not browser.Exists Then
Project.Variables.envBrowser = "firefox"
Set browser = Aliases.WaitAliasChild("WebBrowser", 10000)
If Not browser.Exists Then ' Neither IE nor FF found. Exit your function with an error
End If
' Code which works with browser
...
Also, you can get the path to the default browser from the HKEY_CLASSES_ROOT\http\shell\open\command registry key (see and example of getting a registry value here).