Selenium3.0beta version launch Firefox browser problem

Source: Internet
Author: User

These two days to try to build Eclipse+selenium Web Automation test framework, using both Chrome and Firefox have problems, can not find driver, after practice, the final solution is as follows:

Environment: WIN10 x64 Development tools: Eclipse

Jar version: Lib\selenium-server-standalone-3.0.0-beta2.jar,selenium-chrome-driver.jar, Selenium-firefox-driver.jar.zip Download Link: http://www.java2s.com/Code/Jar/CatalogJar.htm

Solution:

Browser: Chrome

Download Chrome's driver, create a local folder, and copy the Driver.exe file, such as: C:/Program files (x86)/google/webdriver/chromedriver.exe

The code is as follows:

          System.setproperty ("Webdriver.chrome.driver", ' C:/Program Files (x86)/google/webdriver/chromedriver.exe ');

           Webdriver Driver = new Chromedriver ();

          Driver.get (http://"www.baidu.com");/Open Baidu Web page

Browser: Firefox 46.01 version

Download Geckodriver.exe, Link: https://github.com/mozilla/geckodriver.exe, create a local file will, Geckodriver.exe copy in, for example, say: C:/Program Files/mozilla firefox/webdriver/,

The code is as follows:

    System.setproperty ("Webdriver.gecko.driver", "C:/Program Files/mozilla firefox/webdriver/geckodriver.exe");

        Remotewebdriver Driver = new Firefoxdriver ();

        Driver.get ("http://www.baidu.com");



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.