Issue with multiple instances of ChromeDriver in Selenium-Webdriver environment

16,602 views
Skip to first unread message

lindsa...@gmail.com

unread,
Apr 14, 2014, 9:13:35 AM4/14/14
to chromedri...@googlegroups.com, lindsay...@clev.frb.org
My company uses Selenium for automated testing and currently, our tests take 3-4 hours to run. Chrome is the fastest browser, but even so, it takes hours.

We are trying to run multiple instances of Chrome on the SAME machine so we can divide the tests into groups to run simultaneously. For example:

150 tests total
Start chrome1 running first 50
Start chrome2 running next 50
Start chrome3 running last 50

All browsers running at the same time.

I create two instances of ChromeDriver. Each ChromeDriver starts a single instance of Chrome in a UNIQUE profile. The first Chrome window starts up and begins running tests just fine.

The second window appears but does nothing. Examination of verbose logging shows the second window is unable to connect to the DevTools of the second browser.

I know running multiple instances simultaneously was possible in prior versions of Chrome (I believe 29 was the last one that people had luck with.) Due to IT constraints, it will be difficult to run multiple VMs on a machine and using Selenium Grid.

We MUST run multiple instances on a single machine but nothing we've tried has worked.

Is this even still possible? If not, is there any way to get Chrome 29 offline installer so we can run the previous version and see if that works?

Thanks in advance!

Shuotao Gao

unread,
Apr 14, 2014, 11:05:02 PM4/14/14
to lindsa...@gmail.com, chromedri...@googlegroups.com, lindsay...@clev.frb.org
Chromedriver2 should support running multiple instances simultaneously.

Would you mind going through the verbose logging of both chromedriver instances and checking if the two browser instances are started with the same remote-debugging-port?



--
You received this message because you are subscribed to the Google Groups "ChromeDriver Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromedriver-us...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

lindsa...@gmail.com

unread,
Apr 15, 2014, 7:34:54 AM4/15/14
to chromedri...@googlegroups.com, lindsay...@clev.frb.org
I tried setting the remote-debugging-port but was unable to get the option to register correctly. They were running on 2 different ports. We do not have admin access on our work machines, is this needed?

Thanks for yiyr response!

lindsa...@gmail.com

unread,
Apr 15, 2014, 9:09:22 AM4/15/14
to chromedri...@googlegroups.com, lindsay...@clev.frb.org, lindsa...@gmail.com
To be more clear, when I try to start two instances of Chrome with different remote-debugging-ports I see the following:

Start chrome.exe --profile-directory=Default --remote-debugging-port=12345
Start chrome.exe --profile-directory=Foo --remote-debugging-port=67890

Navigate to 127.0.0.1:12345 and verify page is found
Navigate to 127.0.0.1:67890 and page is not found

Thank you!

businesso...@gmail.com

unread,
Aug 20, 2017, 10:32:07 PM8/20/17
to ChromeDriver Users, lindsay...@clev.frb.org, lindsa...@gmail.com

Hi, Did you find the solution of how to run multiple instances of chromedriver.exe ?

oleg.a...@intexsys.lv

unread,
Nov 29, 2017, 5:31:34 PM11/29/17
to ChromeDriver Users
It was surprise for me when I was able to run multiple instances of chrome using single chromedriver, it worked on Windows.

geis...@gmail.com

unread,
Dec 3, 2017, 11:08:11 PM12/3/17
to ChromeDriver Users
I often run 5 to 7 instances of chromedriver on one machine as I have multiple platforms to test on. I have over 1600 GUI tests and they take between 6.5 to 8.5 hours each. These are run against a Web GUI on an embedded host.

Here is my env:
Linux Dist Ubuntu 16.04.3 LTS
Linux Kernel 4.4.0-97-generic
Git commit eb4eb02
Virtualenv 15.0.1
Python 2.7.12
RF 3.0.2
RF Selenium 3.0.0
Selenium 3.8.0
Requests 2.18.4
EasySNMP 0.2.5
Poster 0.8.1
Chome 61.0.3163.100
Chrome Webdriver 2.33.506092

musaf...@gmail.com

unread,
Dec 4, 2017, 1:43:53 AM12/4/17
to ChromeDriver Users

It should be be very much possible ...I always open 3 browser simulateneosly on my vm machine... creating unique chrome profle is good.... but it would be worth creating the profile folder fresh for each browser driver instance...

like
you can have a root folder like
'chrome'

then
chrome/profile1
chrome/profile2
chrome/profile3 etc for each driver instance...

make sure to delete the chrome folder in your @beforeSuite or something... in that case it will always be a fresh chrome instance for the tests ....

