简体   繁体   English

驱动程序可执行文件不存在:Selenium Firefox

[英]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.

相关问题 驱动程序可执行文件不存在 - The driver executable does not exist illegalStateException:chrome 驱动程序不存在驱动程序可执行文件 - illegalStateException: The driver executable does not exist for chrome driver java.lang.IllegalStateException:驱动程序可执行文件不存在:尝试通过Selenium,ChromeDriver和Chrome执行测试时 - java.lang.IllegalStateException: The driver executable does not exist: while trying to execute tests through Selenium, ChromeDriver and Chrome 线程“main”中的异常 java.lang.IllegalStateException:在 Ubuntu 上运行 Selenium 测试时驱动程序可执行文件不存在 - Exception in thread "main" java.lang.IllegalStateException: The driver executable does not exist while running Selenium Test on Ubuntu ANT版本无法识别geckodriver可执行文件“驱动程序可执行文件不存在” - ANT build is unable to recognize geckodriver executable “The driver executable does not exist” java.lang.IllegalStateException: 驱动程序可执行文件不存在 chrome 驱动程序 - java.lang.IllegalStateException: The driver executable does not exist chrome driver Java Selenium ChromeDriver可执行文件不存在 - Java Selenium ChromeDriver executable does not exist Selenium使用什么Firefox驱动程序? - What Firefox Driver does Selenium use? 码头工人 驱动程序可执行文件不存在:/chromedriver.exe - Docker. The driver executable does not exist: /chromedriver.exe java.lang.IllegalStateException:驱动程序可执行文件不存在 - java.lang.IllegalStateException: The driver executable does not exist
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM