Selenium Webdriver in the Chrome browser configuration

Source: Internet
Author: User

Here is my test code, because Chrome's webdriver is not installed by default, so you must go to http://code.google.com/p/chromedriver/downloads/list download chromedriver

Select Win32 version of CHROMEDRIVER download under Windows System.

public static void Main (string[] args) {
TODO auto-generated Method Stub
String url = "Http://www.youdao.com";
System.setproperty ("Webdriver.chrome.driver", "C:/Program Files (x86)/google/chrome/application/chromedriver.exe" );
Webdriver Driver = new Chromedriver ();
Driver.get (URL);
Navigation Navigation = Driver.navigate ();
Navigation.to (URL);

}

Most of the online articles are some to system.setproperty, but many have not written all, in this special statement:

The first parameter of the SetProperty function must be webdriver.chrome.driver, and The second parameter is the installation directory of Chromedriver.exe

Here I put the downloaded Chromedriver decompression under the Chrome installation directory, as shown in:

Selenium Webdriver in the Chrome browser configuration

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.