<small id='Wn0Th'></small><noframes id='Wn0Th'>

      • <bdo id='Wn0Th'></bdo><ul id='Wn0Th'></ul>
    1. <tfoot id='Wn0Th'></tfoot>
    2. <i id='Wn0Th'><tr id='Wn0Th'><dt id='Wn0Th'><q id='Wn0Th'><span id='Wn0Th'><b id='Wn0Th'><form id='Wn0Th'><ins id='Wn0Th'></ins><ul id='Wn0Th'></ul><sub id='Wn0Th'></sub></form><legend id='Wn0Th'></legend><bdo id='Wn0Th'><pre id='Wn0Th'><center id='Wn0Th'></center></pre></bdo></b><th id='Wn0Th'></th></span></q></dt></tr></i><div id='Wn0Th'><tfoot id='Wn0Th'></tfoot><dl id='Wn0Th'><fieldset id='Wn0Th'></fieldset></dl></div>
      <legend id='Wn0Th'><style id='Wn0Th'><dir id='Wn0Th'><q id='Wn0Th'></q></dir></style></legend>

        java.lang.Error:未解决的编译问题:WebDriver/ChromeDriv

        时间:2023-09-28

      1. <tfoot id='9A3F7'></tfoot>

      2. <i id='9A3F7'><tr id='9A3F7'><dt id='9A3F7'><q id='9A3F7'><span id='9A3F7'><b id='9A3F7'><form id='9A3F7'><ins id='9A3F7'></ins><ul id='9A3F7'></ul><sub id='9A3F7'></sub></form><legend id='9A3F7'></legend><bdo id='9A3F7'><pre id='9A3F7'><center id='9A3F7'></center></pre></bdo></b><th id='9A3F7'></th></span></q></dt></tr></i><div id='9A3F7'><tfoot id='9A3F7'></tfoot><dl id='9A3F7'><fieldset id='9A3F7'></fieldset></dl></div>
            <legend id='9A3F7'><style id='9A3F7'><dir id='9A3F7'><q id='9A3F7'></q></dir></style></legend>

          • <small id='9A3F7'></small><noframes id='9A3F7'>

                <bdo id='9A3F7'></bdo><ul id='9A3F7'></ul>
                  <tbody id='9A3F7'></tbody>

                1. 本文介绍了java.lang.Error:未解决的编译问题:WebDriver/ChromeDriver 在执行 selenium 测试时无法解析为类型错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  这是我的代码:

                  package seleniumTutorials;
                  
                  import org.openqa.selenium.WebDriver;
                  import org.openqa.selenium.chrome.ChromeDriver;
                  import org.openqa.selenium.chrome.ChromeOptions;
                  
                  public class BasicsSelenium {
                  
                  public static void main(String[] args) {
                      boolean status;
                      status=true;
                      boolean newstatus = false;
                  
                      System.out.println("My Old status was "+status);
                      System.out.println("My new status was "+newstatus);
                      System.setProperty("webdriver.chrome.driver", "F:\Samraj\MavenAutomation\Jar Files\Selenium Java\chromedriver.exe");
                      ChromeOptions chromeOptions = new ChromeOptions();
                      chromeOptions.addArguments("--start-maximized");
                      WebDriver driver = new ChromeDriver(chromeOptions);
                      driver.get("dev.findmyfare.io");
                      System.out.println(driver.getTitle());
                   }
                   }
                  

                  以下是声明 webdriver 概念后得到的错误消息:

                  Below is the error message which am getting after declaring webdriver concept:

                  Exception in thread "main" java.lang.Error: Unresolved compilation problems: 
                  WebDriver cannot be resolved to a type   ChromeDriver cannot be resolved to a type
                      at seleniumTutorials.BasicsSelenium.main(BasicsSelenium.java:13)
                  

                  注意:我可以执行简单的java程序.

                  Note: I can able to execute simple java program.

                  我的 Eclipse 的屏幕截图

                  推荐答案

                  这个错误信息...

                  Exception in thread "main" java.lang.Error: Unresolved compilation problems:
                  WebDriver cannot be resolved to a type
                  ChromeDriver cannot be resolved to a type
                  

                  ...暗示 WebDriverChromeDriver编译时没有解决.

                  ...implies that WebDriver and ChromeDriver wasn't resolved at compiletime.

                  根据您分享的快照,您的主要问题是您的项目空间中存在多个类似的二进制文件,如下所示:

                  As per the snapshot you have shared your main issue is the presence of multiple similar binaries within your project space as follows :

                  • 您已将 selenium-server-standalone-3.11.0 作为依赖项.
                  • 此外,您还包含了来自 selenium-java-3.11.0Java 客户端 JAR 作为依赖项.
                  • You have included selenium-server-standalone-3.11.0 as a dependency.
                  • Additionally you have included the Java Client JARs from selenium-java-3.11.0 as a dependency.

                  因此,您很可能已经从一个 JAR 资源(即 selenium-server-standalone-3.11.0selenium-java-3.11.0 JAR),但 compiletime 类正试图从其他 JAR 中解析.因此您会看到 java.lang.Error: Unresolved compiler questions

                  As a result it is pretty much possible that you have resolved the WebDriver and ChromeDriver from one JAR resource (i.e. either selenium-server-standalone-3.11.0 or selenium-java-3.11.0 JARs) but compiletime the Classes are trying to get resolved from the other JAR. Hence you see java.lang.Error: Unresolved compilation problems

                  • 要么只保留 selenium-server-standalone-3.11.0 JAR 作为外部 JAR.
                  • 或者只保留 selenium-java-3.11.0 JAR 作为外部 JAR.
                  • 删除所有其他 Selenium Java 客户端 JAR.
                  • 清理你的项目工作区通过你的IDE重建你的项目只需要依赖.
                  • 进行一次系统重启.
                  • 执行你的 @Test.
                  • Either keep only selenium-server-standalone-3.11.0 JAR as an external JAR.
                  • Or keep only selenium-java-3.11.0 JARs as an external JARs.
                  • Remove all the other Selenium Java Client JARs.
                  • Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
                  • Take a System Reboot.
                  • Execute your @Test.

                  这篇关于java.lang.Error:未解决的编译问题:WebDriver/ChromeDriver 在执行 selenium 测试时无法解析为类型错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:Hadoop 名称节点格式化窗口 - java.lang.UnsupportedOpe 下一篇:加载扩展时出错无法从“C:..LocalTempscoped_dir6312_

                  相关文章

                  最新文章

                2. <small id='edISe'></small><noframes id='edISe'>

                  <tfoot id='edISe'></tfoot>

                3. <i id='edISe'><tr id='edISe'><dt id='edISe'><q id='edISe'><span id='edISe'><b id='edISe'><form id='edISe'><ins id='edISe'></ins><ul id='edISe'></ul><sub id='edISe'></sub></form><legend id='edISe'></legend><bdo id='edISe'><pre id='edISe'><center id='edISe'></center></pre></bdo></b><th id='edISe'></th></span></q></dt></tr></i><div id='edISe'><tfoot id='edISe'></tfoot><dl id='edISe'><fieldset id='edISe'></fieldset></dl></div>
                  <legend id='edISe'><style id='edISe'><dir id='edISe'><q id='edISe'></q></dir></style></legend>
                        <bdo id='edISe'></bdo><ul id='edISe'></ul>