ChromeDriver crashes and does not create a session when chrome is already open in selenium-jvm
There are two parts of this problem -
- When a chrome browser is already open and I trigger my selenium-java test case to run against the chrome it doesn't open a new chrome session.
- It uses the existing chrome which is open and starts opening new tabs but still doesn't work.
My driver initialization looks like as below :
System.setProperty("webdriver.chrome.driver", ConfigUtils.getCurrentDirectory()+ Chromefile.getPath());
ChromeOptions options = new ChromeOptions();
//options.addArguments("--headless");
options.addArguments("--no-sandbox");
options.addArguments("start-maximized");
options.addArguments("disable-infobars");
options.addArguments("disable-extensions");
options.setExperimentalOption("useAutomationExtension", false)
driver = new ChromeDriver(options);
I have tried couple of things suggested on Stack Overflow -
Someone described that this is a problem because
chromedriver
cannot spin up another instance of chrome - default profile. So I have added the following line in the above code -
String profile1 = "C:\Users\user_id\Documents\ChromeProfile1\";
options.addArguments("user-data-dir="+profile1);
This was done so that chromedriver
could launch a new profile of chrome. And it does open a new chrome window but didn't navigated to the URL.
As per the official documentation of chromedriver -
By default, ChromeDriver will create a new temporary profile for each
session.
And I never has to do this before. I am not sure why this is not working and what else can I do?
I am using -
Selenium-java version 3.141.1
ChromeDriver version 2.38
Chrome version 70
Windows 10
Please note-
The chrome and chromedriver version I have mentioned above are compatible and working fine when chrome is not already running Also, I can run the same test in headless mode while chrome window is already open.
let me know if you need anymore info. Error I am getting is as below-
Starting ChromeDriver 2.38.552522
(437e6fbedfa8762dec75e2c5b3ddb86763dc9dcb) on port 18020 Only local
connections are allowed. org.openqa.selenium.WebDriverException:
unknown error: Chrome failed to start: crashed (Driver info:
chromedriver=2.38.552522
(437e6fbedfa8762dec75e2c5b3ddb86763dc9dcb),platform=Windows NT
10.0.17134 x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 61.87 seconds Build info:
version: '3.141.5', revision: 'd54ebd709a', time:
'2018-11-06T11:42:16' System info: host: 'XXXX', ip: 'XXXX', os.name:
'Windows 10', os.arch: 'x86', os.version: '10.0', java.version:
'1.8.0_162' Driver info: driver.version: ChromeDriver
selenium google-chrome selenium-webdriver selenium-chromedriver
add a comment |
There are two parts of this problem -
- When a chrome browser is already open and I trigger my selenium-java test case to run against the chrome it doesn't open a new chrome session.
- It uses the existing chrome which is open and starts opening new tabs but still doesn't work.
My driver initialization looks like as below :
System.setProperty("webdriver.chrome.driver", ConfigUtils.getCurrentDirectory()+ Chromefile.getPath());
ChromeOptions options = new ChromeOptions();
//options.addArguments("--headless");
options.addArguments("--no-sandbox");
options.addArguments("start-maximized");
options.addArguments("disable-infobars");
options.addArguments("disable-extensions");
options.setExperimentalOption("useAutomationExtension", false)
driver = new ChromeDriver(options);
I have tried couple of things suggested on Stack Overflow -
Someone described that this is a problem because
chromedriver
cannot spin up another instance of chrome - default profile. So I have added the following line in the above code -
String profile1 = "C:\Users\user_id\Documents\ChromeProfile1\";
options.addArguments("user-data-dir="+profile1);
This was done so that chromedriver
could launch a new profile of chrome. And it does open a new chrome window but didn't navigated to the URL.
As per the official documentation of chromedriver -
By default, ChromeDriver will create a new temporary profile for each
session.
And I never has to do this before. I am not sure why this is not working and what else can I do?
I am using -
Selenium-java version 3.141.1
ChromeDriver version 2.38
Chrome version 70
Windows 10
Please note-
The chrome and chromedriver version I have mentioned above are compatible and working fine when chrome is not already running Also, I can run the same test in headless mode while chrome window is already open.
let me know if you need anymore info. Error I am getting is as below-
Starting ChromeDriver 2.38.552522
(437e6fbedfa8762dec75e2c5b3ddb86763dc9dcb) on port 18020 Only local
connections are allowed. org.openqa.selenium.WebDriverException:
unknown error: Chrome failed to start: crashed (Driver info:
chromedriver=2.38.552522
(437e6fbedfa8762dec75e2c5b3ddb86763dc9dcb),platform=Windows NT
10.0.17134 x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 61.87 seconds Build info:
version: '3.141.5', revision: 'd54ebd709a', time:
'2018-11-06T11:42:16' System info: host: 'XXXX', ip: 'XXXX', os.name:
'Windows 10', os.arch: 'x86', os.version: '10.0', java.version:
'1.8.0_162' Driver info: driver.version: ChromeDriver
selenium google-chrome selenium-webdriver selenium-chromedriver
add a comment |
There are two parts of this problem -
- When a chrome browser is already open and I trigger my selenium-java test case to run against the chrome it doesn't open a new chrome session.
- It uses the existing chrome which is open and starts opening new tabs but still doesn't work.
My driver initialization looks like as below :
System.setProperty("webdriver.chrome.driver", ConfigUtils.getCurrentDirectory()+ Chromefile.getPath());
ChromeOptions options = new ChromeOptions();
//options.addArguments("--headless");
options.addArguments("--no-sandbox");
options.addArguments("start-maximized");
options.addArguments("disable-infobars");
options.addArguments("disable-extensions");
options.setExperimentalOption("useAutomationExtension", false)
driver = new ChromeDriver(options);
I have tried couple of things suggested on Stack Overflow -
Someone described that this is a problem because
chromedriver
cannot spin up another instance of chrome - default profile. So I have added the following line in the above code -
String profile1 = "C:\Users\user_id\Documents\ChromeProfile1\";
options.addArguments("user-data-dir="+profile1);
This was done so that chromedriver
could launch a new profile of chrome. And it does open a new chrome window but didn't navigated to the URL.
As per the official documentation of chromedriver -
By default, ChromeDriver will create a new temporary profile for each
session.
And I never has to do this before. I am not sure why this is not working and what else can I do?
I am using -
Selenium-java version 3.141.1
ChromeDriver version 2.38
Chrome version 70
Windows 10
Please note-
The chrome and chromedriver version I have mentioned above are compatible and working fine when chrome is not already running Also, I can run the same test in headless mode while chrome window is already open.
let me know if you need anymore info. Error I am getting is as below-
Starting ChromeDriver 2.38.552522
(437e6fbedfa8762dec75e2c5b3ddb86763dc9dcb) on port 18020 Only local
connections are allowed. org.openqa.selenium.WebDriverException:
unknown error: Chrome failed to start: crashed (Driver info:
chromedriver=2.38.552522
(437e6fbedfa8762dec75e2c5b3ddb86763dc9dcb),platform=Windows NT
10.0.17134 x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 61.87 seconds Build info:
version: '3.141.5', revision: 'd54ebd709a', time:
'2018-11-06T11:42:16' System info: host: 'XXXX', ip: 'XXXX', os.name:
'Windows 10', os.arch: 'x86', os.version: '10.0', java.version:
'1.8.0_162' Driver info: driver.version: ChromeDriver
selenium google-chrome selenium-webdriver selenium-chromedriver
There are two parts of this problem -
- When a chrome browser is already open and I trigger my selenium-java test case to run against the chrome it doesn't open a new chrome session.
- It uses the existing chrome which is open and starts opening new tabs but still doesn't work.
My driver initialization looks like as below :
System.setProperty("webdriver.chrome.driver", ConfigUtils.getCurrentDirectory()+ Chromefile.getPath());
ChromeOptions options = new ChromeOptions();
//options.addArguments("--headless");
options.addArguments("--no-sandbox");
options.addArguments("start-maximized");
options.addArguments("disable-infobars");
options.addArguments("disable-extensions");
options.setExperimentalOption("useAutomationExtension", false)
driver = new ChromeDriver(options);
I have tried couple of things suggested on Stack Overflow -
Someone described that this is a problem because
chromedriver
cannot spin up another instance of chrome - default profile. So I have added the following line in the above code -
String profile1 = "C:\Users\user_id\Documents\ChromeProfile1\";
options.addArguments("user-data-dir="+profile1);
This was done so that chromedriver
could launch a new profile of chrome. And it does open a new chrome window but didn't navigated to the URL.
As per the official documentation of chromedriver -
By default, ChromeDriver will create a new temporary profile for each
session.
And I never has to do this before. I am not sure why this is not working and what else can I do?
I am using -
Selenium-java version 3.141.1
ChromeDriver version 2.38
Chrome version 70
Windows 10
Please note-
The chrome and chromedriver version I have mentioned above are compatible and working fine when chrome is not already running Also, I can run the same test in headless mode while chrome window is already open.
let me know if you need anymore info. Error I am getting is as below-
Starting ChromeDriver 2.38.552522
(437e6fbedfa8762dec75e2c5b3ddb86763dc9dcb) on port 18020 Only local
connections are allowed. org.openqa.selenium.WebDriverException:
unknown error: Chrome failed to start: crashed (Driver info:
chromedriver=2.38.552522
(437e6fbedfa8762dec75e2c5b3ddb86763dc9dcb),platform=Windows NT
10.0.17134 x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 61.87 seconds Build info:
version: '3.141.5', revision: 'd54ebd709a', time:
'2018-11-06T11:42:16' System info: host: 'XXXX', ip: 'XXXX', os.name:
'Windows 10', os.arch: 'x86', os.version: '10.0', java.version:
'1.8.0_162' Driver info: driver.version: ChromeDriver
selenium google-chrome selenium-webdriver selenium-chromedriver
selenium google-chrome selenium-webdriver selenium-chromedriver
edited Nov 26 '18 at 6:03
NarendraR
3,87361845
3,87361845
asked Nov 25 '18 at 23:41
Galileo123Galileo123
6319
6319
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
ChromeDriver 2.38 only supports Chrome 65 through 67. Please see the release notes at https://chromedriver.storage.googleapis.com/2.38/notes.txt. It may happen to work with some other versions of Chrome under certain conditions, but such usage is unsupported. It is recommended to use ChromeDriver 2.44 with Chrome 70.
I don't see any problems with the code you posted. Hopefully you'll be able to get better results after downloading a newer ChromeDriver.
Nice to see you here. Thanks for your contribution. Hope to see you guiding the community more frequently.
– DebanjanB
Dec 3 '18 at 5:34
On another note, I still don't have a clue why user see ...When a chrome browser is already open and I trigger my selenium-java test case to run against the chrome it doesn't open a new chrome session.... Any suggestions/hints/ideas?
– DebanjanB
Dec 3 '18 at 5:39
By default, ChromeDriver would always start a new Chrome session, even if Chrome is already running. Some options, however, can cause problems if used incorrectly.
– John Chen
Dec 6 '18 at 6:22
For example, --user-data-dir and --remote-debugging-port are options that need to be used carefully.
– John Chen
Dec 6 '18 at 6:23
Seems I missed to put my actual query in my previous comment. I meant to ask ...When a chrome browser is already open and I trigger my selenium-java test case to run against the chrome it doesn't open a new chrome session and It uses the existing chrome which is open .... I am clueless here.
– DebanjanB
Dec 6 '18 at 6:27
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53473122%2fchromedriver-crashes-and-does-not-create-a-session-when-chrome-is-already-open-i%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
ChromeDriver 2.38 only supports Chrome 65 through 67. Please see the release notes at https://chromedriver.storage.googleapis.com/2.38/notes.txt. It may happen to work with some other versions of Chrome under certain conditions, but such usage is unsupported. It is recommended to use ChromeDriver 2.44 with Chrome 70.
I don't see any problems with the code you posted. Hopefully you'll be able to get better results after downloading a newer ChromeDriver.
Nice to see you here. Thanks for your contribution. Hope to see you guiding the community more frequently.
– DebanjanB
Dec 3 '18 at 5:34
On another note, I still don't have a clue why user see ...When a chrome browser is already open and I trigger my selenium-java test case to run against the chrome it doesn't open a new chrome session.... Any suggestions/hints/ideas?
– DebanjanB
Dec 3 '18 at 5:39
By default, ChromeDriver would always start a new Chrome session, even if Chrome is already running. Some options, however, can cause problems if used incorrectly.
– John Chen
Dec 6 '18 at 6:22
For example, --user-data-dir and --remote-debugging-port are options that need to be used carefully.
– John Chen
Dec 6 '18 at 6:23
Seems I missed to put my actual query in my previous comment. I meant to ask ...When a chrome browser is already open and I trigger my selenium-java test case to run against the chrome it doesn't open a new chrome session and It uses the existing chrome which is open .... I am clueless here.
– DebanjanB
Dec 6 '18 at 6:27
add a comment |
ChromeDriver 2.38 only supports Chrome 65 through 67. Please see the release notes at https://chromedriver.storage.googleapis.com/2.38/notes.txt. It may happen to work with some other versions of Chrome under certain conditions, but such usage is unsupported. It is recommended to use ChromeDriver 2.44 with Chrome 70.
I don't see any problems with the code you posted. Hopefully you'll be able to get better results after downloading a newer ChromeDriver.
Nice to see you here. Thanks for your contribution. Hope to see you guiding the community more frequently.
– DebanjanB
Dec 3 '18 at 5:34
On another note, I still don't have a clue why user see ...When a chrome browser is already open and I trigger my selenium-java test case to run against the chrome it doesn't open a new chrome session.... Any suggestions/hints/ideas?
– DebanjanB
Dec 3 '18 at 5:39
By default, ChromeDriver would always start a new Chrome session, even if Chrome is already running. Some options, however, can cause problems if used incorrectly.
– John Chen
Dec 6 '18 at 6:22
For example, --user-data-dir and --remote-debugging-port are options that need to be used carefully.
– John Chen
Dec 6 '18 at 6:23
Seems I missed to put my actual query in my previous comment. I meant to ask ...When a chrome browser is already open and I trigger my selenium-java test case to run against the chrome it doesn't open a new chrome session and It uses the existing chrome which is open .... I am clueless here.
– DebanjanB
Dec 6 '18 at 6:27
add a comment |
ChromeDriver 2.38 only supports Chrome 65 through 67. Please see the release notes at https://chromedriver.storage.googleapis.com/2.38/notes.txt. It may happen to work with some other versions of Chrome under certain conditions, but such usage is unsupported. It is recommended to use ChromeDriver 2.44 with Chrome 70.
I don't see any problems with the code you posted. Hopefully you'll be able to get better results after downloading a newer ChromeDriver.
ChromeDriver 2.38 only supports Chrome 65 through 67. Please see the release notes at https://chromedriver.storage.googleapis.com/2.38/notes.txt. It may happen to work with some other versions of Chrome under certain conditions, but such usage is unsupported. It is recommended to use ChromeDriver 2.44 with Chrome 70.
I don't see any problems with the code you posted. Hopefully you'll be able to get better results after downloading a newer ChromeDriver.
answered Dec 3 '18 at 2:13
John ChenJohn Chen
412
412
Nice to see you here. Thanks for your contribution. Hope to see you guiding the community more frequently.
– DebanjanB
Dec 3 '18 at 5:34
On another note, I still don't have a clue why user see ...When a chrome browser is already open and I trigger my selenium-java test case to run against the chrome it doesn't open a new chrome session.... Any suggestions/hints/ideas?
– DebanjanB
Dec 3 '18 at 5:39
By default, ChromeDriver would always start a new Chrome session, even if Chrome is already running. Some options, however, can cause problems if used incorrectly.
– John Chen
Dec 6 '18 at 6:22
For example, --user-data-dir and --remote-debugging-port are options that need to be used carefully.
– John Chen
Dec 6 '18 at 6:23
Seems I missed to put my actual query in my previous comment. I meant to ask ...When a chrome browser is already open and I trigger my selenium-java test case to run against the chrome it doesn't open a new chrome session and It uses the existing chrome which is open .... I am clueless here.
– DebanjanB
Dec 6 '18 at 6:27
add a comment |
Nice to see you here. Thanks for your contribution. Hope to see you guiding the community more frequently.
– DebanjanB
Dec 3 '18 at 5:34
On another note, I still don't have a clue why user see ...When a chrome browser is already open and I trigger my selenium-java test case to run against the chrome it doesn't open a new chrome session.... Any suggestions/hints/ideas?
– DebanjanB
Dec 3 '18 at 5:39
By default, ChromeDriver would always start a new Chrome session, even if Chrome is already running. Some options, however, can cause problems if used incorrectly.
– John Chen
Dec 6 '18 at 6:22
For example, --user-data-dir and --remote-debugging-port are options that need to be used carefully.
– John Chen
Dec 6 '18 at 6:23
Seems I missed to put my actual query in my previous comment. I meant to ask ...When a chrome browser is already open and I trigger my selenium-java test case to run against the chrome it doesn't open a new chrome session and It uses the existing chrome which is open .... I am clueless here.
– DebanjanB
Dec 6 '18 at 6:27
Nice to see you here. Thanks for your contribution. Hope to see you guiding the community more frequently.
– DebanjanB
Dec 3 '18 at 5:34
Nice to see you here. Thanks for your contribution. Hope to see you guiding the community more frequently.
– DebanjanB
Dec 3 '18 at 5:34
On another note, I still don't have a clue why user see ...When a chrome browser is already open and I trigger my selenium-java test case to run against the chrome it doesn't open a new chrome session.... Any suggestions/hints/ideas?
– DebanjanB
Dec 3 '18 at 5:39
On another note, I still don't have a clue why user see ...When a chrome browser is already open and I trigger my selenium-java test case to run against the chrome it doesn't open a new chrome session.... Any suggestions/hints/ideas?
– DebanjanB
Dec 3 '18 at 5:39
By default, ChromeDriver would always start a new Chrome session, even if Chrome is already running. Some options, however, can cause problems if used incorrectly.
– John Chen
Dec 6 '18 at 6:22
By default, ChromeDriver would always start a new Chrome session, even if Chrome is already running. Some options, however, can cause problems if used incorrectly.
– John Chen
Dec 6 '18 at 6:22
For example, --user-data-dir and --remote-debugging-port are options that need to be used carefully.
– John Chen
Dec 6 '18 at 6:23
For example, --user-data-dir and --remote-debugging-port are options that need to be used carefully.
– John Chen
Dec 6 '18 at 6:23
Seems I missed to put my actual query in my previous comment. I meant to ask ...When a chrome browser is already open and I trigger my selenium-java test case to run against the chrome it doesn't open a new chrome session and It uses the existing chrome which is open .... I am clueless here.
– DebanjanB
Dec 6 '18 at 6:27
Seems I missed to put my actual query in my previous comment. I meant to ask ...When a chrome browser is already open and I trigger my selenium-java test case to run against the chrome it doesn't open a new chrome session and It uses the existing chrome which is open .... I am clueless here.
– DebanjanB
Dec 6 '18 at 6:27
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53473122%2fchromedriver-crashes-and-does-not-create-a-session-when-chrome-is-already-open-i%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown