JTAF-ExtWebDriver icon indicating copy to clipboard operation
JTAF-ExtWebDriver copied to clipboard

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

Open ghost opened this issue 10 years ago • 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

ghost avatar Oct 27 '14 22:10 ghost

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.

philiphan avatar Oct 27 '14 22:10 philiphan

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?

mchao47 avatar Oct 27 '14 22:10 mchao47

@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.)

bryantrobbins avatar Oct 27 '14 22:10 bryantrobbins