Open a browser

Source: Internet
Author: User
1/* 2 * Open the browser 3 */4 public class openbrowsers {5 6 public static void main (string [] ARGs) {7 // open Firefox 8 in the default path // WebDriver driver = new firefoxdriver (); 9 10 // open firefox11 in the specified path // system. setproperty ("WebDriver. firefox. bin "," C :\\ program files (x86) \ Mozilla Firefox \ firefox.exe "); 12 // WebDriver DR = new firefoxdriver (); 13 14 // open the specified chrome; "E: \ selenium_new \ javaforseleniumlearning \ chromedriver.exe" chromedriver.exe needs to download 15 // system from selenium. setproperty ("WebDriver. chrome. driver "," e :\\ selenium_new \ javaforseleniumlearning \ chromedriver.exe "); 16 // WebDriver DR = new chromedriver (); 17 18 system. setproperty ("WebDriver. chrome. bin "," C :\\ program files (x86) \ google \ chrome \ Application \ chrome.exe "); 19 WebDriver driver = new chromedriver (); 20} 21 22}

 

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.