我正在嘗試使用 Selenium 打開本地文件。使用下面的代碼,F(xiàn)irefox 正在打開,但出現(xiàn)錯誤org.openqa.selenium.WebDriverException: Timed out waiting 45 seconds for Firefox to start.. File gecko = new File("resources/geckodriver64.exe"); System.setProperty("webdriver.gecko.driver", gecko.getAbsolutePath()); FirefoxOptions capabilities = new FirefoxOptions(); capabilities.setCapability("marionette", false); WebDriver driver = new FirefoxDriver(capabilities); driver.get("file:///C:/example/myfile.pdf");有人能幫我嗎 ?我在互聯(lián)網(wǎng)上找不到任何東西。
添加回答
舉報
0/150
提交
取消