【问题标题】:Issue with configuring Selenium Grid with appium in android studio在 android studio 中使用 appium 配置 Selenium Grid 的问题
【发布时间】:2015-03-10 15:13:48
【问题描述】:

我正在使用 appium 工具和 android studio IDE 自动化 android 应用程序。我为每个设备创建了 2 个 JSON 文件。我已经启动了 selenium hub 并在不同的端口上运行 appium 服务器。但我不知道我应该如何在我的测试代码中定义capabilities.setCapability("deviceName","Should read from the JSON file");? 我的 JSON 文件包含(设备名称和端口号不断更改 JSON 文件): { "capabilities": [ { "platformName": "Android", "platformVersion": "4.4", "maxInstances": 1, "device": "5200cf1a4df52100" } ], "configuration": { "nodeTimeout":120, "port":4728, "hubPort":4444, "proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy", "url":"http://localhost:4728/wd/hub", "hub": "http://localhost:4444/grid/register", "hubHost":"localhost", "nodePolling":2000, "registerCycle":10000, "register":true, "cleanUpCycle":2000, "timeout":30000, "maxSession":1 } }

Selenium 网格日志是 - SBA53@DEVML0204666:~/Downloads$ java -jar selenium-server-standalone-2.45.0.jar -role hub 15:27:01.945 INFO - Launching a selenium grid server 2015-03-10 15:27:03.674:INFO:osjs.Server:jetty-7.x.y-SNAPSHOT 2015-03-10 15:27:03.757:INFO:osjsh.ContextHandler:started o.s.j.s.ServletContextHandler{/,null} 2015-03-10 15:27:03.775:INFO:osjs.AbstractConnector:Started SocketConnector@0.0.0.0:4444 15:28:50.119 INFO - Got a request to create a new session: Capabilities [{app=/Users/SBA53/Test-release/Rel1_683/android-skybet/app/build/outputs/apk/app-debug.apk, appPackage=com.skybet.app.skybet, appActivity=MainActivity, orientation=LANDSCAPE, appium-version=1.0, noReset=true, platformVersion=4.4, platformName=Android, deviceName= }] 15:28:50.120 INFO - Available nodes: [host :http://0.0.0.0:4728] 15:28:50.120 INFO - Trying to create a new session on node host :http://0.0.0.0:4728 15:28:50.121 INFO - Trying to create a new session on test slot {platformVersion=4.4, platformName=Android, maxInstances=1, device=5200cf1a4df52100}

【问题讨论】:

    标签: android json appium selenium-grid


    【解决方案1】:

    deviceName 不需要,见下文...

    {
      "capabilities":
          [
            {
              "browserName": "iPhone",
              "version":"8.2",
              "maxInstances": 1,
              "platform":"MAC"
            }
          ],
      "configuration":
      {
        "cleanUpCycle":2000,
        "timeout":30000,
        "proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
        "url": "http://localhost:4723/wd/hub",
        "host": "localhost",
        "port": 4723,
        "maxSession": 1,
        "register": true,
        "registerCycle": 5000,
        "hubPort": 4444,
        "hubHost": "localhost"
      }
    }
    

    【讨论】:

      猜你喜欢
      • 2017-04-28
      • 1970-01-01
      • 2013-10-02
      • 2015-05-21
      • 1970-01-01
      • 2020-12-13
      • 1970-01-01
      • 1970-01-01
      • 2011-04-13
      相关资源
      最近更新 更多