zoukankan      html  css  js  c++  java
  • selenium+eclispse里代码备注

    1、火狐、谷歌和IE浏览器引擎都要重新下载selenium官网引擎,并设置路径才可以支持selenium3

    而狐火用自己的引擎不用设置路径既可以支持selenium2也支持selenium3,谷歌和IE就不行

    package Testpakage;

    import org.openqa.selenium.*;
    import org.openqa.selenium.WebDriver.*;
    import org.openqa.selenium.chrome.ChromeDriver;
    import org.openqa.selenium.firefox.FirefoxDriver;
    import org.openqa.selenium.firefox.FirefoxDriver.*;
    import org.openqa.selenium.ie.InternetExplorerDriver;
    import org.openqa.selenium.safari.SafariDriver;

    public class Mytest {
    public static void main(String[] args) {

    System.setProperty("webdriver.gecko.driver", "C:\Users\Administrator\Downloads\geckodriver-v0.8.0-win32\geckodriver.exe");
    WebDriver driver=new FirefoxDriver();

    // System.setProperty("webdriver.ie.driver", "C:\Program Files\Internet Explorer\IEDriverServer.exe");
    // WebDriver driver=new InternetExplorerDriver();
    //
    // System.setProperty("webdriver.chrome.driver", "C:\Program Files\Google\Chrome\Application\chromedriver.exe");
    // WebDriver driver=new ChromeDriver();

    driver.get("https://www.baidu.com/");
    driver.quit();
    }
    }

  • 相关阅读:
    Numpy基础
    Numpy基础
    Java复习之数组
    Java复习之数组
    Python基础2
    第六章 3 列表生成式
    第六章 1 列表(创建,特点)
    IEEE(电气和电子工程师协会)会议排名
    第五章 3 流程控制语句break和continue
    第五章 2 循环结构
  • 原文地址:https://www.cnblogs.com/my-blogs-for-everone/p/5988460.html
Copyright © 2011-2022 走看看