zoukankan      html  css  js  c++  java
  • RemoteWebDriver使用说明

    1. 本地代码使用RemoteWebDriver启动:

     public class Testing {
        public void myTest()throws Exception {
           WebDriver driver = newRemoteWebDriver(new URL("http://localhost:4444/wd/hub"),DesiredCapabilities.firefox());
           driver.get("http://www.google.com");
            // RemoteWebDriverdoes not implement the TakesScreenshot class
            // if the driver doeshave the Capabilities to take a screenshot
            // then Augmenter willadd the TakesScreenshot methods to the instance
            WebDriver augmentedDriver = new Augmenter().augment(driver);
            File screenshot =((TakesScreenshot)augmentedDriver).getScreenshotAs(OutputType.FILE);
        }
    }

    2. Remote机器上启动监听端口

    java -jar selenium-server-standalone-2.46.0.jar -port 4444

    3. 执行

  • 相关阅读:
    repo
    manifest
    Gerrit使用简介
    id_rsa id_rsa.pub
    数字签名原理及其应用
    RSA DSA
    ssh(安全协议外壳)
    Numpy基本数据结构
    Numpy
    .bat 批处理
  • 原文地址:https://www.cnblogs.com/heaven1025/p/5733433.html
Copyright © 2011-2022 走看看