ericmckean / chromedriver

Automatically exported from code.google.com/p/chromedriver
0 stars 0 forks source link

ChromeDriver cannot initialize if there are other chrome opened #1012

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Issue Description:
ChromeDriver cannot initialize if there are other chrome opened. But if I 
closed all chrome windows then it can initialized properly and also run 
properly. 

**Not reproducible on other machine(same version and same code implementation)

OS: Window 7
.NET : 4.0 
Implement on: C#
ChromeDriver V: 2.13
GoogleChrome V: Version 39.0.2171.95 m

Throw message=>
unknown error: Chrome failed to start: crashed
  (Driver info: chromedriver=2.13.307647 (5a7d0541ebc58e69994a6fb2ed930f45261f3c29),platform=Windows NT 6.1 SP1 x86_64)

===========================================================
Steps to reproduce (if relevant, you MUST provide a simplified html page or
link to public site):

1. Open one googleChrome window.
2. Try to run selenium with ChromeDriver, "Fail to initialize"

==Code===
            //Defualt innitialize 
            try
            {
                var options = new ChromeOptions();
                options.AddArguments("start-maximized");
                options.AddArguments("test-type");
                options.AddArgument("new-window");
                driver = new ChromeDriver("../../../Dependencies", options, new TimeSpan(0, 0, 120));
                //Implicit Wait will effect driver for its object instance life
                driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(5));
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                throw;
            }

Original issue reported on code.google.com by nutn...@gmail.com on 9 Jan 2015 at 9:56

GoogleCodeExporter commented 9 years ago

Original comment by andrewch...@chromium.org on 9 Jan 2015 at 8:54

GoogleCodeExporter commented 9 years ago
I don't have any problem. ran smoothly.
my codes as following

       static void Main(string[] args)
        {
            try
            {
                var options = new ChromeOptions();
                options.AddArguments("start-maximized");
                options.AddArguments("test-type");
                options.AddArgument("new-window");
                //ChromeDriver driver = new ChromeDriver("../../../Dependencies", options, new TimeSpan(0, 0, 120));
                ChromeDriver driver = new ChromeDriver(@"c:\Chromium\src\out-dynamic\Debug", options, new TimeSpan(0, 0, 120));
                //Implicit Wait will effect driver for its object instance life
                driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(5));
                //
                //
                driver.Quit();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                throw;
            }
        }

Let me know if it work for you.

Original comment by andrewch...@chromium.org on 20 Jan 2015 at 10:56

GoogleCodeExporter commented 9 years ago
Thank you for your reply. I did try you code (I changed the chromeDriver Path), 
and it's still not working on my machine.

Like i mentioned before that my project can work properly on every other 
machines. So i don't get the reason what is wrong with my machine.

The error throw out the same:
{System.InvalidOperationException: unknown error: Chrome failed to start: 
crashed
  (Driver info: chromedriver=2.13.307647 (5a7d0541ebc58e69994a6fb2ed930f45261f3c29),platform=Windows NT 6.1 SP1 x86_64)

Do you got any idea what would trigger this kind of failure? If all chrome 
browser are closed then it run properly. If there are other chrome browser 
opened then it will crash like i mentioned.

Original comment by nutn...@gmail.com on 22 Jan 2015 at 7:41

Attachments:

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
it shows -  unknown error: Chrome failed to start: crashed
start Chrome manually from command line to see if any problem.

Original comment by andrewch...@chromium.org on 23 Jan 2015 at 6:33

GoogleCodeExporter commented 9 years ago
i can start chrome manually from command line. Is there anyway to get the logs 
or the reason why it is crashing ? 

Original comment by nutn...@gmail.com on 26 Jan 2015 at 6:34

Attachments:

GoogleCodeExporter commented 9 years ago

1. can you do
    chrome.setBinary("C:\\path\\chrome.exe");
to make sure you are launch the same chrome as from chromedirver

2. set the log this way
            System.setProperty("webdriver.chrome.driver", "C:\\Chromium\\src\\out-dynamic\\Debug\\chromedriver.exe");
            System.setProperty("webdriver.chrome.logfile", new File("chromedriver.log").getAbsolutePath());

WebDriver wd = new ChromeDriver(options); 

 provide us your log

Original comment by andrewch...@chromium.org on 26 Jan 2015 at 7:13

GoogleCodeExporter commented 9 years ago

Original comment by samu...@chromium.org on 21 Feb 2015 at 12:18

GoogleCodeExporter commented 9 years ago
are you still have the issue

Original comment by andrewch...@chromium.org on 10 Mar 2015 at 10:55

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Yes, i still have issue. Really sorry for not responding. I didn't see your 
comment on 26 Jan, that why i didn't reply.

I'm implementing the project on .NET C#, I did try to add option like ur 
comment. But there isn't any log created after the application crash.

var options = new ChromeOptions();
options.BinaryLocation = "C:\\Program Files 
(x86)\\Google\\Chrome\\Application\\chrome.exe";
options.AddArguments("start-maximized");
options.AddArgument("new-window");
options.AddArgument("verbose");
options.AddArgument("log-path=D:\\chromedriver.log");
//=>Dependencies contain Chromedriver.exe
driver = new ChromeDriver("../../../Dependencies", options, new TimeSpan(0, 0, 
120));  

Original comment by nutn...@gmail.com on 11 Mar 2015 at 7:52