@Hassan_Radi
Thanks ! The error does not exist now.
@jonahss @Hassan_Radi @Arvind_Patel @rgonalo @Appium_Master @appium_ia
What happens now is:
App is installed on both the devices but executes the script 2 times in one device one after another.
Following are the json files:
for node 1:
{
"capabilities":
[
{
"browserName":"android",
"deviceName": "SM-N750",
"version":"4.4.2",
"maxInstances":5,
"platform":"ANDROID",
"applicationName": "3204da2a5075c0b5"
}
],
"configuration":
{
"nodeTimeout":120,
"cleanUpCycle":2000,
"timeout":10000,
"proxy":"org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"url":"http://xxxx:5566/wd/hub",
"maxSession":1,
"port":5566,
"register":true,
"registerCycle":5000,
"hub": "xxxx:4441/grid/register",
"hubPort": 4441,
"hubHost": "xxxx",
"role":"node"
}
}
Node 2:
{
"capabilities":
[
{
"browserName":"android",
"version":"4.4.2",
"maxInstances":5,
"platform":"ANDROID",
"applicationName": "0123456789ABCDEF",
"deviceName": "Micromax A107"
}
],
"configuration":
{
"nodeTimeout":120,
"cleanUpCycle":2000,
"timeout":10000,
"proxy":"org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"url":"http://xxxx:5577/wd/hub",
"maxSession":1,
"port":5577,
"register":true,
"registerCycle": 5000,
"hub": "xxxx:4441/grid/register",
"hubPort": 4441,
"hubHost": "xxxx",
"role":"node"
}
}
Hub json:
{
"throwOnCapabilityNotPresent":true,
"host":"xxxx",
"port":4441,
"newSessionWaitTimeout":-1,
"servlets" :[],
"prioritizer":null,
"capabilityMatcher":"org.openqa.grid.internal.utils.DefaultCapabilityMatcher",
"throwOnCapabilityNotPresent":true,
"nodePolling":5000,
"cleanUpCycle":5000,
"timeout":300000,
"browserTimeout":0,
"maxSession":5,
"jettyMaxThreads":-1
}
Following is the code:
public class abc{
WebDriver driver = null;
DesiredCapabilities capabilities = new DesiredCapabilities();
@Parameters(value={"device_id1","device_id2","ApplicationPath"})
@BeforeTest
public void atStart(@Optional("nnn")String device_id1,String device_id2, String ApplicationPath) throws MalformedURLException, InterruptedException
{
capabilities=DesiredCapabilities.android();
capabilities.setCapability("automationName", "Appium");
capabilities.setCapability(CapabilityType.BROWSER_NAME,"android");
capabilities.setCapability("platformVersion", "4.4.2");
capabilities.setCapability(CapabilityType.PLATFORM,"ANDROID");
capabilities.setCapability("platformName","ANDROID");
capabilities.setCapability("app", ApplicationPath);
capabilities.setCapability("appPackage", "com.avaamo.android.staging"); //Replace with your app's package
capabilities.setCapability("appActivity", "com.avaamo.android.ui.TabActivity"); //Replace with app's Activity
//setting new command timeout for selenium server
capabilities.setCapability("newCommandTimeout", "2000000");//33.33 mins
if("8a2d363".equalsIgnoreCase(device_id2))
{
System.out.println("in nexus: "+device_id2);
//
capabilities.setCapability("applicationName",device_id2);
capabilities.setCapability("udid",device_id2);
capabilities.setCapability("deviceName","Micromax A311");
}
if ("3204da2a5075c0b5".equalsIgnoreCase(device_id1))
{
System.out.println("in Samsung galaxy: "+device_id1);
//
capabilities.setCapability("applicationName", device_id1);
capabilities.setCapability("udid", device_id1);
capabilities.setCapability("deviceName","SM-N750");
}
try
{
driver = new AndroidDriver(new URL("http://xxxx:4441/wd/hub"), capabilities);
}
catch (Exception e)
{
e.printStackTrace();
}
}
Could anyone please help?