Hi,
I am trying Appium using Python language. And I have a simple script on python for Android (just open app, find text and assert this text.)
I want to run this test on several devices.
**What I already did: **
I have created two android emulators. Run selenium grid hub. Create two configuration files for each emulator and run 2 appium servers:
hub
java -jar selenium-server-standalone-2.53.0.jar -role webdriver -nodeConfig emulator-5554.json -hub http://127.0.0.1:4444/grid/register
Appium servers:
appium --address 127.0.0.1 --port 4721 -bp 2253 --udid emulator-5554 --nodeconfig C:\SeleniumGrid\Android\emulator-5554.json
and
appium --address 127.0.0.1 --port 4722 -bp 2254 --udid emulator-5556 --nodeconfig C:\SeleniumGrid\Android\emulator-5556.json
My json configuration files:
first:
{ "capabilities":
[
{
"deviceName": "emulator-5554",
"browserName":"Browser",
"version":"4.4.4",
"maxInstances": 1,
"platform":"ANDROID"
}
],
"configuration":
{
"cleanUpCycle":2000,
"timeout":30000,
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"url":"http://127.0.0.1:4721/wd/hub",
"host": "127.0.0.1",
"port": 4721,
"maxSession": 10,
"register": true,
"registerCycle": 5000,
"hubPort": 4444,
"hubHost": "127.0.0.1"
}
}
second:
{ "capabilities":
[
{
"browserName":"Browser",
"deviceName": "emulator-5556",
"version":"4.4.4",
"maxInstances": 1,
"platform":"ANDROID"
}
],
"configuration":
{
"cleanUpCycle":2000,
"timeout":30000,
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"url":"http://127.0.0.1:4722/wd/hub",
"host": "127.0.0.1",
"port": 4722,
"maxSession": 10,
"register": true,
"registerCycle": 5000,
"hubPort": 4444,
"hubHost": "127.0.0.1"
}
}
And my setUp method:
def setUp(self):
desired_caps = {}
desired_caps['platformName'] = 'Android'
desired_caps['platformVersion'] = 'platformVersion'
desired_caps['deviceName'] = 'deviceName'
desired_caps['app'] = 'oneDo.apk'
self.driver = webdriver.Remote('http://127.0.0.1:4444/wd/hub', desired_caps)
How can I run this one test on several devices? What should I do next?
May be use any frameworks. Bat what and how? I asked this question everywhere and read everything.
Always what I have known, is to create second script test2.py, but for another device. So each script for each device. But I think itsn’t correct way.
Help me please