Chating between two devices

Hi All,

I want to automate the chating between 2 devices.
The app will be running on two devices.
There will be two users and pinging and responding each other.
I want to start two threads to open the app and I need to write a function to check the other thread is alive.

If any body automated this, please help me out…Thanks

you wrote all correct. you need to ask your questions after you start implementing and met exact problem.

I ma not getting any idea on how to invoke and call the drivers one by one…I am asking for the idea

I got stuck in the initial stage of invoking the drivers.

start from How to create two appium instances?

Hi I started two servers on differnt ports

appium -p 4733 -U ‘5d6ef2bd’

appium -p 4743 -U ‘d859dc2d’

Now what is the code to launch them

  1. add also “–bootstrap-port” to eliminate port conflict problems

to launch what?

After I started the server
@DataProvider
public Object[][] portDriver()
{
//Rows - Number of times your test has to be repeated.
//Columns - Number of parameters in test data.
Object[][] data = new Object[2][1];

		// 1st row
		data[0][0] ="5d6ef2bd";
		// 2nd row
		data[1][0] ="d859dc2d";
		return data;
		}
	
		
		public static String firstDeviceName="5d6ef2bd";
		public static String SecondDeviceName="d859dc2d";


			
			@Factory(dataProvider="portDriver")
			@BeforeClass
			public void Init(String device_id) throws IOException, InterruptedException{
				DesiredCapabilities capabilities = new DesiredCapabilities();				
				if(device_id.equalsIgnoreCase(firstDeviceName)){	
					capabilities.setCapability("deviceName",firstDeviceName);
					capabilities.setCapability("udid", firstDeviceName);
					capabilities.setCapability("automationName", config.getProperty("automationName"));
					capabilities.setCapability("platformVersion", config.getProperty("platformVersion"));
					capabilities.setCapability("platformName", config.getProperty("platformName"));                 
					capabilities.setCapability(MobileCapabilityType.APP,"/Users/shanthalakshmi/Documents/BushfireFinal/BushFire1/Resources/app/BushFire 1.0.0.4.apk");
					//setDeviceID=device_id;
					driver1=new AndroidDriver(new URL("http://127.0.0.1:4733/wd/hub"), capabilities);
			        driver1.manage().timeouts().implicitlyWait(80, TimeUnit.SECONDS);
			      
					
				}else if(device_id.equalsIgnoreCase(SecondDeviceName)){
					
					capabilities.setCapability("deviceName",SecondDeviceName);
					capabilities.setCapability("udid", SecondDeviceName);
					capabilities.setCapability("automationName", config.getProperty("automationName"));
					capabilities.setCapability("platformVersion", config.getProperty("platformVersion"));
					capabilities.setCapability("platformName", config.getProperty("platformName"));                 
					capabilities.setCapability(MobileCapabilityType.APP,"/Users/shanthalakshmi/Documents/BushfireFinal/BushFire1/Resources/app/BushFire 1.0.0.4.apk");
					driver2=new AndroidDriver(new URL("http://127.0.0.1:4743/wd/hub"), capabilities);
			        driver2.manage().timeouts().implicitlyWait(80, TimeUnit.SECONDS);			      
					
				}
		}

Got the following exception

The factory method class com.BushFire.common.AppUtilGroupChat.Init() threw an exception
at org.testng.internal.FactoryMethod.invoke(FactoryMethod.java:93)
at org.testng.internal.TestNGClassFinder.(TestNGClassFinder.java:140)
at org.testng.TestRunner.initMethods(TestRunner.java:409)
at org.testng.TestRunner.init(TestRunner.java:235)

could you please help me

could you please let me know how you automated chatting between two devices