1 Reply Latest reply: Jun 11, 2012 10:50 AM by Dominik Grupp RSS

FirefoxDriver cannot be found

Dominik Grupp Newbie

Hi there,

 

when using DefaultSelenium as browser controller my Selenium tests work fine. However, when using the webdriver API they fail with

 

java.lang.IllegalStateException: Unable to find implementation class

                                org.openqa.selenium.firefox.FirefoxDriver

                     on current classpath. Please make sure it is present on the classpath.

 

The classpath, though, is fine. The source is included via maven using the artifact "arquillian-drone-webdriver-depchain" as stated in the documentation. The test is compiled fine. What do I need to change?

 

<arquillian xmlns="http://jboss.org/schema/arquillian"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="
        http://jboss.org/schema/arquillian
        http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
          <engine>
                    <property name="deploymentExportPath">target/</property>
          </engine>
          <extension qualifier="webdriver">
                    <property name="implementationClass">
                                org.openqa.selenium.firefox.FirefoxDriver
                    </property>
          </extension>
</arquillian>

 

example test class

 

@Drone
          WebDriver driver;

          @ArquillianResource
          URL deploymentURL;

          @Test
          @RunAsClient
          public void should_login_successfully() {

                    driver.get(deploymentURL + "login.jsf");
                    WebElement eLoginname = driver.findElement(By.id("loginForm:loginname"));
                    eLoginname.sendKeys("myUser");
                    WebElement ePassword = driver.findElement(By.id("loginForm:password"));
                    ePassword.sendKeys("myPwd");
                    ePassword.submit();

                    System.out.println("Page title is: " + driver.getTitle());

                    (new WebDriverWait(driver, 10)).until(new ExpectedCondition<Boolean>() {
            public Boolean apply(WebDriver d) {
                return d.getTitle().toLowerCase().startsWith("content");
            }
        });

                    System.out.println("Page title is: " + driver.getTitle());

        driver.quit();
          }