zoukankan      html  css  js  c++  java
  • selenium 打开浏览器报错java.lang.NoSuchMethodError: org.openqa.selenium.chrome.ChromeOptions.addArguments([Ljava/lang/String;)

    java.lang.NoSuchMethodError: org.openqa.selenium.chrome.ChromeOptions.addArguments([Ljava/lang/String;)Lorg/openqa/selenium/chrome/ChromeOptions;
    at com.globalegrow.base.StartPhoneBrowser.initdriver(StartPhoneBrowser.java:163)
    at com.globalegrow.base.StartPhoneBrowser.start(StartPhoneBrowser.java:80)
    at com.globalegrow.cart.beforeClass(cart.java:24)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
    at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:510)
    at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:211)
    at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138)
    at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:170)
    at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:104)
    at org.testng.TestRunner.privateRun(TestRunner.java:774)
    at org.testng.TestRunner.run(TestRunner.java:624)
    at org.testng.SuiteRunner.runTest(SuiteRunner.java:359)
    at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:354)
    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:312)
    at org.testng.SuiteRunner.run(SuiteRunner.java:261)
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1191)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1116)
    at org.testng.TestNG.run(TestNG.java:1024)
    at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:132)
    at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:236)
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:81)

    在启动chorme时,提示错误, 原因是chrome浏览器更新,而对应的selenium依赖包没有升级

    解决办法:升级selenium的依赖包,如下

  • 相关阅读:
    Effective C++ 读书笔记之Part1.Accustoming Yourself to C++
    Effective C++ 读书笔记之Part4.Design and Declarations
    Effective C++ 读书笔记之Part5.Implementations
    给程序猿三条身体保健的建议
    亮剑.NET的系列文章之.NET详解(开端)
    [转]英特尔工具使在多个处理器上实现线程化更加轻松
    [转]TrackBack Technical Specification
    Chapter 03 Writing Executable Statements 01
    Chapter 09Manipulating Data 01
    Chapter 00 Overview to PL/SQL
  • 原文地址:https://www.cnblogs.com/chongyou/p/9242174.html
Copyright © 2011-2022 走看看