Error Running Test Class

Asked

Viewed 199 times

0

Good afternoon! All right?

When running the User Informationtest class, it is showing the following errors:

  • Error:(4, 20) java: package org.Selenium does not exist
  • Error:(5, 27) java: package org.selenium.Chrome does not exist
  • Error:(15, 9) java: cannot find Symbol Symbol: class Webdriver Location: class tests.Informationuser
  • Error:(15, 35) java: cannot find Symbol Symbol: class Chromedriver Location: class tests.Informationuser I am also unable to import packages from Selenium.

"Informationuser test.class"

package tests;

import org.junit.Test; import org.selenium.Webdriver; import org.selenium.Chromedriver;

import Static org.junit.Assert.assertEquals;

public class Informacoesusuariotest {

@Test
public void testAdicionarUmaInformacaoAdicionalDoUsuario( ) {
    System.setProperty("webdriver.chrome.driver","C:\\Users\\Jéssica\\drivers\\chromedriver.exe");
    WebDriver navegador = new ChromeDriver(); //variavel navegador com uma instância chrome
    assertEquals(1,1);
}

}

The Archive pom.xml is configured like this:

http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0

<groupId>br.com.juliodelima.webdriverjava</groupId>
<artifactId>webdriverJava</artifactId>
<version>1.0-SNAPSHOT</version>

<dependencies>
    <!-- https://mvnrepository.com/artifact/junit/junit -->
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.12</version>
        <scope>test</scope>
    </dependency>

    <!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>3.6.0</version>
    </dependency>
</dependencies>

I tried to redo the configuration, however, errors persist.

Can you help me, please?

Thank you!

1 answer

0


Jessica,

I checked in the Selenium jars that the package names start with org.openqa.selenium. Change your Imports to:

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
  • It worked. Thank you!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.