使用firefox 59.0.3(64位)gecko驱动程序0.15执行seleium脚本时出现UnsupportedCommandException

时间:2018-05-16 13:34:17

标签: selenium-firefoxdriver

我是Selenium的初学者。这是我正在执行的代码。我使用的是Selenium-Java-3.3.1版本,Firefox 59.0.3(64位)和gecko驱动程序0.15版本     包selenium_test;

import java.util.concurrent.TimeUnit;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxOptions;

public class TestClass {

WebDriver driver;

public void invokeBrowser() {

    try {
        System.setProperty("webdriver.gecko.driver", "D:\\GEGDC\\KT00475829\\Downloads\\geckodriver-v0.15.0-win64\\geckodriver.exe");
        driver = new FirefoxDriver();
        driver.manage().deleteAllCookies();
        driver.manage().window().maximize();
        driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
        driver.manage().timeouts().pageLoadTimeout(30, TimeUnit.SECONDS);

        driver.get("https://stg2-magic.health.ge.com:13007/enovia/common/emxNavigator.jsp");
    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}

public static void main(String args[]) {

    TestClass myObj = new TestClass();
    myObj.invokeBrowser();
}


}

以下是我的错误:

org.openqa.selenium.UnsupportedCommandException: timeouts
Build info: version: 'unknown', revision: '5234b32', time: '2017-03-10 
09:00:17 -0800'
System info: host: 'TMIC-PCS2200', ip: '3.235.34.200', os.name: 'Windows 7', 
os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_144'
Driver info: org.openqa.selenium.firefox.FirefoxDriver

请帮我解决我的错误。

0 个答案:

没有答案