@bootstraponline will this help to bring up parallel iOS simulator
Yes, Facebook has figured out how to do parallel iOS simulators. I've opened an issue on appium to adopt this new tool60.
Hi @bootstraponline and @saikrishna321 ,
Did you achieved parallel execution on IOS devices/simulators ? Please let us know.
Thanks,
Bhaskar.
Facebook figured it out with https://github.com/facebook/WebDriverAgent64 plus https://github.com/facebook/FBSimulatorControl34
Appium integration is being worked on.
@bootstraponline i was able to spin up two iOS Simulators, from commandline can i tell appium to run against a specific UDID ??
Steps to get two simulators
xcrun simctl create "mynewsimulator" "iPhone 6" "com.apple.CoreSimulator.SimRuntime.iOS-8-4"
open -n /Applications/Xcode.app/Contents/Developer/Applications/iOS\ Simulator.app/ --args -CurrentDeviceUDID '0F3826F2-2C2A-47E2-869C-7CE043C12F81'
See --udid
https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/server-args.md68
I think you'll need to change the ports as well (different for each instance).
@Simon_K @bootstraponline, how do i provide the tmp directories ?
package com.naukri.androidApp.TestSuite;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.remote.MobileCapabilityType;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.testng.annotations.Test;
import GenericFunctionsLibrary.GenericFunctions;
import com.naukri.androidApp.Code.SplashScreen;
import com.naukri.androidApp.ConfigDetails.Config;
public class ParallelExecution01 extends Config{
public AndroidDriver driver01;
public AndroidDriver driver02;
public void StartDriver01()
{
try {
File file = new File("<apk path>");
String appPath = file.getAbsolutePath();
//G2
driver01 = this.StartDriverAndroidApp01(appPath, appPackage, appActivity, "ZX1D64QFK6");
} catch (MalformedURLException e) {
e.printStackTrace();
}
}
@SuppressWarnings("null")
public AndroidDriver StartDriverAndroidApp01(String appLocation, String appPackage, String appActivity, String deviceName) throws MalformedURLException{
try{Thread.sleep(5000);}catch(Exception e){}
appPackage = Config.appPackage;
appActivity = Config.appActivity;
DesiredCapabilities capabilities = new DesiredCapabilities();
ThreadLocal<AndroidDriver> threadDriver = null;
//For device 1
capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, "ANDROID");
capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, "5.0.2");
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, "Android");
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, deviceName);
capabilities.setCapability(MobileCapabilityType.APP, appLocation);
capabilities.setCapability(MobileCapabilityType.APP_PACKAGE, appPackage);
capabilities.setCapability(MobileCapabilityType.APP_ACTIVITY, appActivity);
try {
System.setProperty("webdriver.ie.driver", "C:\\Program Files (x86)\\Internet Explorer\\iexplore.exe");
driver01 = new AndroidDriver(new URL("http://127.0.0.1:4444/wd/hub"), capabilities);
threadDriver.set((AndroidDriver) driver01);
} catch (MalformedURLException e) {
e.printStackTrace();
}
System.out.println("========driver after launching app========" + driver );
driver01.manage().timeouts().implicitlyWait(60000, TimeUnit.MILLISECONDS);
System.out.println("==========complete launchApp========");
return threadDriver.get();
}
public void StartDriver02()
{
try {
File file = new File("<apk path>");
String appPath = file.getAbsolutePath();
//S3
driver02 = this.StartDriverAndroidApp02(appPath, appPackage, appActivity, "4df707995bd4215b");
} catch (MalformedURLException e) {
e.printStackTrace();
}
}
@SuppressWarnings("null")
public AndroidDriver StartDriverAndroidApp02(String appLocation, String appPackage, String appActivity, String deviceName) throws MalformedURLException{
try{Thread.sleep(5000);}catch(Exception e){}
//appLocation = Config.appLocation;
appPackage = Config.appPackage;
appActivity = Config.appActivity;
DesiredCapabilities capabilities = new DesiredCapabilities();
//DesiredCapabilities capabilities1 = new DesiredCapabilities();
ThreadLocal<AndroidDriver> threadDriver = null;
//For device 1
capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, "ANDROID");
capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, "4.3");
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, "Android");
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, deviceName);
capabilities.setCapability(MobileCapabilityType.APP, appLocation);
capabilities.setCapability(MobileCapabilityType.APP_PACKAGE, appPackage);
capabilities.setCapability(MobileCapabilityType.APP_ACTIVITY, appActivity);
try {
System.setProperty("webdriver.ie.driver", "C:\\Program Files (x86)\\Internet Explorer\\iexplore.exe");
driver02 = new AndroidDriver(new URL("http://127.0.0.1:4444/wd/hub"), capabilities);
threadDriver.set((AndroidDriver) driver02);
} catch (MalformedURLException e) {
e.printStackTrace();
}
System.out.println("========driver after launching app========" + driver02 );
driver02.manage().timeouts().implicitlyWait(60000, TimeUnit.MILLISECONDS);
System.out.println("==========complete launchApp========");
return threadDriver.get();
}
@Test
public void TC_01() {
this.StartDriver01();
SplashScreen splash = new SplashScreen(driver01, null);
splash.ClickOnSearchJobsButton();
}
@Test
public void TC_02() {
this.StartDriver02();
SplashScreen splash = new SplashScreen(driver02, null);
splash.ClickOnLoginButton();
}
}
My Config files for hub and node are as follows:
Hub:
{
"url":"http://127.0.0.1:4444/wd/hub",
"host": 127.0.0.1,
"port": 4444,
"newSessionWaitTimeout": -1,
"servlets" : [],
"prioritizer": null,
"capabilityMatcher": "org.openqa.grid.internal.utils.DefaultCapabilityMatcher",
"throwOnCapabilityNotPresent": true,
"nodePolling": 5000,
"cleanUpCycle": 5000,
"timeout": 300000,
"maxSession": 5
}
Node files:
{
"capabilities":
[
{
"browserName": "ANDROID",
"version":"4.3",
"maxInstances": 1,
"platform":"ANDROID"
}
],
"configuration":
{
"cleanUpCycle":2000,
"timeout":10000,
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"url":"http://127.0.0.1:4744/wd/hub",
"maxSession": 4,
"port": 4744,
"host": "127.0.0.1",
"register": true,
"registerCycle": 5000,
"hubPort": 4444,
"hubHost": "127.0.0.1",
"role":"node"
}
}
{
"capabilities":
[
{
"browserName": "ANDROID",
"version":"4.3",
"maxInstances": 1,
"platform":"ANDROID"
}
],
"configuration":
{
"cleanUpCycle":2000,
"timeout":10000,
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"url":"http://127.0.0.1:4780/wd/hub",
"maxSession": 4,
"port": 4780,
"host": "127.0.0.1",
"register": true,
"registerCycle": 5000,
"hubPort": 4444,
"hubHost": "127.0.0.1",
"role":"node"
}
}
testng xml is as follows:
<?xml version="1.0" encoding="UTF-8"?>
thread-count="2">
<test name="ParallelExecution01" preserve-order="true">
<!-- <parameter name="DeviceId" value="ZX1D64QFK6"/> -->
<classes>
<class name="com.naukri.androidApp.TestSuite.ParallelExecution01">
<methods>
<include name="TC_01" />
</methods>
</class>
</classes>
</test>
<test name="ParallelExecution02" preserve-order="true">
<!-- <parameter name="DeviceId" value="a18dd209"/> -->
<classes>
<class name="com.naukri.androidApp.TestSuite.ParallelExecution01">
<methods>
<include name="TC_02" />
</methods>
</class>
</classes>
</test>
When I'm executing this code, it launches app only on any one device at a device. And throws a nullPointerException at "driver01 = new AndroidDriver(new URL("http://127.0.0.1:4444/wd/hub"), capabilities);" for both cases.
[TestNG] Running:
[ThreadUtil] Starting executor timeOut:2147483647ms workers:1 threadPoolSize:2
log4j:WARN No appenders could be found for logger (org.apache.http.client.protocol.RequestAddCookies).
log4j:WARN Please initialize the log4j system properly.
[Status]:TC_01_FAIL
[End]:08_51_30PM_10_Oct_2015_IP14.98.195.87
[Snapshot]:Click Here
[Status]:TC_02_FAIL
[End]:08_51_50PM_10_Oct_2015_IP14.98.195.87
[Snapshot]:Click Here
FAILED: TC_01
java.lang.NullPointerException
at com.naukri.androidApp.TestSuite.ParallelExecution01.StartDriverAndroidApp01(ParallelExecution01.java:86)
at com.naukri.androidApp.TestSuite.ParallelExecution01.StartDriver01(ParallelExecution01.java:42)
at com.naukri.androidApp.TestSuite.ParallelExecution01.TC_01(ParallelExecution01.java:159)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
at org.testng.TestRunner.privateRun(TestRunner.java:767)
at org.testng.TestRunner.run(TestRunner.java:617)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
at org.testng.SuiteRunner.access$000(SuiteRunner.java:37)
at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:368)
at org.testng.internal.thread.ThreadUtil$2.call(ThreadUtil.java:64)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
FAILED: TC_02
java.lang.NullPointerException
at com.naukri.androidApp.TestSuite.ParallelExecution01.StartDriverAndroidApp02(ParallelExecution01.java:141)
at com.naukri.androidApp.TestSuite.ParallelExecution01.StartDriver02(ParallelExecution01.java:108)
at com.naukri.androidApp.TestSuite.ParallelExecution01.TC_02(ParallelExecution01.java:166)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
at org.testng.TestRunner.privateRun(TestRunner.java:767)
at org.testng.TestRunner.run(TestRunner.java:617)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
at org.testng.SuiteRunner.access$000(SuiteRunner.java:37)
at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:368)
at org.testng.internal.thread.ThreadUtil$2.call(ThreadUtil.java:64)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
===============================================
Default test
Tests run: 2, Failures: 2, Skips: 0
===============================================
===============================================
androidautomationnaukriindia
Total tests run: 2, Failures: 2, Skips: 0
===============================================
[TestNG] Time taken by org.testng.reporters.EmailableReporter2@4a2c1b1c: 8 ms
[TestNG] Time taken by [FailedReporter passed=0 failed=0 skipped=0]: 9 ms
[TestNG] Time taken by org.testng.reporters.JUnitReportReporter@4f8d0299: 10 ms
[TestNG] Time taken by org.testng.reporters.jq.Main@309e7e21: 59 ms
[TestNG] Time taken by org.testng.reporters.XMLReporter@195bd6b9: 14 ms
[TestNG] Time taken by org.testng.reporters.SuiteHTMLReporter@25b5dab5: 37 ms
@rashiatry
Make sure of the following:
- You have started Appium servers with the correct IP addresses and port numbers on the nodes.
- You need to provide the UDID of the device
- Please provide Appium logs
- Please provide hub log
@rashiatry :- When you use two driver instances for each devices means you are executing two different tests. It may run parallel but I think its not a good idea to develop your tests, because now tomorrow if you want to run test on 3 or 4 devices then again you need to create driver2 and driver3. I don't think its a good solution for long run. I have a solution with single driver instance (for more details send a mail to appiummaster@gmail.com).
Refer this video
@rashiatry : I had done it with single instance of AppiumDriver
please clone
https://github.com/learnappium/appiumlearning.git100
it is practice and old code it may needed some enhancement
or go through code written to configure Selenium grid
hope it would help you to solve your issue
@Hassan_Radi
Thanks.
Yes, Appium servers are started on correct IP addressess and port numbers on individual nodes. (For confirmation you can check the json file of one node i have provided.)
When providing UDID, logs are as follows:
[debug] Error: Device 356446054209569 was not in the list of connected devices
null.<anonymous> (C:\Appium\node_modules\appium\lib\devices\android\android-common.js:406:19)
null.<anonymous> (C:\Appium\node_modules\appium\node_modules\appium-adb\lib\adb.js:610:9)
null.<anonymous> (C:\Appium\node_modules\appium\node_modules\appium-adb\lib\adb.js:842:7)
null.<anonymous> (C:\Appium\node_modules\appium\node_modules\appium-adb\lib\adb.js:172:9)
ChildProcess.exithandler (child_process.js:735:7)
ChildProcess.emit (events.js:110:17)
maybeClose (child_process.js:1008:16)
Process.ChildProcess._handle.onexit (child_process.js:1080:5)
[debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Device 356446054209569 was not in
ist of connected devices)","origValue":"Device 356446054209569 was not in the list of connected devices"},"sessionId":null}
<-- POST /wd/hub/session 500 7189.815 ms - 248
--> GET /wd/hub/status {}
[debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.4","revision":"c8c79a85fbd6870cd6fc3d66d038a115ebe22efe"}}}
<-- GET /wd/hub/status 200 2.641 ms - 104 {"status":0,"value":{"build":{"version":"1.3.4","revision":"c8c79a85fbd6870cd6fc3d66d038a115ebe22efe"}}}
--> GET /wd/hub/status {}
[debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.4","revision":"c8c79a85fbd6870cd6fc3d66d038a115ebe22efe"}}}
<-- GET /wd/hub/status 200 4.056 ms - 104 {"status":0,"value":{"build":{"version":"1.3.4","revision":"c8c79a85fbd6870cd6fc3d66d038a115ebe22efe"}}}
--> POST /wd/hub/session {"desiredCapabilities":{"app":"C:\\git\\androidautomationnaukriindia\\apks\\NaukriSplashScreen-debug02.apk","platformVersion":"4.3","de
me":"07c54b02864c8a2a","platformName":"Android","appActivity":"com.naukri.fragments.NaukriSplashScreen","browserName":"ANDROID","udid":"357541050536566","appPac
"naukriApp.appModules.login"}}
Client User-Agent string: Apache-HttpClient/4.3.2 (java 1.5)
[debug] Using local app from desired caps: C:\git\androidautomationnaukriindia\apks\NaukriSplashScreen-debug02.apk
[debug] Creating new appium session 15829be6-71d1-41d3-9f93-73762d649fdb
Starting android appium
[debug] Getting Java version
Java version is: 1.7.0_25
[debug] Using fast reset? true
[debug] Preparing device for session
[debug] Checking whether app is actually present
[debug] Checking whether adb is present
[debug] Using adb from D:\adt-bundle-windows-x86-20130729\sdk\platform-tools\adb.exe
Retrieving device
[debug] Trying to find a connected android device
[debug] Getting connected devices...
[debug] executing cmd: D:\adt-bundle-windows-x86-20130729\sdk\platform-tools\adb.exe devices
[debug] 2 device(s) connected
[debug] Sent shutdown command, waiting for UiAutomator to stop...
--> GET /wd/hub/status {}
[debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.4","revision":"c8c79a85fbd6870cd6fc3d66d038a115ebe22efe"}},"sessionId":"
e6-71d1-41d3-9f93-73762d649fdb"}
<-- GET /wd/hub/status 200 5.133 ms - 155 {"status":0,"value":{"build":{"version":"1.3.4","revision":"c8c79a85fbd6870cd6fc3d66d038a115ebe22efe"}},"sessionId":"1
6-71d1-41d3-9f93-73762d649fdb"}
UiAutomator did not shut down fast enough, calling it gone
[debug] Cleaning up android objects
[debug] Cleaning up appium session
Failed to start an Appium session, err was: Error: Device 357541050536566 was not in the list of connected devices
[debug] Error: Device 357541050536566 was not in the list of connected devices
null.<anonymous> (C:\Appium\node_modules\appium\lib\devices\android\android-common.js:406:19)
null.<anonymous> (C:\Appium\node_modules\appium\node_modules\appium-adb\lib\adb.js:610:9)
null.<anonymous> (C:\Appium\node_modules\appium\node_modules\appium-adb\lib\adb.js:842:7)
null.<anonymous> (C:\Appium\node_modules\appium\node_modules\appium-adb\lib\adb.js:172:9)
ChildProcess.exithandler (child_process.js:735:7)
ChildProcess.emit (events.js:110:17)
maybeClose (child_process.js:1008:16)
Process.ChildProcess._handle.onexit (child_process.js:1080:5)
[debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Device 357541050536566 was not in
ist of connected devices)","origValue":"Device 357541050536566 was not in the list of connected devices"},"sessionId":null}
<-- POST /wd/hub/session 500 7184.242 ms - 248
Logs when UDID is not provided:
info: <-- GET /wd/hub/status 200 93016.713 ms - 104 {"status":0,"value":{"build":{"version":"1.3.4","revision":"c8c79a85fbd6870cd6fc3d66d038a115ebe22efe"}}}
info: --> POST /wd/hub/session {"desiredCapabilities":{"app":"C:\\git\\androidautomationnaukriindia\\apks\\NaukriSplashScreen-debug02.apk","platformVersion":"4.3","de
viceName":"07c54b02864c8a2a","platformName":"Android","appActivity":"com.naukri.fragments.NaukriSplashScreen","browserName":"ANDROID","appPackage":"naukriApp.appModul
es.login"}}
info: Client User-Agent string: Apache-HttpClient/4.3.2 (java 1.5)
info: [debug] Using local app from desired caps: C:\git\androidautomationnaukriindia\apks\NaukriSplashScreen-debug02.apk
info: [debug] Creating new appium session 26544b18-0d5d-4e5e-b759-50f42cc14968
info: Starting android appium
info: [debug] Getting Java version
info: Java version is: 1.7.0_25
info: [debug] Using fast reset? true
info: [debug] Preparing device for session
info: [debug] Checking whether app is actually present
info: [debug] Checking whether adb is present
info: [debug] Using adb from D:\adt-bundle-windows-x86-20130729\sdk\platform-tools\adb.exe
info: Retrieving device
info: [debug] Trying to find a connected android device
info: [debug] Getting connected devices...
info: [debug] executing cmd: D:\adt-bundle-windows-x86-20130729\sdk\platform-tools\adb.exe devices
info: [debug] 2 device(s) connected
info: Found device 4df707995bd4215b
info: [debug] Setting device id to 4df707995bd4215b
info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
info: [debug] executing cmd: D:\adt-bundle-windows-x86-20130729\sdk\platform-tools\adb.exe -s 4df707995bd4215b wait-for-device
info: [debug] executing cmd: D:\adt-bundle-windows-x86-20130729\sdk\platform-tools\adb.exe -s 4df707995bd4215b shell "echo 'ready'"
info: [debug] Starting logcat capture
info: [debug] Getting device API level
info: [debug] executing cmd: D:\adt-bundle-windows-x86-20130729\sdk\platform-tools\adb.exe -s 4df707995bd4215b shell "getprop ro.build.version.sdk"
info: [debug] Device is at API Level 18
info: Device API level is: 18
info: [debug] executing cmd: D:\adt-bundle-windows-x86-20130729\sdk\platform-tools\adb.exe -s 4df707995bd4215b shell "getprop persist.sys.language"
info: [debug] Current device persist.sys.language: en
info: [debug] java -jar "C:\Appium\node_modules\appium\node_modules\appium-adb\jars\appium_apk_tools.jar" "stringsFromApk" "C:\git\androidautomationnaukriindia\apks\N
aukriSplashScreen-debug02.apk" "C:\Users\RASHI~1.ATR\AppData\Local\Temp\naukriApp.appModules.login" en
info: [debug] No strings.xml for language 'en', getting default strings.xml
info: [debug] java -jar "C:\Appium\node_modules\appium\node_modules\appium-adb\jars\appium_apk_tools.jar" "stringsFromApk" "C:\git\androidautomationnaukriindia\apks\N
aukriSplashScreen-debug02.apk" "C:\Users\RASHI~1.ATR\AppData\Local\Temp\naukriApp.appModules.login"
info: [debug] executing cmd: D:\adt-bundle-windows-x86-20130729\sdk\platform-tools\adb.exe -s 4df707995bd4215b push "C:\\Users\\RASHI~1.ATR\\AppData\\Local\\Temp\\nau
kriApp.appModules.login\\strings.json" /data/local/tmp
info: [debug] Checking whether aapt is present
info: [debug] Using aapt from D:\adt-bundle-windows-x86-20130729\sdk\build-tools\android-4.3\aapt.exe
info: [debug] Retrieving process from manifest.
info: [debug] executing cmd: D:\adt-bundle-windows-x86-20130729\sdk\build-tools\android-4.3\aapt.exe dump xmltree C:\git\androidautomationnaukriindia\apks\NaukriSplas
hScreen-debug02.apk AndroidManifest.xml
info: [debug] Set app process to: naukriApp.appModules.login
info: [debug] Not uninstalling app since server not started with --full-reset
info: [debug] Checking app cert for C:\git\androidautomationnaukriindia\apks\NaukriSplashScreen-debug02.apk.
info: [debug] executing cmd: java -jar C:\Appium\node_modules\appium\node_modules\appium-adb\jars\verify.jar C:\git\androidautomationnaukriindia\apks\NaukriSplashScre
en-debug02.apk
info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.4","revision":"c8c79a85fbd6870cd6fc3d66d038a115ebe22efe"}},"sessionId":"
26544b18-0d5d-4e5e-b759-50f42cc14968"}
info: <-- GET /wd/hub/status 200 2.839 ms - 155 {"status":0,"value":{"build":{"version":"1.3.4","revision":"c8c79a85fbd6870cd6fc3d66d038a115ebe22efe"}},"sessionId":"2
6544b18-0d5d-4e5e-b759-50f42cc14968"}
info: [debug] App already signed.
info: [debug] Zip-aligning C:\git\androidautomationnaukriindia\apks\NaukriSplashScreen-debug02.apk
info: [debug] Checking whether zipalign is present
info: [debug] Using zipalign from D:\adt-bundle-windows-x86-20130729\sdk\build-tools\20.0.0\zipalign.exe
info: [debug] Zip-aligning apk.
info: [debug] executing cmd: D:\adt-bundle-windows-x86-20130729\sdk\build-tools\20.0.0\zipalign.exe -f 4 C:\git\androidautomationnaukriindia\apks\NaukriSplashScreen-d
ebug02.apk C:\Users\RASHI~1.ATR\AppData\Local\Temp\appium115912-8656-12e5dk5.tmp
info: [debug] MD5 for app is 066cb494e957769820f384372c5893ed
info: [debug] executing cmd: D:\adt-bundle-windows-x86-20130729\sdk\platform-tools\adb.exe -s 4df707995bd4215b shell "ls /data/local/tmp/066cb494e957769820f384372c589
3ed.apk"
info: [debug] Getting install status for naukriApp.appModules.login
info: [debug] Getting device API level
info: [debug] executing cmd: D:\adt-bundle-windows-x86-20130729\sdk\platform-tools\adb.exe -s 4df707995bd4215b shell "getprop ro.build.version.sdk"
info: [debug] Device is at API Level 18
info: [debug] executing cmd: D:\adt-bundle-windows-x86-20130729\sdk\platform-tools\adb.exe -s 4df707995bd4215b shell "pm list packages -3 naukriApp.appModules.login"
info: [debug] App is installed
info: App is already installed, resetting app
info: [debug] Running fast reset (stop and clear)
info: [debug] executing cmd: D:\adt-bundle-windows-x86-20130729\sdk\platform-tools\adb.exe -s 4df707995bd4215b shell "am force-stop naukriApp.appModules.login"
info: [debug] executing cmd: D:\adt-bundle-windows-x86-20130729\sdk\platform-tools\adb.exe -s 4df707995bd4215b shell "pm clear naukriApp.appModules.login"
info: [debug] Forwarding system:4724 to device:4724
info: [debug] executing cmd: D:\adt-bundle-windows-x86-20130729\sdk\platform-tools\adb.exe -s 4df707995bd4215b forward tcp:4724 tcp:4724
info: [debug] Pushing appium bootstrap to device...
info: [debug] executing cmd: D:\adt-bundle-windows-x86-20130729\sdk\platform-tools\adb.exe -s 4df707995bd4215b push "C:\\Appium\\node_modules\\appium\\build\\android_
bootstrap\\AppiumBootstrap.jar" /data/local/tmp/
info: [debug] Pushing settings apk to device...
info: [debug] executing cmd: D:\adt-bundle-windows-x86-20130729\sdk\platform-tools\adb.exe -s 4df707995bd4215b install "C:\Appium\node_modules\appium\build\settings_a
pk\settings_apk-debug.apk"
info: [debug] Pushing unlock helper app to device...
info: [debug] executing cmd: D:\adt-bundle-windows-x86-20130729\sdk\platform-tools\adb.exe -s 4df707995bd4215b install "C:\Appium\node_modules\appium\build\unlock_apk
\unlock_apk-debug.apk"
info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.4","revision":"c8c79a85fbd6870cd6fc3d66d038a115ebe22efe"}},"sessionId":"
26544b18-0d5d-4e5e-b759-50f42cc14968"}
info: <-- GET /wd/hub/status 200 3.557 ms - 155 {"status":0,"value":{"build":{"version":"1.3.4","revision":"c8c79a85fbd6870cd6fc3d66d038a115ebe22efe"}},"sessionId":"2
6544b18-0d5d-4e5e-b759-50f42cc14968"}
info: Starting App
info: [debug] Attempting to kill all 'uiautomator' processes
info: [debug] Getting all processes with 'uiautomator'
info: [debug] executing cmd: D:\adt-bundle-windows-x86-20130729\sdk\platform-tools\adb.exe -s 4df707995bd4215b shell "ps 'uiautomator'"
info: [debug] Attempting to kill process 20444
info: [debug] executing cmd: D:\adt-bundle-windows-x86-20130729\sdk\platform-tools\adb.exe -s 4df707995bd4215b shell "kill 20444"
info: [debug] Running bootstrap
info: [debug] spawning: D:\adt-bundle-windows-x86-20130729\sdk\platform-tools\adb.exe -s 4df707995bd4215b shell uiautomator runtest AppiumBootstrap.jar -c io.appium.a
ndroid.bootstrap.Bootstrap
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
info: [debug] [UIAUTOMATOR STDOUT] io.appium.android.bootstrap.Bootstrap:
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 1
info: [debug] [BOOTSTRAP] [debug] Socket opened on port 4724
info: [debug] [BOOTSTRAP] [debug] Appium Socket Server Ready
info: [debug] [BOOTSTRAP] [debug] Loading json...
info: [debug] Waking up device if it's not alive
info: [debug] Pushing command to appium work queue: ["wake",{}]
info: [debug] [BOOTSTRAP] [debug] json loading complete.
info: [debug] [BOOTSTRAP] [debug] Registered crash watchers.
info: [debug] [BOOTSTRAP] [debug] Client connected
info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"wake","params":{}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] executing cmd: D:\adt-bundle-windows-x86-20130729\sdk\platform-tools\adb.exe -s 4df707995bd4215b shell "dumpsys window"
info: [debug] [BOOTSTRAP] [debug] Got command action: wake
info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":true,"status":0}
info: [debug] Screen already unlocked, continuing.
info: [debug] Pushing command to appium work queue: ["getDataDir",{}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"getDataDir","params":{}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: getDataDir
info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":"\/data\/local\/tmp","status":0}
info: [debug] dataDir set to: /data/local/tmp
info: [debug] Pushing command to appium work queue: ["compressedLayoutHierarchy",{"compressLayout":false}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"compressedLayoutHierarchy","params":{"compressLayout":false}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: compressedLayoutHierarchy
info: [debug] Getting device API level
info: [debug] executing cmd: D:\adt-bundle-windows-x86-20130729\sdk\platform-tools\adb.exe -s 4df707995bd4215b shell "getprop ro.build.version.sdk"
info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":false,"status":0}
info: [debug] Device is at API Level 18
info: [debug] executing cmd: D:\adt-bundle-windows-x86-20130729\sdk\platform-tools\adb.exe -s 4df707995bd4215b shell "am start -S -a android.intent.action.MAIN -c and
roid.intent.category.LAUNCHER -f 0x10200000 -n naukriApp.appModules.login/com.naukri.fragments.NaukriSplashScreen"
info: [debug] Waiting for pkg "naukriApp.appModules.login" and activity "com.naukri.fragments.NaukriSplashScreen" to be focused
info: [debug] Getting focused package and activity
info: [debug] executing cmd: D:\adt-bundle-windows-x86-20130729\sdk\platform-tools\adb.exe -s 4df707995bd4215b shell "dumpsys window windows"
info: [debug] Device launched! Ready for commands
info: [debug] Setting command timeout to the default of 60 secs
info: [debug] Appium session started with sessionId 26544b18-0d5d-4e5e-b759-50f42cc14968
info: <-- POST /wd/hub/session 303 11406.100 ms - 9
info: --> GET /wd/hub/session/26544b18-0d5d-4e5e-b759-50f42cc14968 {}
info: [debug] Responding to client with success: {"status":0,"value":{"platform":"LINUX","browserName":"ANDROID","platformVersion":"4.3","webStorageEnabled":false,"ta
kesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"app":"C:
\\git\\androidautomationnaukriindia\\apks\\NaukriSplashScreen-debug02.apk","platformVersion":"4.3","deviceName":"07c54b02864c8a2a","platformName":"Android","appActivi
ty":"com.naukri.fragments.NaukriSplashScreen","browserName":"ANDROID","appPackage":"naukriApp.appModules.login"},"app":"C:\\git\\androidautomationnaukriindia\\apks\\N
aukriSplashScreen-debug02.apk","deviceName":"07c54b02864c8a2a","platformName":"Android","appActivity":"com.naukri.fragments.NaukriSplashScreen","appPackage":"naukriAp
p.appModules.login"},"sessionId":"26544b18-0d5d-4e5e-b759-50f42cc14968"}
info: <-- GET /wd/hub/session/26544b18-0d5d-4e5e-b759-50f42cc14968 200 4.722 ms - 853 {"status":0,"value":{"platform":"LINUX","browserName":"ANDROID","platformVersion
":"4.3","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":fal
se,"warnings":{},"desired":{"app":"C:\\git\\androidautomationnaukriindia\\apks\\NaukriSplashScreen-debug02.apk","platformVersion":"4.3","deviceName":"07c54b02864c8a2a
","platformName":"Android","appActivity":"com.naukri.fragments.NaukriSplashScreen","browserName":"ANDROID","appPackage":"naukriApp.appModules.login"},"app":"C:\\git\\
androidautomationnaukriindia\\apks\\NaukriSplashScreen-debug02.apk","deviceName":"07c54b02864c8a2a","platformName":"Android","appActivity":"com.naukri.fragments.Naukr
iSplashScreen","appPackage":"naukriApp.appModules.login"},"sessionId":"26544b18-0d5d-4e5e-b759-50f42cc14968"}
info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.4","revision":"c8c79a85fbd6870cd6fc3d66d038a115ebe22efe"}},"sessionId":"
26544b18-0d5d-4e5e-b759-50f42cc14968"}
info: <-- GET /wd/hub/status 200 3.028 ms - 155 {"status":0,"value":{"build":{"version":"1.3.4","revision":"c8c79a85fbd6870cd6fc3d66d038a115ebe22efe"}},"sessionId":"2
6544b18-0d5d-4e5e-b759-50f42cc14968"}
How can I get hub logs, I have limited knowledge about Selenium Grid.
Please help me find problem, so that solution could be found.
@Appium_Master thanks, for help. I ave tried doing this whole thing with single driver instance as well, but even that didn't work.
I'll try again with your provided information and will inform.
Hi @kallemsandeep,
I am able to run tests parallel on multiple devices, by giving different udids ,appium server's port numbers & bootstrap port numbers.
Please follow the below posts...You may able to do and fulfill your requirement.
Hi Pallavi,
Please follow his (@Appium_Master) guidelines...
Two Different appium driver with different devicename and platform version executes test on same device
Platform i am using is MAC and Android Debug Bridge version 1.0.32 Revision eac51f2bb6a8-android
I am starting two appium servers
server 1 using port 4723 , chrome driver port is 62362
server 2 port is 4743 , chrome driver port is 62366
and i am setting in my desirered capablities
driver1:
url = new URL("http://" 127.0.0.1:4723/wd/hub");
cap.setCapability(MobileCapabilityType.DEVICE_NAME, "LGD8553b0c00b3");
cap.setCapability(MobileCapabilityType.PLATFORM_VERSION,"5.0");
driver2:
url = new URL("http://"0.0.0.0:4743/wd/hub");
cap.setCapability(MobileCapabilityType.DEVICE_NAME, "0123456789ABCDEF");
cap.setCapability(MobileCapabilityType.PLATFORM_VERSION,"4.4.2");
i am trying to launch driver1 and driver2 in one test to verify both devices screen have same values but when i am running test 1-> driver1 is run on LG and appium server 4723 and after that when the turn for driver2 comes the test again runs on LG only with appium server 4743. even though both have different device name and platform version in desiredcapablities.
when i execute adb devices it shows both devices are connected but when i am executing it from appium, whichever device is listed first both tests are executed on it. does the devicesName parameter does not affect the execution ?
here is the log of driver2 appium server
info: Welcome to Appium v1.4.13 (REV c75d8adcb66a75818a542fe1891a34260c21f76a)
info: Appium REST http interface listener started on 0.0.0.0:4743
info: [debug] Non-default server args: {"port":4743,"sessionOverride":true,"chromeDriverPort":62366,"defaultCommandTimeout":6000,"tmpDir":"/tmp/driver4743/"}
info: Console LogLevel: debug
info: --> POST /wd/hub/session {"desiredCapabilities":{"appPackage":"com.abcd","appActivity":"ui.activity.homescreens.SplashScreenActivity","platformVersion":"4.4.2","appWaitActivity":"ui.activity.homescreens.SplashScreenActivity,.ui.activity.homescreens.StartActivity,.ui.activity.RegisterFragments,.ui.activity.VideoActivity,.ui.activity.preferencesflow.PreferencesActivity,com.abcd/.ui.activity.homescreens.LargeProfilePhotoActivity,.ui.activity.DialpadActivity,.ui.activity.MoreActivity","browserName":"android","platformName":"Android","version":"","deviceName":"0123456789ABCDEF","platform":"ANDROID"}}
info: Client User-Agent string: Apache-HttpClient/4.3.3 (java 1.5)
info: [debug] The following desired capabilities were provided, but not recognized by appium. They will be passed on to any other services running on this server. : version, platform
info: [debug] Didn't get app but did get Android package, will attempt to launch it on the device
info: [debug] Creating new appium session 01a341cc-7a51-4b54-b247-a402ba6ef64e
info: Starting android appium
info: [debug] Getting Java version
info: Java version is: 1.8.0_05
info: [debug] Checking whether adb is present
info: [debug] Using adb from /users/abcd/Library/Android/sdk/platform-tools/adb
warn: No app capability, can't parse package/activity
info: [debug] Using fast reset? true
info: [debug] Preparing device for session
info: [debug] Not checking whether app is present since we are assuming it's already on the device
info: Retrieving device
info: [debug] Trying to find a connected android device
info: [debug] Getting connected devices...
info: [debug] executing cmd: /users/abcd/Library/Android/sdk/platform-tools/adb devices
info: [debug] 2 device(s) connected
info: Found device LGD8553b0c00b3
info: [debug] Setting device id to LGD8553b0c00b3
info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
info: [debug] executing cmd: /users/abcd/Library/Android/sdk/platform-tools/adb -s LGD8553b0c00b3 wait-for-device
info: [debug] executing cmd: /users/abcd/Library/Android/sdk/platform-tools/adb -s LGD8553b0c00b3 shell "echo 'ready'"
info: [debug] Starting logcat capture
info: [debug] Getting device API level
info: [debug] executing cmd: /users/abcd/Library/Android/sdk/platform-tools/adb -s LGD8553b0c00b3 shell "getprop ro.build.version.sdk"
info: [debug] Device is at API Level 21
info: Device API level is: 21
info: [debug] Extracting strings for language: default
info: [debug] Apk doesn't exist locally
info: [debug] Could not get strings, but it looks like we had an old strings file anyway, so ignoring
info: [debug] executing cmd: /users/abcd/Library/Android/sdk/platform-tools/adb -s LGD8553b0c00b3 shell "rm -rf /data/local/tmp/strings.json"
info: [debug] Not uninstalling app since server not started with --full-reset
info: [debug] Skipping install since we launched with a package instead of an app path
info: [debug] Forwarding system:4724 to device:4724
info: [debug] executing cmd: /users/abcd/Library/Android/sdk/platform-tools/adb -s LGD8553b0c00b3 forward tcp:4724 tcp:4724
info: [debug] Pushing appium bootstrap to device...
info: [debug] executing cmd: /users/abcd/Library/Android/sdk/platform-tools/adb -s LGD8553b0c00b3 push "/usr/local/lib/node_modules/appium/build/android_bootstrap/AppiumBootstrap.jar" /data/local/tmp/
info: [debug] Pushing settings apk to device...
info: [debug] executing cmd: /users/abcd/Library/Android/sdk/platform-tools/adb -s LGD8553b0c00b3 install "/usr/local/lib/node_modules/appium/build/settings_apk/settings_apk-debug.apk"
info: [debug] Pushing unlock helper app to device...
info: [debug] executing cmd: /users/abcd/Library/Android/sdk/platform-tools/adb -s LGD8553b0c00b3 install "/usr/local/lib/node_modules/appium/build/unlock_apk/unlock_apk-debug.apk"
info: Starting App
info: [debug] Attempting to kill all 'uiautomator' processes
info: [debug] Getting all processes with 'uiautomator'
info: [debug] executing cmd: /users/abcd/Library/Android/sdk/platform-tools/adb -s LGD8553b0c00b3 shell "ps 'uiautomator'"
info: [debug] Attempting to kill process 31990
info: [debug] executing cmd: /users/abcd/Library/Android/sdk/platform-tools/adb -s LGD8553b0c00b3 shell "kill 31990"
info: [debug] Running bootstrap
info: [debug] spawning: /users/abcd/Library/Android/sdk/platform-tools/adb -s LGD8553b0c00b3 shell uiautomator runtest AppiumBootstrap.jar -c io.appium.android.bootstrap.Bootstrap -e pkg com.abcd -e disableAndroidWatchers false
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
info: [debug] [UIAUTOMATOR STDOUT] io.appium.android.bootstrap.Bootstrap:
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 1
info: [debug] [BOOTSTRAP] [debug] Socket opened on port 4724
info: [debug] [BOOTSTRAP] [debug] Appium Socket Server Ready
info: [debug] [BOOTSTRAP] [debug] Loading json...
info: [debug] [BOOTSTRAP] [debug] Registered crash watchers.
info: [debug] Waking up device if it's not alive
info: [debug] Pushing command to appium work queue: ["wake",{}]
info: [debug] [BOOTSTRAP] [debug] Client connected
info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"wake","params":{}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: wake
info: [debug] [BOOTSTRAP] [debug] Returning result: {"status":0,"value":true}
info: [debug] executing cmd: /users/abcd/Library/Android/sdk/platform-tools/adb -s LGD8553b0c00b3 shell "dumpsys window"
info: [debug] Screen already unlocked, continuing.
info: [debug] Pushing command to appium work queue: ["getDataDir",{}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"getDataDir","params":{}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: getDataDir
info: [debug] [BOOTSTRAP] [debug] Returning result: {"status":0,"value":"\/data\/local\/tmp"}
info: [debug] dataDir set to: /data/local/tmp
info: [debug] Pushing command to appium work queue: ["compressedLayoutHierarchy",{"compressLayout":false}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"compressedLayoutHierarchy","params":{"compressLayout":false}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: compressedLayoutHierarchy
info: [debug] [BOOTSTRAP] [debug] Returning result: {"status":0,"value":false}
info: [debug] Getting device API level
info: [debug] executing cmd: /users/abcd/Library/Android/sdk/platform-tools/adb -s LGD8553b0c00b3 shell "getprop ro.build.version.sdk"
info: [debug] Device is at API Level 21
info: [debug] executing cmd: /users/abcd/Library/Android/sdk/platform-tools/adb -s LGD8553b0c00b3 shell "am start -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000 -n com.abcd/ui.activity.homescreens.SplashScreenActivity"
info: [debug] We tried to start an activity that doesn't exist, retrying with . prepended to activity
info: [debug] Getting device API level
info: [debug] executing cmd: /users/abcd/Library/Android/sdk/platform-tools/adb -s LGD8553b0c00b3 shell "getprop ro.build.version.sdk"
info: [debug] Device is at API Level 21
@salmanchauhan
You need to provide the device UDID capability in order to tell the adb to select the correct device to run the test on.
Thanks alot man you saved my day @Hassan_Radi
Hi @salmanchauhan,
you must use MobileCapabilityType.UDID to select the device, instead of MobileCapabilityType.DEVICE_NAME.
deviceName server capability is only used on iOS simulator as you can see in http://appium.io/slate/en/master/?ruby#appium-server-capabilities64.
Hello Everyone,
i have a issue registering node using appium
my json file is
{
"capabilities":[
{
"deviceName":"a01b27a8",
"version":"5.1.1",
"maxInstances":5,
"platform":"ANDROID"
}
],
"Configuration":{
"cleanUpCycle":2000,
"timeout":30000,
"proxy":"org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"url":"http://127.0.0.1:4723/wd/hub",
"hub":"http://192.168.1.202:4444/grid/register/",
"maxSession":1,
"Port":4723,
"host":"127.0.0.1",
"register":true,
"registerCycle":5000,
"hubHost":"192.168.1.202",
"hubport":"4444"
}
}
and the log what i got is
error: uncaughtException: Cannot read property 'url' of undefined date=Mon Dec 28 2015 16:33:22 GMT+0530 (India Standard Time), pid=2936, uid=null, gid=null, cwd=C:\Program Files\Appium\node_modules\appium, execPath=C:\Program Files\Appium\node.exe, version=v0.10.26, argv=[C:\Program Files\Appium\node.exe, C:\Program Files\Appium\node_modules\appium\lib\server\main.js, --address, 127.0.0.1, --port, 4725, --intent-category, android.intent.category.LAUNCHER, --nodeconfig, C:\Users\FC\workspace\XXXXXXt\Json\SamsungS4.json, --platform-name, Android, --platform-version, 22, --automation-name, Appium, --log-no-color], rss=71778304, heapTotal=61430984, heapUsed=42524552, loadavg=[0, 0, 0], uptime=17153.8082866, trace=[column=32, file=Files\Appium\node_modules\appium\lib\server\grid-register.js, function=postRequest (C:\Program, line=46, method=null, native=false, column=7, file=Files\Appium\node_modules\appium\lib\server\grid-register.js, function=C:\Program, line=14, method=null, native=false, column=14, file=fs.js, function=null, line=266, method=null, native=false, column=15, file=fs.js, function=Object.oncomplete, line=107, method=oncomplete, native=false], stack=[TypeError: Cannot read property 'url' of undefined, at postRequest (C:\Program Files\Appium\node_modules\appium\lib\server\grid-register.js:46:32), at C:\Program Files\Appium\node_modules\appium\lib\server\grid-register.js:14:7, at fs.js:266:14, at Object.oncomplete (fs.js:107:15)]
and to register node i used
appium -a 127.0.0.1 -p 4723 --bootstrap-port 4727 -U a01b27a8 --nodeconfig c:\Users\FC\workspace\XXXXXXt\Json\SamsungS4.json
Please help
Thank you
Ravi
@bhaskar
when I run my test I always see in my grid/consols that I have 1 Instance less (like not available).
How to manage it so after executing a test the Instance went back to be available, please?
@jonahss Will parallel tests be part of 1.5 ? Just asking because your post is from June 2015...Thanks
@jonahss I see. Until then, what do you think is the best way to run tests in parallel on iOS devices ? This Instruments limitation of 1 device per machine is still a thing, right ? So VM's would be a legit approach still ? Thanks !
Hi @Shankeyisgem.
In order to setup Selenium grid for Appium tests you need to have Selenium Hub running and 2 nodes,1 with Android capabilities and another with IOS capabilities registered with the hub.
Now if you are having your testsuite specified in TestNG.xml then you can specify parameter say e.g. "IOSTest" for a test which you want to give to IOS device to run and you can specify parameter e.g."AndroidTest" for a test which you want to give to Android device to run.
These settings "IOSTest" and "AndroidTest" based on which test distribution is going to happen,should be present in BrowserName capability included in .jason file which you may be using to start and register nodes.
And at script side you will be receiving these TestNG parameters and using it to set BrowserName DesiredCapability while instantiating DesiredCapabilities object which you will eventually use to create Driver object.
Note that to distribute tests among the registered nodes,"BrowserName" is the capability which Selenium Grid takes into consideration.
Hope this will help you out.If you want any other details then please feel free to contact me.
Thanks and Regards,
Pranoday
Thanks for your reply Pranodayd,
Couple of things:
I could set up selenium grid by issuing command in cmd but for registering Hubs which port numbers I should provide? Or can we have this Hub/node configuration specified in Eclispe for batter handling?
Actually I have very minimally used Appium with eclipse. So only simple script that I have is just to launch mobile app and some tapping arround and this script is just definded in a class file under eclipse project and when I running it as Tesng, it's going fine for my configured android device and I want to run this script in multiple devices.
Now that said, I have no Idea as how to configure Testing.XML/Json file in eclipse as you mentioned.
Can you send across some working code for same so that it is more clea for me?
No need to use Eclipse to configure and trigger Selenium Grid execution.You can configure TestNG.xml and .json files using any editor like Notepad etc.
following is and example .json file:
{
"capabilities":
[
{
"browserName": "IpadMiniDevice",
"version":"8.5",
"maxInstances": 1,
"platform":"MAC",
"deviceName":"IpadMiniDevice"
},
{
"browserName": "AllIpadDevices",
"version":"8.5",
"maxInstances": 1,
"platform":"MAC",
"deviceName":"AllTabletDevices"
}
],
"configuration":
{
"cleanUpCycle":2000,
"timeout":0,
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"url":"http://<IpAddress on Which AppiumServer is running:Port on Which AppiumServer is running>/wd/hub",
"maxSession": 1,
"port": <Port on Which AppiumServer is running>,
"host": <IpAddress on Which AppiumServer is running>,
"register": true,
"registerCycle": 5000,
"hubPort": <Port on Which Selenium Grid hub is running>,
"hubHost": <IpAddress on Which Selenium Grid hub is running>
}
}
You can start Selenium Grid hub and nodes using following dos commands:
To start Hub use following command:
java -jar -timeout 0 -remoteControlPollingIntervalInSeconds 300 -role hub
To start and register node use following command:
java -jar -role node -nodeConfig
Thanks and Regards,
Pranoday
Hi Bhaskar,
Could you please help me know how you did with single driver instance?? Currently i am able to do that by creating multiple capabilities object and passing them on multiple driver instances. This is not the correct approach i know. Please help me how did you define in your class file and xml. Please.
if possible could you share your code snippet??
Hi Bhashkar,
Can u please send me the document if any to start Appium Grid with Mac for One Machine with Multiple Devices.
Please do the needful Send me the Document if possible to janardhanreddyqa@gmail.com1
Thanks & Regards,
Janardhan Reddy M.