-
1. Re: Arquillian Drone initializes WebDriver instances with the default constructor
kpiwko Oct 2, 2011 8:39 AM (in response to vineet.reynolds)Hi Vineet,
if you're using Arquillian Drone 1.0.0.CR2, you already have (some of) these properties available for FirefoxDriver. See https://docs.jboss.org/author/display/ARQ/Drone for available arquillian.xml properties.
For your case, you can do the following:
<extension name="webdriver"> <property name="firefoxProfile">/foo/bar/.mozilla/profile</property> <property name="chromeSwitches">--load-extension=/path/to/extension/directory --start-maximized</property> </extension>
In your test, you have to create a specific Driver in order to get its configuration specified in arquillian.xml.
(note: it means that @Drone WebDriver driver will ignore these settings despite you've set implementationClass to FirefoxDriver or ChromeDriver)
public testWithChrome(@Drone ChromeDriver driver) { // here you've included some of the capabilities for ChromeDriver } public testWithFirefox(@Drone FirefoxDriver driver) { // here you're using specified profile }
I see that nowadays FirefoxDriver has now more properties than allowed by the Drone implementation.
In Selenium Server extension we allow to specify <property name="systemProperties">, which can contain arbitrary properties.
In your use case, it seems it makes sense to allow it for all WebDriver based drivers to solve your problems, what do you think?
Implementing Capability based constructor for WebDriver would likely lead to Spring-like "beans" in arquillian.xml , which I'd like to avoid.
Added note about specific *Driver.
-
2. Re: Arquillian Drone initializes WebDriver instances with the default constructor
vineet.reynolds Oct 3, 2011 3:04 AM (in response to kpiwko)Well, the updates in 1.0.0.CR2 do help. It is what I was looking for, but I think I didn't check the updated documentation (still on 1.0.0.CR1).
Having looked at the WebDriver javadocs, I could find that only FirefoxDriver relies heavily on system properties, whereas the others require API calls involving Capabilities. So I think, having a "systemproperties" property in arquillian.xml for all WebDrivers is an overkill. But this could be considered, if the WebDriver project starts exposing other configuration parameters for drivers via system properties.
By the way (considering the properties in FirefoxDriver not yet available in Drone), I think there must be some way to map Drone releases to Selenium/WebDriver releases, for the purpose of knowning which releases of both projects are compatible with each other.
-
3. Re: Arquillian Drone initializes WebDriver instances with the default constructor
kpiwko Oct 3, 2011 3:15 AM (in response to vineet.reynolds)Last 1.0.0.CR2 was tested against Selenium 2.5.0, so this version is verified as compatible. It is even present in Arquillian Drone Bom https://repository.jboss.org/nexus/service/local/artifact/maven/redirect?r=releases&g=org.jboss.arquillian.extension&a=arquillian-drone-bom&v=1.0.0.CR2&e=pom, so you get compatible release automagically.
If all the WebDrivers (except Firefox) use Capabilities, we should reconsider its inclusion into arquillian.xml.