Error while compiling Maven Selenium project - no compilation error packages found

I tried to run maven Selenium testing project (maven -install)

Below the pumps

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
<groupId>deprecated</groupId>
<artifactId>deprecated</artifactId>
<version>0.0.1-SNAPSHOT</version>

<dependencies>
     <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>2.46.0</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-server</artifactId>
        <version>2.46.0</version>
    </dependency>
    <dependency>
  <groupId>org.testng</groupId>
  <artifactId>testng</artifactId>
  <version>6.9.4</version>
  <scope>test</scope>
</dependency>
</dependencies>

<build>

 <sourceDirectory>src</sourceDirectory>
    <plugins>
    <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.3</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.14.1</version>
            <configuration>
             <archive>
            <manifest>
              <addClasspath>true</addClasspath>
            </manifest>
          </archive>
            <forkMode>never</forkMode>
                <suiteXmlFiles>
                    <suiteXmlFile>testsuite/TestSuiteBukalapak.xml</suiteXmlFile>
                </suiteXmlFiles>
            </configuration>
        </plugin>
    </plugins>
</build>

</project>

      

Compilation error complaining about package org.openqa.selenium does not exist, package org.testng does not exist, package org.testng.annotations and others are missing, as if something is missing in the maven assembly.

[INFO] Compiling 43 source files to D:\deprecated\selenium_testng\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /D:/deprecated/selenium_testng/src/deprecated/Tambah_Alamat.java:[3,27] package org.openqa.selenium does not exist
[ERROR] /D:/deprecated/selenium_testng/src/deprecated/Tambah_Alamat.java:[4,27] package org.openqa.selenium does not exist
[ERROR] /D:/deprecated/selenium_testng/src/deprecated/Tambah_Alamat.java:[5,35] package org.openqa.selenium.support does not exist
[ERROR] /D:/deprecated/selenium_testng/src/deprecated/Tambah_Alamat.java:[6,18] package org.testng does not exist
[ERROR] /D:/deprecated/selenium_testng/src/deprecated/Tambah_Alamat.java:[7,30] package org.testng.annotations does not exist
[ERROR] /D:/deprecated/selenium_testng/src/deprecated/core/Settings.java:[5,27] package org.openqa.selenium does not exist
[ERROR] /D:/deprecated/selenium_testng/src/deprecated/core/Settings.java:[6,34] package org.openqa.selenium.chrome does not exist
[ERROR] /D:/deprecated/selenium_testng/src/deprecated/core/Settings.java:[7,34] package org.openqa.selenium.chrome does not exist
[ERROR] /D:/deprecated/selenium_testng/src/deprecated/core/Settings.java:[8,34] package org.openqa.selenium.chrome does not exist
[ERROR] /D:/deprecated/selenium_testng/src/deprecated/core/Settings.java:[9,35] package org.openqa.selenium.firefox does not exist
[ERROR] /D:/deprecated/selenium_testng/src/deprecated/core/Settings.java:[10,35] package org.openqa.selenium.firefox does not exist
[ERROR] /D:/deprecated/selenium_testng/src/deprecated/core/Settings.java:[11,42] package org.openqa.selenium.support.events does not exist
[ERROR] /D:/deprecated/selenium_testng/src/deprecated/core/Settings.java:[12,18] package org.testng does not exist

      

Could you please help give me a hint, any specific dependency that I need to insert into the pom? thank

+4


source to share


4 answers


You can add below depdency and try:

<dependency>
    <groupId>org.openqa.selenium.server</groupId>
    <artifactId>selenium-server-coreless</artifactId>
    <version>1.0-20081010.060147</version>
</dependency>

      



More details here

0


source


try adding



    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-chrome-driver</artifactId>
        <version>${selenium.version}</version>
    </dependency>

      

0


source


Today I met the problem just like you. Here's how I fix it:

  • I downloaded "geckodriver V0.10.0" from here: https://github.com/mozilla/geckodriver/releases , I am using mac so the file I selected is geckodriver-v0.10.0-macos.tar.gz

  • I also update the selenium server version to 3.0.0-beta2 from here: http://www.seleniumhq.org/download/ => [Download version 3.0.0-beta2]

  • Finally, I set the required property to use "geckodriver" in the code before the new FirefoxDriver:

    System.setProperty ("webdriver.gecko.driver", "/ XXX / YYY / geckodriver");

Then it worked, hope it is helpful for you.

Eventually I found that the imported package had changed from "org.openqa.selenium.server.SeleniumServer;" to "org.openqa.selenium.remote.server.SeleniumServer"

* For reference: http://learn-automation.com/use-firefox-selenium-using-geckodriver-selenium-3/

0


source


Trying to replace selenium addiction

<dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-java</artifactId>
    <version>3.141.59</version>
</dependency>


      

0


source







All Articles