A
A
Aricce2020-03-04 11:47:39
Parsing
Aricce, 2020-03-04 11:47:39

Why is Selenium not opening url from WinForms?

I'm trying to do the simplest action: open a browser, go to Google.

var options = new ChromeOptions();
options.AddArgument("no-sandbox");
ChromeDriver chrome= new ChromeDriver(options);
chrome.Navigate().GoToUrl("http://www.google.com/");

Everything, all code.
If you create a console application project, then everything works fine.
If you create a Windows Forms project with a button and enter the same code into the button, the browser opens, but does not follow the link, just an empty data window and messages:
Thread 0x3680 exited with code 0 (0x0).
Thread 0x28fc exited with code 0 (0x0).
Thread 0x49c exited with code 0 (0x0).
Thread 0x24a8 exited with code 0 (0x0).
Thread 0x51b4 exited with code 0 (0x0).

Neither Chrome nor Firefox.
And in that and in that project the same using, the same code, the same versions of drivers and selenium.
Tried to enter into method Load of the form, nothing changes.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Aricce, 2020-03-04
@Aricce

The answer turned out to be simple - you need to downgrade from 4.0.0 alpha to stable

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question