The default command line window display behavior is a function, not an error. Many people insist on using the .Close() method to exit the browser window instead of .Quit() . However, this will close the browser, but will not clear all resources, for example, exit the chromedriver.exe instance. Thus, the supporting .NET linker made a conscious decision to make it absolutely clear when the executable works and when not. You can change this behavior using code similar to the following:
Dim service As OpenQA.Selenium.Chrome.ChromeDriverService = OpenQA.Selenium.Chrome.ChromeDriverService.CreateDefaultService() service.HideCommandPromptWindow = True Dim chromeOptions As New OpenQA.Selenium.Chrome.ChromeOptions() chromeOptions.AddExcludedArgument("ignore-certifcate-errors") chromeOptions.AddArgument("test-type") Dim driver As IWebDriver = New ChromeDriver(service, chromeOptions)
It is generally believed that a bad form asks several unrelated questions in a single post on StackOverflow, but as for your second question, you ask: "How do I know when a page is fully loaded using WebDriver?" If so, then the answer will be: "You will not do it." Or rather, the question is pointless when you talk about today's world with JavaScript, AJAX, dynamically-generated DOM support.
If you need to make sure that the element is present on the page before you can interact with it, you can wait for this condition. The support library (in the WebDriver.Support.dll assembly in .NET) contains the WebDriverWait class, designed to provide just that.
You can also try using EventFiringWebDriver , which has a Navigated event. To do this, use the standard VB.NET event processing code ( AddHandler / RemoveHandler ). However, DO NOT associate this .NET binding event with the type of events you receive from the Internet Explorer COM object, such as the DocumentComplete event . This design does not exist in the WebDriver API. The Navigated event occurs only when manually navigating the page (i.e., not by the clicks of an element that causes navigation), and there is no guarantee that any specific DOM event will be fired when the Navigated event Navigated . The code to use will look something like this:
' Assumes you have a sub with a declaration like this: ' Private Sub Navigated(sender As Object, e As WebDriverNavigationEventArgs) Dim driver As IWebDriver = New ChromeDriver(service, chromeOptions) Dim eventDriver As New EventFiringWebDriver(driver) AddHandler eventDriver.Navigated, AddressOf Navigated
Once again, and I canβt stress this enough if you are looking for an event that means "page loaded", "Do Do It It Wrong β’". The right thing is to identify some element of the landing page that will be present and wait until this element is available.