Processing in Webdriver using Chromeoptions

I encountered a bug in chrome, which is "You are using the unsupported command line flag -Ignore-Certificate-Errors. Resilience and security will suffer." for my below selenium code.

Public Sub key() Dim selenium As New SeleniumWrapper.WebDriver selenium.Start "chrome", "https://google.com/" selenium.stop End Sub 

I searched for the same error solution in the following link.

http://www.abodeqa.com/tag/how-to-remove-you-are-using-an-unsupported-command-line-flag-ignore-certificate-errors-stability-and-security-will-suffer/

Please explain how I can apply the mention of the answer in the link above to my VBA code.

+5
source share
1 answer

I could not find documentation for SeleniumWrapper. So, I assumed that SeleniumWrapper.WebDriver.Start does not handle ChromeOptions-related arguments.

If the above assumption is true, you cannot apply this solution in C # .

Instead, you can try the following: (I referenced this )

 Imports OpenQA.Selenium Imports OpenQA.Selenium.Chrome ... ... Public Sub key() Dim service As OpenQA.Selenium.Chrome.ChromeDriverService = OpenQA.Selenium.Chrome.ChromeDriverService.CreateDefaultService() 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) driver.Navigate().GoToUrl("https://google.com/") driver.Quit() End Sub 

I added a couple of lines from my experience with Selenium in C #.

Please indicate where SeleniumWrapper with its documentation is to determine if ChromeOptions can / cannot be set for SeleniumWrapper .

+2
source

Source: https://habr.com/ru/post/1269516/


All Articles