[英]The driver executable does not exist: Selenium Firefox
I've been struggling with this for the past few hours. 在过去的几个小时中,我一直在为此苦苦挣扎。 I'm trying to install Selenium web driver and have been running into a bunch of errors which prevent me from running the test page.
我正在尝试安装Selenium Web驱动程序,并且遇到了很多错误,这些错误使我无法运行测试页。 I'm pretty sure my most recent issue is with this code:
我很确定我最近的问题是与此代码:
public static void main(String[] args) throws InterruptedException{
System.setProperty("webdriver.gecko.driver","C:/Users/theone/Downloads/geckodriver 2.exe");
Would really appreciate any feedback on second steps! 非常感谢您对第二步的反馈!
package automationFramework;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class FirstTestCase {
public static void main(String[] args) throws InterruptedException{
System.setProperty("webdriver.gecko.driver","C:/Users/theone/Downloads/geckodriver 2.exe");
// Create a new instance of the Firefox driver
WebDriver driver = new FirefoxDriver();
//Launch the Online Store Website
driver.get("http://www.store.demoqa.com");
// Print a Log In message to the screen
System.out.println("Successfully opened the website www.Store.Demoqa.com");
//Wait for 5 Sec
Thread.sleep(5);
// Close the driver
driver.quit();
}
}
You can setup Selenium with GeckoDriver either with webdriver.gecko.driver property or using environment properties. 您可以使用webdriver.gecko.driver属性或使用环境属性通过GeckoDriver设置Selenium。 It would be good if you the latest version of Firefox, GeckoDriver and Selenium 3.0
如果您使用的是最新版本的Firefox,GeckoDriver和Selenium 3.0,那就更好了。
Check out this article which provides setup using both these ways - http://automationtestinghub.com/selenium-3-0-launch-firefox-with-geckodriver/ 查看这篇文章,其中提供了使用这两种方法的设置-http: //automationtestinghub.com/selenium-3-0-launch-firefox-with-geckodriver/
C:/Users/theone/Downloads/geckodriver 2.exe
路径中有一个空格,如果您重命名文件geckodriver2.exe ,它可能会起作用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.