user755620
user755620

Reputation: 35

How to launch a browser on a specific computer when using selenium webdriver?

I have started a selenium server hub on a linux computer, and two selenium nodes, one on windows xp and the other on windows 7. Both nodes are registered to the hub and both of them have firefox, chrome and ie.

How can I specify the IP address to tell the the selenium server, that only the browser of the computer with that specific IP should be started? For example, I want to test a web application with firefox only in windows xp, not windows 7. How can I configure the webdriver capabilities, so that only firefox in windows xp will be started?

Thanks in advance.

Upvotes: 0

Views: 391

Answers (1)

me_digvijay
me_digvijay

Reputation: 5492

All the webdriver capabilities are setup in the script. In the script you can specify what browser and operating system you want to use. The most common way is the setCapabilitiy()

DesiredCapabilities cap = DesiredCapabilities.firefox();
cap.setBrowserName("firefox");
cap.setCapability("platform", "WINDOWS XP");

The only thing you cannot specify is the ip address of the node. It is seleniums job to choose any available configuration for your test.

If you want to separate the capabilities from the scripts then you can specify them in a separate json or xml file and load them when you start your tests.

Upvotes: 3

Related Questions