RemoteWebDriver performance

258 views
Skip to first unread message

hadar

unread,
May 12, 2015, 3:41:30 AM5/12/15
to seleniu...@googlegroups.com
Hi,

I am running tests using RemoteWebDriver.
I am having 4 nodes connected to hub.
Each node run wit maximun one browser.

From what I see the tests running much slower in this way compare to running the tests on my machine using local WebDriver.

Is this known issue ?
Is there a way to overcome this ?
Is there a limit of the number of nodes ?

Thanks

Shawn Conlin

unread,
May 12, 2015, 4:49:52 PM5/12/15
to seleniu...@googlegroups.com
It is possible that the difference is the result of network lag or that the node systems are significantly slower than your development machine. Are you running your tests in parallel? That is the one way that I know of from using nodes to speed up tests.

hadar

unread,
May 12, 2015, 11:56:16 PM5/12/15
to seleniu...@googlegroups.com
Hi,

Yes,The tests are running in parallel on 4 different vmWare machine.
Is there minimum requirement for the node (Memory/CPU) ?

Thanks

Shawn Conlin

unread,
May 13, 2015, 10:55:48 AM5/13/15
to seleniu...@googlegroups.com
I typically run my nodes using the minimum recommended (not minimum required) for the OS and haven't had any issues.

--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/TyR3oa725wM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/62050e72-f801-4dd2-af71-2a7c288cc470%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

hadar

unread,
May 14, 2015, 4:03:55 PM5/14/15
to seleniu...@googlegroups.com
Hi,

I run the below code to compare simple findElement betwenn WebDriver and RemoteWebDriver.
The server and the node runs on my computer (and also the local ofcourse)
There is different of more than 25% between the local and remote.
Is that expected ?



import java.net.MalformedURLException;
import java.net.URL;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.testng.annotations.Test;

public class PerfCheck {
static {
System.setProperty("webdriver.chrome.driver",
"C:\\Dev\\Selenium\\chromedriver.exe");
}
@Test
public void localdriver() {
WebDriver d = new ChromeDriver();
long start = System.currentTimeMillis();
for(int i = 0;i < 1000; i++) {
WebElement w = d.findElement(By.id("lst-ib"));
}
System.out.println("Local:" + (System.currentTimeMillis() - start));
d.close();
d.quit();
}
@Test
public void remotedriver() {
final DesiredCapabilities cap = DesiredCapabilities.chrome();
WebDriver d = null;
try {
d = new RemoteWebDriver(
new URL("http://127.0.0.1:5555" + "/wd/hub"), cap);
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
long start = System.currentTimeMillis();
for(int i = 0;i < 1000; i++) {
WebElement w = d.findElement(By.id("lst-ib"));
}
System.out.println("Remote:" + (System.currentTimeMillis() - start));
d.close();
d.quit();

sudheerq...@gmail.com

unread,
May 15, 2015, 5:31:10 AM5/15/15
to seleniu...@googlegroups.com
Did you try setting up maxInstances=5 in the command line while registering the node..

Thanks,
Sudheer.

Idan Shay

unread,
May 15, 2015, 9:58:56 AM5/15/15
to seleniu...@googlegroups.com
Hi,

As you can see in the code example I used only node.

Thanks
Idan

--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/TyR3oa725wM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.

Shawn Conlin

unread,
May 15, 2015, 11:25:09 AM5/15/15
to seleniu...@googlegroups.com
I would say that you have too many moving parts to say conclusively where the slowdown is because you are not only introducing additional software, but a network connection and a completely different machine. I would recommend eliminating differences in the machine by doing the following:

Run your tests locally on both machines and compare the times.
Run your tests against  RemoteWebDriver  on both machines with the hub and node on the same machine as the test runner
Run your tests​ against RemoteWebDriver with each machine using the hub and node on the other machine

This will give you enough data to see the differences between direct and remote web driver as well as giving you a basline for each of the machines you are using. I would expect that the last two tests would be slowest since the network is involved.

andrius...@gmail.com

unread,
May 15, 2015, 2:20:53 PM5/15/15
to seleniu...@googlegroups.com
From my experience, using RemoteWebDriver with nodes and hub on different machines, tests runs around twice longer, than running locally on the same machine using FirefoxDriver. I agree, that probably it's because using RemoteWebDriver network is involved. When I discovered that, I was quite disappointed, because I expected to run tests in parallel using grid with many nodes and significantly reduce build time, but the result wasn't very good..

Idan Shay

unread,
May 15, 2015, 2:31:55 PM5/15/15
to seleniu...@googlegroups.com
Hi,

In the test I made I use only one machine.
In first time I use WebDriver (locally) and in the second I use RemoteWebDriver where the server and node was both on the same machine as I run the local WebDriver.

As you can to create the WebDriver I used :
and the node is on this machine also so all run on same machine and there should not be network issue.

Reply all
Reply to author
Forward
0 new messages