I run the below code to compare simple findElement betwenn WebDriver and RemoteWebDriver.
There is different of more than 25% between the local and remote.
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(
} 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();