FINRAOS/JTAF-ExtWebDriver

SessionManager getNewSession(key, value) does not override browser when set to browser and firefox

Opened this issue · 3 comments

I've noticed that calling SessionManager.getInstance().getNewSession("browser", "firefox") does not cause the firefox browser to be used by ExtWebDriver -- htmlUnitDriver is always used.

The javadoc indicates:

"Create and return a new ExtWebDriver instance. The instance is constructed with default options, with the provided key/value pair overriding the corresponding key and value in the options, and will become the current session. This is a convenience method for use when only a single option needs to be overridden. If overriding multiple options, you must use getNewSession(Map, boolean) instead."

Found in: ExtWebDriver version 1.4

This is probably an issue of phrasing in the Javadoc, rather than functionality.

The default SessionFactory implementation only uses the map of options to locate the client properties file. The browser is defined in this file as parsed by ClientProperties, with the default client.properties having browser=htmlunit.

At first glance, I believe this would be setting the browser capabilities - https://code.google.com/p/selenium/wiki/DesiredCapabilities.

Does "browserName" also not start in a firefox browser?

@philiphan is correct. The javadoc is inherited and is not accurate. The Default implementation only gets capabilities from the client properties file.

We could explore an enhancement for key/value pairs or a DesiredCapabilities object directly. (Either way, we should override this inherited Javadoc.)