Selenium 3 webdriver:线程中的异常;“主要”;org.openqa.selenium.JavascriptException:TypeError:invalid';在';操作数c

Selenium 3 webdriver:线程中的异常;“主要”;org.openqa.selenium.JavascriptException:TypeError:invalid';在';操作数c,java,firefox,selenium-webdriver,Java,Firefox,Selenium Webdriver,在我更新Selenium和Firefox之前,可能是1个月前,一切正常。这发生在我更新到Selenium WebDriver和Firefox的最新版本之后。硒3,FF 50.1.0。当我尝试运行此代码时 package automationFramework; import org.openqa.selenium.By; import org.openqa.selenium.Keys; import org.openqa.selenium.WebDriver; import org.openq

在我更新Selenium和Firefox之前,可能是1个月前,一切正常。这发生在我更新到Selenium WebDriver和Firefox的最新版本之后。硒3,FF 50.1.0。当我尝试运行此代码时

package automationFramework;

import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.MarionetteDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.support.ui.*;
import org.testng.Assert;

public class FirstTestCase {

public static void main(String[] args) throws InterruptedException {

    String actualText;

    System.setProperty("webdriver.gecko.driver", "destinationOfDriver/geckodriver-v0.13.0-win32/wires.exe");

    WebDriver driver = new FirefoxDriver();

    driver.get("https://www.arubabank.com/");

    WebDriverWait wait = new WebDriverWait(driver, 20);

         wait.until(ExpectedConditions.elementToBeClickable(By.xpath("html/body/footer/div/div[1]/div[2]/div/div[4]/section/a[3]"))).click();
之后,我在控制台中得到以下错误信息:

Exception in thread "main" org.openqa.selenium.JavascriptException:     TypeError: invalid 'in' operand c
Build info: version: 'unknown', revision: '1969d75', time: '2016-10-18 09:43:45 -0700'
System info: 'Windows 8.1', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_101'
 Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{rotatable=false, raisesAccessibilityExceptions=false, marionette=true, firefoxOptions={args=[], prefs={}}, appBuildId=20161208153507, version=, platform=XP, proxy={}, command_id=1, specificationLevel=0, acceptSslCerts=false, processId=38188, browserVersion=50.1.0, platformVersion=6.3, XULappId={ec8030f7-c20a-464f-9b0e-13a3a9e97384}, browserName=firefox, takesScreenshot=true, takesElementScreenshot=true, platformName=windows_nt}]
Session ID: d17c4393-fa24-4650-bf8a-660895ed328d
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:127)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:93)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:42)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:163)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601)
at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:274)
at org.openqa.selenium.remote.RemoteWebElement.isDisplayed(RemoteWebElement.java:315)
at org.openqa.selenium.support.ui.ExpectedConditions.elementIfVisible(ExpectedConditions.java:302)
at org.openqa.selenium.support.ui.ExpectedConditions.access$100(ExpectedConditions.java:41)
at org.openqa.selenium.support.ui.ExpectedConditions$7.apply(ExpectedConditions.java:205)
at org.openqa.selenium.support.ui.ExpectedConditions$7.apply(ExpectedConditions.java:201)
at org.openqa.selenium.support.ui.ExpectedConditions$22.apply(ExpectedConditions.java:651)
at org.openqa.selenium.support.ui.ExpectedConditions$22.apply(ExpectedConditions.java:644)
at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:238)
at automationFramework.FirstTestCase.main(FirstTestCase.java:32)

如果使用不同的地址作为
driver.get()
调用的参数,是否也会发生这种情况?例如www.iak.nl会给出相同的结果,但www.gmail.com不会。也许您对
invalid'in'操作数c
指的是什么(我不知道)。我只能推测,抛出
JavascriptException
是为了表明页面中的Javascript代码存在问题,在这种情况下,您的代码应该只捕获并处理它;但这只是猜测;也许您可以检查文档,看看这是否真的是
JavascriptException
的意思。否则,如果我是你,我会试着问FirefoxDriver的人,他们是否有论坛或其他什么。如果你这样做了,并且你得到了一些有用的信息,请在这里发布一个链接。你试过运行我的示例中的代码吗?如果你在和我说话,不,我没有,为什么?