How can I configure selenium webdriver to use custom firefox setup for tests?

后端 未结 1 1405
孤城傲影
孤城傲影 2021-01-02 14:48

I am using Ubuntu 11.04 and selenium 2.9.0 Here is how it is configured in my root pom:


    org.seleniumhq.selenium

        
相关标签:
1条回答
  • 2021-01-02 15:22

    As long as I know that the java command

    WebDriver driver = new FirefoxDriver();
    

    will run the installed Firefox browser on your computer.

    but reading the JavaDoc at http://selenium.googlecode.com/svn/trunk/docs/api/java/index.html I realised that there can be way how to override it:

    FirefoxBinary binary = new FirefoxBinary(new File("path/to/binary"));
    FirefoxProfile profile = new FirefoxProfile();
    WebDriver driver = new FirefoxDriver(binary, profile);
    
    0 讨论(0)
提交回复
热议问题