smkum...@gmail.com

unread,
Jan 17, 2018, 6:22:38 AM1/17/18
to ChromeDriver Users
Hi,

Can you please guide how to achieve multiple chrome driver instances gets launch in parallel.

Since I need to automate two web applications in parallel.

I have separate testng.xml files for each application and common class for launching Chrome Browser.

Result : Two browsers were launched, but the actions gets override in the single browser itself, and the blank page displayed in another browser.

John Chen

unread,
Jan 17, 2018, 10:34:02 AM1/17/18
to smkum...@gmail.com, ChromeDriver Users
My recommendation is not to start multiple instances simultaneously. Start an instance, let it fully initialize, before starting the second instance, and wait for it to initialize before starting the third instance, and so on. Then you can use all instances in parallel.

--
You received this message because you are subscribed to the Google Groups "ChromeDriver Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromedriver-users+unsub...@googlegroups.com.

smkum...@gmail.com

unread,
Jan 18, 2018, 12:00:08 AM1/18/18
to ChromeDriver Users
Can you please help me how to achieve this scenario..!!! Since I have referred so many sites, people have posted only test methods in Parallel but not the XML suite files.

saisre...@gmail.com

unread,
Jan 28, 2018, 11:12:11 AM1/28/18
to ChromeDriver Users
Hi,

System/OS: MacOS, Selenium v3.5.2

My chrome is up to date, Chrome Version 64.0.3282.119 (Official Build) (64-bit) . Still, Throwing following/same( org.openqa.selenium.WebDriverException) and also not clicking on "PIZZA" link when running below script

Script:

package com.restaurant.pizzahut;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;

public class PizzaSelection {
public static void main(String args[]) throws InterruptedException
{
WebDriver driver=null;

System.setProperty("webdriver.driver.chrome", "/Users/saisreebhagi/Downloads/");
driver = new ChromeDriver();

driver.get("https://online.pizzahut.co.in/");
driver.findElement(By.xpath("//*[contains(text(),'Pizza')]")).click();
Thread.sleep(5000);
driver.quit();
}
}

Issue :
Starting ChromeDriver 2.27.440174 (e97a722caafc2d3a8b807ee115bfb307f7d2cfd9) on port 27656
Only local connections are allowed.
Jan 28, 2018 8:55:14 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: OSS
Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: missing or invalid 'entry.level'
(Session info: chrome=64.0.3282.119)
(Driver info: chromedriver=2.27.440174 (e97a722caafc2d3a8b807ee115bfb307f7d2cfd9),platform=Mac OS X 10.10.5 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 0 milliseconds
Build info: version: '3.5.2', revision: '10229a9020', time: '2017-08-21T17:54:21.164Z'
System info: host: 'saisrees-MacBook-Pro.local', ip: 'fd50:680a:d68a:f600:ac5c:4f87:95f2:e9c', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.10.5', java.version: '1.8.0_45'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.27.440174 (e97a722caafc2d3a8b807ee115bfb307f7d2cfd9), userDataDir=/var/folders/fx/rxp1wzx91pl4vvkv8qjgxwyh0000gn/T/.org.chromium.Chromium.Qje7Uv}, takesHeapSnapshot=true, pageLoadStrategy=normal, unhandledPromptBehavior=, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=64.0.3282.119, platform=MAC, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true, unexpectedAlertBehaviour=}]
Session ID: 3549735b35c1dbc3ce65378da02fcdc4


at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:215)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:167)
at org.openqa.selenium.remote.http.JsonHttpResponseCodec.reconstructValue(JsonHttpResponseCodec.java:40)
at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:82)
at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:45)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:164)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:641)
at org.openqa.selenium.remote.RemoteWebDriver.get(RemoteWebDriver.java:368)
at com.restaurant.pizzahut.PizzaSelection.main(PizzaSelection.java:19)
Could you please let me know where it;s going wrong?

Thank you,
Siri

minhaj....@gmail.com

unread,
Feb 12, 2018, 1:29:43 AM2/12/18
to ChromeDriver Users

I am new in automation. I have try to open multiple chrome driver at same time. But I can not open multiple browser at same time. Would you please tell me how to Start chrome1, chrome2 and chrome3 at same time?

Message has been deleted

Reshma Nadaf

unread,
May 28, 2022, 4:43:33 AM5/28/22
to ChromeDriver Users
@John Chen
can u please let me know how to achieve this scenarios as u have mentioned : wait for  instance to get fully initialize and then start the next instance. My sessions that are launched at start of the test are getting killed as the instances are getting launched immediately one after the other
Reply all
Reply to author
Forward
0 new messages