ChrisK
ChrisK

Reputation: 31

Selecting a specific node on selenium grid2 to run tests

Let's say I have two android emulators attached to my selenium grid2. One is a tablet emulator and one is a mobile emulator. Currently, if I specify to run my tests on android, it appears to just choose one randomly.

If I would like to specifically select the tablet instead of the mobile emulator on the grid, is there a way to accomplish this?

EDIT: These two emulators are running on the same machine.

Upvotes: 3

Views: 4038

Answers (2)

jclark978
jclark978

Reputation: 23

I had this problem as well. I found this while researching it. You basically use the "applicationName" tag to give each node a unique ID. Then when you specify your DesiredCapabilities object you can add that tag to the object. There is a more thorough explanation in the link:

https://groups.google.com/forum/#!topic/selenium-users/PRsEBcbpNlM

Full disclosure: I'm a selenium newbie, and am still having some other troubles setting up my grid so I haven't had a chance to test this out yet. Hope this helps!

Upvotes: 2

user2932876
user2932876

Reputation: 332

Try to set some tags that identify the two nodes. This example is used for my website testing.

Lets say I have 2 servers, one for safari and one for firefox. I will add the first tag when starting the safari server and the second for firefox server.

-browser  browserName=safari,version=5.1.7,platform=WINDOWS,maxInstances=5

-browser browserName=firefox,version=24.0,platform=WINDOWS,maxInstances=5

This line of code is added to specify which server I will use to run the test.

 var cap = new DesiredCapabilities("firefox", "24.0", new Platform(PlatformType.Windows));

Upvotes: 1

Related Questions