有没有办法在使用Selenium Grid的特定设备上运行Appium自动化测试?

时间:2015-05-06 13:50:33

标签: java android testing selenium appium

有没有办法在使用Selenium Grid作为集线器的特定设备上运行Appium自动化测试?

例如,我有几个附加到Selenium Grid集线器的Appium服务器。每个appium服务器分配给多个具有混合手机和平板电脑的设备。

我想测试仅为平板电脑指定的应用程序,并且这些平板电脑的ID已知。

我当前的设置是(这些设备的位置是随机的):

 +-----------------------------+
 |Phone A  --- Appium Server A |
 |Phone B  --- Appium Server B |
 | ...          ...            | ---> [Selenium Grid] <--- [Test Scripts]
 |Tablet M --- Appium Server M |
 |Device N --- Appium server N |
 +-----------------------------+

此时,当我不是并行运行测试时(例如我想仅在Tablet M上运行测试),测试将在第一个Appium服务器上运行,该服务器用于{{ 1}},甚至Phone A上的想法指向DesiredCapability

以下是Tablet M的节点配置以及仅在Tablet MdeviceName上有所不同的其他设备。

Tablet M

port

电话A

{
 "capabilities": [
     {
         "browserName": "Android",
         "version": "4.4",
         "maxInstances": 1,
         "platform": "ANDROID",
         "deviceName": "08e1cfd3"
     }
 ],
 "configuration": {
     "cleanUpCycle": 2000,
     "timeout": 300,
     "browserTimeout": 300,
     "hub": "http://localhost:4444/grid/register",
     "host": "localhost",
     "maxSession": 1,
     "port": 4752,
     "hubPort": 4444,
     "hubHost": "localhost",
     "url": "http://localhost:4752/wd/hub",
     "register": true,
     "registerCycle": 5000,
     "role": "node"
 }
}

并在DesiredCapability中:

{
 "capabilities": [
     {
         "browserName": "Android",
         "version": "4.4",
         "maxInstances": 1,
         "platform": "ANDROID",
         "deviceName": "23a823e1d45f"
     }
 ],
 "configuration": {
     "cleanUpCycle": 2000,
     "timeout": 300,
     "browserTimeout": 300,
     "hub": "http://localhost:4444/grid/register",
     "host": "localhost",
     "maxSession": 1,
     "port": 4733,
     "hubPort": 4444,
     "hubHost": "localhost",
     "url": "http://localhost:4733/wd/hub",
     "register": true,
     "registerCycle": 5000,
     "role": "node"
 }
}

任何线索都非常有用。谢谢。

0 个答案:

没有答案