infradna / selenium-client-factory

Factory to abstract away Selenium instantiation
http://selenium-client-factory.infradna.com/
15 stars 10 forks source link

Get AbstractMethodError when I pass DesiredCapabilities to createWebDriver(); #9

Open thephilwells opened 10 years ago

thephilwells commented 10 years ago

I'm trying to do this:

DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("name", testName);

Driver = SeleniumFactory.createWebDriver(capabilities);

And here is the error I get:

java.lang.AbstractMethodError: com.saucelabs.selenium.client.factory.spi.SeleniumFactorySPI.createWebDriver(Lcom/saucelabs/selenium/client/factory/SeleniumFactory;Ljava/lang/String;Lorg/openqa/selenium/remote/DesiredCapabilities;)Lorg/openqa/selenium/WebDriver;
    at com.saucelabs.selenium.client.factory.SeleniumFactory.createWebDriverInstance(SeleniumFactory.java:320)
    at com.saucelabs.selenium.client.factory.SeleniumFactory.createWebDriverInstance(SeleniumFactory.java:303)
    at com.saucelabs.selenium.client.factory.SeleniumFactory.createWebDriver(SeleniumFactory.java:109)
    at com.Driver.get(Driver.java:209)

Seems to be stemming from this abstract class in SeleniumFactorySPI.java:

public abstract WebDriver createWebDriver(SeleniumFactory factory,String browserURL, DesiredCapabilities capabilities);

Here are the versions I'm using:

    <dependency>
        <groupId>com.saucelabs.selenium</groupId>
        <artifactId>sauce-ondemand-driver</artifactId>
        <version>2.8</version>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>com.saucelabs.selenium</groupId>
        <artifactId>selenium-client-factory</artifactId>
        <version>2.13</version>
    </dependency>
rossrowe commented 10 years ago

Hi Phil, can you try use the same version for both dependencies, eg.

<dependency>
    <groupId>com.saucelabs.selenium</groupId>
    <artifactId>sauce-ondemand-driver</artifactId>
    <version>2.13</version>
    <scope>test</scope>
</dependency>

<dependency>
    <groupId>com.saucelabs.selenium</groupId>
    <artifactId>selenium-client-factory</artifactId>
    <version>2.13</version>
    <scope>test</scope>
</dependency>