I am using ChromeDriver and I would like it to click every button on the page that contains a specific class name.
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
ChromeDriverService chromeDriverService = ChromeDriverService.CreateDefaultService();
chromeDriverService.HideCommandPromptWindow = true;
ChromeOptions options = new ChromeOptions();
options.AddArgument("ignore-certificate-errors");
ChromeDriver driver = new ChromeDriver(chromeDriverService, options);
driver.Url = "https://www.some-url.com";
driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromMilliseconds(2);
I was thinking of something along the lines of:
driver.FindElement(By.ClassName("some-class-name")).Click();
However that only clicks on one button. How could I achieve this to click every button found on the web-page?