selenium中3种浏览器的设置

case    IE :
   System.setProperty("webdriver.ie.driver","C:\\Program Files\\Internet Explorer\\IEDriverServer.exe");
   driver = new InternetExplorerDriver();

   break;

  case  Chrome :
   System.setProperty("webdriver.chrome.driver", "C:\\Program Files\\Google\\Chrome\\Application\\chromedriver.exe");
   driver = new ChromeDriver();
   break;

  case FireFox :
    System.setProperty("webdriver.firefox.bin","C:\\Program Files\\Mozilla Firefox\\firefox.exe");
    driver = new FirefoxDriver();
    break;

posted on 2015-01-30 18:08  王列  阅读(361)  评论(0编辑  收藏  举报

导航