Hi ,
Am using selenium grid with appium to run the testscript in multiple Android emulator parallel in multiple machine(each machine has one emulator opened )
Approach i followed
1.Started the hub using java -jar selenium-server-standalone-2.44.0.jar -port 4120 -role hub
2.Started the two node’s
- Local machine
Appium -a localhost -p 4723 -dp 1234 -u emulator-5556 --nodeconfig “path of my nodeconfig.json file”
Configuration fie for Local machine(nodeconfig.json)
{
“capabilities”: [
{
“browserName”: “browser”,
“version”: “4.4.2”,
“maxInstances”: 2,
“platform”: “WINDOWS”
}
],
“configuration”: {
“cleanUpCycle”: 2000,
“timeout”:30000,
“hub”: “http://localhost:4120/grid/register”,
“host”: “localhost”,
“proxy”: “org.openqa.grid.selenium.proxy.DefaultRemoteProxy”,
“maxSession”: 1,
“port”: 4723,
“hubPort”: 4120,
“hubHost”: “localhost”,
“url”: “http://localhost:4723/wd/hub”,
“remoteHost”: “http://localhost:4723”,
“register”: true,
“registerCycle”: 5000,
“role”: “node”
}
}
*** Another machine**
Appium -a Ip(of that machine) -p 4173 -dp 5678 -u emulator-5554 --nodeconfig “path of my nodeconfig2.json file”
nodeconfig2.json
{
“capabilities”: [
{
“browserName”: “browser”,
“version”: “4.4.2”,
“maxInstances”: 1,
“platform”: “Android”
“Emuator-Name” :“emulator-5554”
“Device” :“validdevice”
}
],
"configuration": {
"cleanUpCycle": 2000,
"timeout":30000,
"hub": "http://localhost:4120/grid/register",
"host": "localhost",
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"maxSession": 1,
"port": 4713,
"hubPort": 4120,
"hubHost": "localhost",
"url": "http://l92.168.24.61:4713/wd/hub",
"remoteHost": "http://l92.168.24.61:4713",
"register": true,
"registerCycle": 5000,
"role": "node"
}
}
I Gave My DesiredCapabilities as Below
File app = new File(“C:\adt-bundle-windows-x86-20140702\Sudoku.apk”);
capabilities = new DesiredCapabilities();
capabilities.setCapability(“browserName”, “browserName”);
capabilities.setCapability(CapabilityType.PLATFORM, "WINDOWS");
capabilities.setCapability("deviceType", "phone");
capabilities.setCapability("platformName", "Android");
capabilities.setCapability("platformVersion", "version");
capabilities.setCapability("device ID","Emuator-Name");
capabilities.setCapability("deviceName","Device");
capabilities.setCapability("app", app.getAbsolutePath());
capabilities.setCapability("app-package","com.androidcan.asudoku");
capabilities.setCapability("newCommandTimeout","180");
}
@Test
public void Test() throws InterruptedException, MalformedURLException{
rdriver = new RemoteWebDriver(new URL(“http://localhost:4274/wd/hub”),capabilities);
rdriver = new RemoteWebDriver(new URL(“http://192.168.24.61:4713/wd/hub”),capabilities);
When i run the script , only one emulator ( from local machine) is running and other one is throwing the following error in appium
“info: [debug] Responding to client with error: {“status”:33,“value”:{“message”:“A new session could not be created. (Original error: Could not find aapt. Please set the ANDROID_HOME environment variable with the Android SDK root directory path.)”,“origValue”:“Could not find aapt. Please set the ANDROID_HOME environment variable with the Android SDK root directory path.”},“sessionId”:null}”
Note:
if i run the script from that machine (which throws the above error in appium) , its working fine
Please help me to find the solution