oleg_sigalov
11 years agoOccasional Contributor
All Browsers have the same "BrowserIndex" = 1
I'm trying to get in a dynamic way the browser object, because I'm running crossbrowsing.
I've implemented this:
bProc = "iexplore" or "chrome"
BrowserIndex = Sys.Browser(bProc).BrowserIndex
Set browser = Browsers.Item(BrowserIndex)
I get always "browser" object as IE.
I've noticed in Object Browser" that all browsers have same "BrowserIndex" = 1
But I know that Chrome "BrowserIndex" = 3.
See attachments.
Thanks.
- From the help for BrowserIndex:
TheBrowserIndex
property specifies the browser index among other running browsers with the same name.
For example, if you have two different Firefox versions installed and both of them are currently running, the first launched Firefox process hasBrowserIndex
of 1 and the other one hasBrowserIndex
of 2.
Similarly, if 32-bit and 64-bit versions of Internet Explorer are running at the same time on 64-bit Windows, one browser instance hasBrowserIndex
of 1 and the other one hasBrowserIndex
of 2.
You have three separate browsers (IE, FF, Chrome), and each will have a BrowserIndex of 1 since there is only one instance for each type.
Are you looking for the Browsers.Item() property to get the specific browser?
Constant
Value
Description
btIExplorer
-1
Microsoft Internet Explorer.
btFirefox
-2
Mozilla Firefox.
btChrome
-3
Google Chrome.
btOpera
-4
Opera by Opera Software.
btSafari
-5
Apple Safari.