zoukankan      html  css  js  c++  java
  • selenium-java,启动谷歌浏览器和火狐浏览器

    selenium3.4.0-java,启动谷歌浏览器和火狐浏览器--------------------------------------------------------------------------------

    启动谷歌浏览器

    @Before
        public void setUp() throws Exception {
            System.setProperty("webdriver.chrome.driver","D:\Configuration\chromedriver.exe");//这一步必不可少  
            driver = new ChromeDriver();
            driver.manage().window().maximize();
            driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
        }

    启动火狐浏览器

    @Before
        public void setUp() throws Exception {
            System.setProperty("webdriver.firefox.driver", "D:\Configuration\geckodriver.exe"); 
            System.setProperty("webdriver.firefox.bin", "C:\Program Files\Mozilla Firefox\firefox.exe");   
            WebDriver = new FirefoxDriver();
            WebDriver.manage().window().maximize();
            WebDriver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
        }

    selenium3.5.0-java,启动谷歌浏览器和火狐浏览器--------------------------------------------------------------------------------

    启动火狐浏览器

        public WebDriver start_Firefox(WebDriver WebDriver){
            System.setProperty("webdriver.firefox.bin", "D:\firefox\firefox57\firefox.exe");
            System.setProperty("webdriver.gecko.driver","D:\Configuration\geckodriver-v0.19.1-win64\geckodriver.exe"); 
            WebDriver = new FirefoxDriver();
            WebDriver.manage().window().maximize();
            WebDriver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
            return WebDriver;
        }
  • 相关阅读:
    MongoDB中常用的find
    MongoDB文档的增删改操作
    我的notepad++
    MongoDB入门知识
    Python基础5-常用模块
    Python基础4
    Python基础3(2017-07-20)
    Python基础2(2017-07-18)
    Python基础1(2017-07-16)
    Python简介(2017-07-16)
  • 原文地址:https://www.cnblogs.com/yanzhe/p/7550855.html
Copyright © 2011-2022 走看看