Appium - Parallel Execution (Grid)

The error is coming only when you’re trying to start another appium server with the same port number…and in the picture you were not given different appium port numbers and bootstrap numbers. Could you please check them once and give --udid XYZZZZZZ along with them if possible.

UDID is for iOS devices…right?

Also, m able to create grid properly now. Thanks a lot.

Now the test case is failing. Throwing null pointer exception

That sounds great.!!! :wink:
udid means serial number of your andriod device too… just type a command in your cmd prompt “adb devices” , you’ll find a unique number for each device that is udid only.Check your log once.

Regards,
Bhaskar.

Successfully created grid and node.
When executed, out of 2 tests 1 of them fail… even though device id is mentioned it is getting executed on another device. Its running only on one device at a time

Throwing an error: org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: The following desired capabilities are required, but were not provided: deviceName)

Even though the deviceName is correct and same as mentioned in .json file

Any solution for this? Tried alot but no success

Hi @RISHI_KHANNA ,

Please make change “device” as “deviceName” in your nodeconfig.json file ,have a try . it may resolved.But in my case it is working fine with device…

Thanks,
Bhaskar.

Hi Bhaskar,

While running test from testing suite, yes…you can run parallel on local machine.
but is there any way in testing if

  1. I want to run test on different machine
  2. I want to run test on Different OS (like MAC )

As per my knowledge selenium standalone server used to achieve above points

Hi @Arvind_Patel,

Good Point raised :+1: .
As of now we can run multiple tests on different OS’s and machines too for Web based Automation using Selenium (acts Selenium server.jar as both Hub and Node). But consider for Mobile Automation Appium is a Server that can not handle multiple sessions at a time till now .

I haven’t done your requirements till now. Apparently, the above comments you’re mentioned mayn’t possible i guess (i’m not sure). Please check the same with others too and have a look on the following link .

Regards,
Vijay Bhaskar.

1 Like

Best to use separate VMs one appium server per device. We are working on a appium rewrite which should make this better.

@Arvind_Patel @bhaskar:
Answer to arvind’s question : That can be also achieved using parametrization of machine name/machine ip.
just pass machine ip/machine name just like port number and it will run on those machines at the same time.

You need to create variable
String MachineIp=127.0.0.1;
String portNumber=4723;
driver = new AndroidDriver(new URL(“http://MachineIp:portNumber/wd/hub”), capabilities);

1 Like

@Appium_Master

Is this logic working for parallel execution context (multiple device and machine ) ?

@Appium_Master : Just now I tried it and it is working fine.

Hi @Appium_Master,

Thanks for the reply. I had done the same few days ago. But Appium should be installed on Remote Machine and also be on running state.

Thanks,
Bhaskar.

Yes @Arvind_Patel ,

It could be possible with Appium Master’s inputs…go ahead.

Thanks,
Bhaskar.

OOHH man,
parallel execution killing me. :stuck_out_tongue_winking_eye: . though any how i made it but still there is one problem i am facing

i am running two different test parallely on different device
like

  1. 2 appium node running with two devices, ports and josn config
  2. Selenium grid is running and both node registered

Now i am setting capability dynamically (getting parameter from suite file )
ex:
Test1


Test2


when i run suite
its taking devices randomly like sometime test1 runs on emulator and some time on device1

Is there any one facing same issue ?

Hi @Arvind_Patel ,

Sorry for the late response. Have you tried with all the three flags for both the instances like below…?
appium --nodeconfig path\to\nodeconfig1.json -p 4723 -bp 5723 --udid 1stdeviceUdidNum
appium --nodeconfig path\to\nodeconfig2.json -p 4724 -bp 5724 --udid 2nddeviceUdidNum

have a try !!!

Bhaskar.

@bhaskar

Is there any possibility of running a testsuite containing multiple testcases with same appium instance. As when I tried to run a test suite, first testcase ran successfully but failed at second testcase and so on stating A new session cannot be started … BTW I am trying to run 10 testcase in the same IOS simulator.

I have posted this issue here:

1 Like

@bhaskar
Hi Bhaskar,

I am trying to run parallel test on different OS by connecting to selenium Hub.
Here is my scenario:

Hub: On Windows machine
Node1: On same window machine as HUB
Node2: On Mac Machine.

I am trying to run on Android devices connected to both the OS.
I am able to run on Windows but on MAC appium is throwing an error "Unable to load node configuration file to register with grid"

Here is my both Node files:

Node1: {
“capabilities”:
[
{
“browserName”: “Android”,
“version”:“5.1.1”,
“udid”:“052d6d76002e47df”,
“maxInstances”: 1,
“platform”:“ANDROID”,
“deviceName”:“google Nexus 5”
}],
“configuration”:

{
“nodeTimeout”:120,
“port”:4740,
“hubPort”:4444,
“proxy”: “org.openqa.grid.selenium.proxy.DefaultRemoteProxy”,
“url”:“http://127.0.0.1:4740/wd/hub”,
“hub”: “127.0.0.1:4444/grid/register”,
“hubHost”:“127.0.0.1”,
“nodePolling”:2000,
“registerCycle”:10000,
“register”:true,
“cleanUpCycle”:2000,
“timeout”:30000,
“maxSession”:1

Node2: {
“capabilities”:
[
{
“browserName”: “Android”,
“version”:“4.3”,
“udid”:“4df742b317683077”,
“maxInstances”: 1,
“platform”:“ANDROID”,
“deviceName”:“samsung GT-N7100”
}],
“configuration”:

{
“nodeTimeout”:120,
“port”:4728,
“hubPort”:4444,
“proxy”: “org.openqa.grid.selenium.proxy.DefaultRemoteProxy”,
“url”:“http://127.0.0.1:4728/wd/hub”,
“hub”: “10.123.23.123:4444/grid/register”,
“hubHost”:“10.123.23.123”,
“nodePolling”:2000,
“registerCycle”:10000,
“register”:true,
“cleanUpCycle”:2000,
“timeout”:30000,
“maxSession”:1
}
}

By the way, the work we are doing for Appium v1.5 will make it so we will finally be able to have multiple sessions (parallel tests) with just one appium server ^.^

4 Likes

@jonahss Thats really good news… it will save our lot of effort to setup parallel execution :relaxed:

1 Like