十五年测试老手,长期负责WEB\APP 项目测试,目前主要负责团队管理工作。

Selenium Grid

上一篇 / 下一篇  2021-06-27 13:52:53 / 个人分类:自动化测试

文章来源
  • 文章来源:【转载】

通过服务器参数 --nodeconfig,可以将 appium 服务器**到本地的 Selenium grid51Testing软件测试网q| YL,z

> appium --nodeconfig /path/to/nodeconfig.json# 或者使用源文件执行> node . --nodeconfig /path/to/nodeconfig.json

在 Selenium 节点(Node)的配置文件里,你需要定义 browserNameversion 和 platform,然后 Grid 会通过这些参数将你的测试重定向到正确的设备上。你还需要配置 host 和 selenium grid 的详细信息。详细的参数列表和描述信息,请查看 这里。

S g3ofgS`3@y:t0

一旦你启动了 appium 服务器并且在 grid 里**了信息,就可以在 grid 控制台看到你的设备:51Testing软件测试网;g4e4@/K@:G~AW(x

"http://\<grid-ip-adress>:\<grid-port>/grid/console"51Testing软件测试网X7G"t ]t_x;a

Grid 节点的示例 JSON 配置文件

{
  "capabilities":
      [
        {
          "browserName""<e.g._iPhone5_or_iPad4>",
          "version":"<version_of_iOS_e.g._7.1>",
          "maxInstances"1,
          "platform":"<platform_e.g._MAC_or_ANDROID>"        }
      ],
  "configuration":
  {
    "cleanUpCycle":2000,
    "timeout":30000,
    "proxy""org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
    "url":"http://<host_name_appium_server_or_ip-address_appium_server>:<appium_port>/wd/hub",
    "host": <host_name_appium_server_or_ip-address_appium_server>,
    "port": <appium_port>,
    "maxSession"1,
    "register"true,
    "registerCycle"5000,
    "hubPort": <grid_port>,
    "hubHost""<Grid_host_name_or_grid_ip-address>"    "hubProtocol""<Protocol_of_Grid_defaults_to_http>"  }
}

如果没有给出 urlhost 和 port,配置会自动指向 localhost:whatever-port-Appium-started-on

._+Z.x;h7Fo0

如果你的 Appium Server 和 Selenium Grid 没有运行在同一台机器上,为确保 Selenium Grid 连接正常,请在你的 host & url 上使用外部域名或 IP 地址,而不是 localhost 和 127.0.0.151Testing软件测试网+Jo vY2Ppj T5b#}


TAG: Grid

 

评分:0

我来说两句

Open Toolbar