zoukankan      html  css  js  c++  java
  • Selenium Grid学习笔记

    安装jdk,selenium-server-standalone-xxx.jar,准备好各浏览器的驱动(主要是chromedriver和iedriver)

    1.启动hub
    java -jar selenium-server-standalone-2.53.0.jar -role hub

    2.启动node
      2.1)单独模式,如果是访问别的主机的浏览器,需要将localhost替换为对应主机名
    java -jar selenium-server-standalone-2.53.0.jar -role node -hub http://localhost:4444/grid/register
      2.2)通过json启动
    java -jar selenium-server-standalone-2.53.0.jar -role node -nodeConfig node-json-XXX.cfg.json

    {
      "capabilities":
        [
          {
            "browserName": "firefox",
            "version": 43,
            "maxInstances": 5,
            "seleniumProtocol": "WebDriver"
            "platform": WINDOWS
          },
      "configuration":
      {
        "proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
        "maxSession": 5,
        "port": 5555,
        "host": localhost,
        "register": true,
        "registerCycle": 5000,
        "htbPort": 4444,
        "hubHost": localhost
      }
    }

      2.3)指定浏览器版本模式
    java -jar selenium-server-standalone-2.53.0.jar -role node -browser "seleniumProtocol=WebDriver, browserName=chrome, version=61, maxInstances=5, platform = WINDOWS" -port 8889 -hubHost localhost

      2.4)通过json注册多个浏览器、版本、系统等信息到node
    java -jar selenium-server-standalone-2.53.0.jar -role node -nodeConfig node-json-XXX.cfg.json

    {
      "capabilities":
        [
          {
            "browserName": "firefox",
            "version": 43,
            "maxInstances": 5,
            "seleniumProtocol": "WebDriver"
          },
          {
            "browserName": "chrome",
            "version": 61,
            "maxInstances": 5,
            "seleniumProtocol": "WebDriver"
          },
          {
            "browserName": "iexplore",
            "version": 9,
            "maxInstances": 4,
            "seleniumProtocol": "WebDriver"
          }
        ],
      "configuration":
      {
        "proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
        "maxSession": 5,
        "port": 5555,
        "host": localhost,
        "register": true,
        "registerCycle": 5000,
        "htbPort": 4444,
        "hubHost": localhost
      }
    }


      2.5)启动Android的node
    java -jar selenium-server-standalone-2.53.0.jar -role node -browser "seleniumProtocol=WebDriver, browserName=android, version=4.4.2, maxInstances=1, platform=ANDROID" -port 8899 -hubHost localhost

    参考:http://www.cnblogs.com/zw520ly/p/5995708.html

  • 相关阅读:
    计算机组成原理实验总结
    Matlab图像匹配问题
    局域网实验
    信号量与共享存储区(操作系统实验三)
    路由器配置及IP设置及ping命令使用
    自我介绍是一门学问
    数据库管理系统的维护与管理
    高数讲课教后感
    node Unexpected token import(node 目前默认不支持es6 的模块 import解决方法有2)
    Cookie/Session机制详解
  • 原文地址:https://www.cnblogs.com/aikachin/p/7755109.html
Copyright © 2011-2022 走看看