java.lang.NoClassDefFoundError: org/openqa/selenium/remote/codec/w3c/W3CHttpCommandCodec

后端 未结 3 891
旧时难觅i
旧时难觅i 2021-01-22 02:44

I\'m beginner in this, so be patient :) I try to launch simple test and have a problem caused by: java.lang.ClassNotFoundException: org.openqa.selenium.remote.codec.w3c.W3CHttp

相关标签:
3条回答
  • 2021-01-22 03:03

    Was facing the same issue, I just updated the selenium java client to 4.0.0-alpha-1 issue got resolved

    my dependecies :

         <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>6.14.3</version>
            <scope>compile</scope>
        </dependency>
    
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>4.0.0-alpha-1</version>
        </dependency>
    
    
        <dependency>
            <groupId>io.appium</groupId>
            <artifactId>java-client</artifactId>
            <version>7.1.0</version>
        </dependency>
    
        <dependency>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.7.0</version>
        </dependency>
    
    0 讨论(0)
  • 2021-01-22 03:03

    You may get this exception when you update one dependency. For example: Appium java client to latest but the dependent Selenium Java dependencies are not updated to latest then you might expect this issue. So look at your Maven dependencies of related ones.

    0 讨论(0)
  • 2021-01-22 03:12

    You have to add a webdriver e.g.:

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

    org/openqa/selenium/remote/codec/w3c/W3CHttpCommandCodec is part of

    <dependency>
       <groupId>org.seleniumhq.selenium</groupId>
       <artifactId>selenium-remote-driver</artifactId>
       <version>3.14.0</version>
    </dependency>
    

    which is a dependency from selenium-firefox-driver

    0 讨论(0)
提交回复
热议问题