Ramco Ramco

Ramco Ramco

  • 419
  • 3.4k
  • 547.8k

OpenQA.Selenium.WebDriverArgumentException 'invalid argument

Aug 4 2024 5:58 AM

Hi

   I am getting above error

static async Task SingleVideo0()
        {
            {
                using (IWebDriver driver = new ChromeDriver())
                {
                    driver.Navigate().GoToUrl("google.com");

                    WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(10));

                    
                    var playButtons = wait.Until(_driver => _driver.FindElements(By.ClassName("video-play-button")));

                    foreach (var playButton in playButtons)
                    {
                        playButton.Click();
                        System.Threading.Thread.Sleep(2000); 
                    }
                }
            }
        }

Thanks


Answers (1)