Using ChromeOptions to Manage Webdriver Execution

I encountered a problem in Chrome where I received an error message "You Are Using An Unsupported Command-Line Flag –Ignore-Certificate-Errors. Stability And Security Will Suffer." when running my Selenium code as shown below.

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

To resolve this error, I found a solution on the following link:

I would appreciate it if you could explain how to implement the suggestion from the link above into my VBA code.

Answer №1

After searching extensively, there appears to be a lack of documentation available for SeleniumWrapper. Due to this, I made the assumption that SeleniumWrapper.WebDriver.Start does not support any arguments related to 'ChromeOptions'.

If my assumption is accurate, then the solution provided in C# might not work as expected. You can try an alternative approach based on suggestions found here.

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 have included some additional lines based on my own experiences with running Selenium in C#.

Please share any resources or documentation related to SeleniumWrapper in order to ascertain whether setting ChromeOptions is feasible with SeleniumWrapper.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Selenium with Python can be used to perform right-click actions on web

I am currently having difficulty in figuring out the correct way to execute a right click. Below is an example of my code: click_Menu = driver.find_element_by_id("Menu") print(click_Menu.text) action.move_to_element(click_Menu) action.context_cl ...

Exploring the web with Python and Selenium for data retrieval

I'm currently working on a web scraping project where I need to extract data from a website that has a 'load-more' button in order to view the next 50 records. It's quite tedious as I have to keep clicking until all records are loaded. ...

To choose an item from the context menu with Selenium, typing in sendKeys isn't effective

When attempting to select an option from a context menu, using sendKeys(Keys.ARROW_DOWN) has not been effective. Instead of navigating the context menu, it simply scrolls the page up and down, leaving the menu open. Actions action = new Actions(driver); a ...

Identify and enumerate the actionable components within a web page

I need assistance developing a Java function that can identify and return the count of interactive objects on a webpage that trigger an action when clicked, but excluding hyperlinks. Examples include buttons, image buttons, etc. Does anyone have any sugge ...

A step-by-step guide on fetching multiple iframe contents simultaneously with Selenium in Java

Today, I am facing an interesting challenge. I need to extract the page source of a webpage that includes an iframe. Surprisingly, when using the PhantomJSDriver with the code snippet below, I am only able to retrieve either the page content or the iframe ...

Upon loading a webpage using selenium, it navigates to the end but fails to retrieve all elements housed within the div

Looking to scrape all the product links from this website: . The page only loads 30 out of 100 products initially, and the rest load when clicking somewhere on the page. How can I retrieve all the product links? Any help is appreciated! from selenium im ...

How does Selenium interact with a web page to click on an element from a technical standpoint?

Providing context in hopes of finding an alternative solution to a larger issue. Situation Overview I am leading the development of a test automation framework for a web application that utilizes Web Components. The challenge arises when testing on Inter ...

Obtain all the selection choices in a dropdown list using Selenium

Although I have come across similar questions, this one is distinct in its simplicity. Unlike other queries that involve iterating over options in a loop, my question revolves around the usage of the getOptions() method mentioned in Selenium documentation. ...

Verifying the date displayed using Java in Selenium

I am attempting to retrieve the date in a specific format to validate if it follows MM/dd/yyyy HH:mm. I've attempted: element.getAttribute("value") but it returns "yyyy-MM-ddTHH:mm" which does not match the UI display. Furthermor ...

Issue encountered with Selenium and Python: TypeError is raised due to multiple values being passed for the 'executable_path' argument in the __init__() function

Error is: TypeError: __init__() got multiple values for argument 'executable_path' I'm having trouble pinpointing the issue. chrome_options = Options() #line 8 chrome_options.add_argument('--headless') #line 9 chrome_options.add ...

Having trouble locating an element using the By.name method in Appium within a dropdown menu that includes a search list

Just starting out on Appium and trying to find an element By.name. When searching from a list, I am getting results of search text matching, but it's not clicking the exact name matching element or any element from the list. It might be trying to clic ...

The titles and view counts of YouTube videos are not displayed

I am currently working on a project to extract and print the title and view count of each video from different YouTube channels listed in my urls. I encountered an issue where it only displayed results for one channel (https://www.youtube.com/c/TuckerBud ...

Selenium - incapability to select the subsequent page

I'm experiencing difficulties with clicking the next button (>) and repeating this process until reaching the last page. Despite researching similar issues, I have been unable to identify what's causing my code to malfunction. Below is the co ...

Interactive mouse hover feature implemented with Selenium WebDriver

When I attempt to hover my mouse over an image icon, a dropdown list should appear and then I want to click on the first option from that list. However, none of the methods I have tried so far seem to be working for me. Can you please suggest another appro ...

Using Python Selenium to interact with dynamic-labeled elements

Being a Python novice, I have just one month of experience. While attempting to scrape a webpage, I can handle and interact with most elements except for two with dynamic labels. The HTML snippet from the source page is shown below: <span class="a- ...

Running Selenium ChromeDriver as a daemon and deploying it: A comprehensive guide

After successfully setting up the latest version of Selenium Server, ChromeDriver, and Chrome on a headless Debian 7 VM with manual running through Screen and Xvfb, I am now looking to transfer this setup to a production Ubuntu 12.04 VM. For security reaso ...

Selenium's SendKeys function fails to execute when the computer is locked

When filling a date in a text box using Python 3.9.5 and Selenium 4.1.0 with Microsoft Edge 98.0.1108.43 on Windows 10, I utilize the following code: #element is the web element I want to fill element = "element_name" date = driver.find_element(B ...

Encountered an obstacle while running some Java code using Selenium

To begin, you will need to import the following two packages: org.openqa.selenium.*- includes the WebDriver class required to create a new browser with a specific driver org.openqa.selenium.firefox.FirefoxDriver - includes the FirefoxDriver class needed t ...

Obtain the text that is shown for an input field

My website is currently utilizing Angular Material, which is causing the text format in my type='time' input field to change. I am looking for a way to verify this text, but none of the methods I have tried give me the actual displayed text. I a ...

Searching for a specific element using XPath in Selenium

Currently, I am working on mastering the art of web scraping by following this insightful tutorial. My goal is to create a webscraper that can fetch job listings efficiently. However, I have hit a roadblock while trying to extract the links for individual ...