仅部分代码的参数异常无效,另一半正确执行

时间:2017-05-18 09:50:31

标签: java selenium

org.openqa.selenium.InvalidArgumentException: Expected [object Undefined] undefined to be a string
      Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
      System info: host: 'PC-MADHURI', ip: '10.0.0.182', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_131'
      Driver info: org.openqa.selenium.firefox.FirefoxDriver
      Capabilities [{moz:profile=C:\Users\MMADAN~1\AppData\Local\Temp\rust_mozprofile.kDcSxpCsqEfZ, rotatable=false, timeouts={implicit=0.0, pageLoad=300000.0, script=30000.0}, pageLoadStrategy=normal, platform=ANY, specificationLevel=0.0, moz:accessibilityChecks=false, acceptInsecureCerts=false, browserVersion=53.0.2, platformVersion=10.0, moz:processID=7416.0, browserName=firefox, javascriptEnabled=true, platformName=windows_nt}]
      Session ID: 2d456bb5-3fe3-45fe-8c6c-1222700956d8
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:150)
        at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:115)
        at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:45)
        at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:164)
        at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82)
        at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:637)
        at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:272)
        at org.openqa.selenium.remote.RemoteWebElement.sendKeys(RemoteWebElement.java:96)
        at CucumberTest.check.AppTest.i_am_a_single_applicant(AppTest.java:60)
        at ✽.Given I am a single applicant(C:/Projects/Automation/check/src/test/java/SingleApplicantVast.feature:26)

2 个答案:

答案 0 :(得分:0)

我认为你的问题是时间问题 您的网络驱动程序正在尝试处理无法点击或可用于发送密钥的元素

我建议更换

 WebDriverWait wait = new WebDriverWait(driver, 20);
 wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("grossIncome")));

wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("housePrice")));

&安培;

Console.Write(eachCell[0])

答案 1 :(得分:0)

这是53版本的Firefox浏览器的问题,与gecko驱动程序0.15版本不兼容。 我遇到了同样的问题,当我用最新的0.18版本替换我的gecko驱动程序时,它得到了解决。