Ramco Ramco

Ramco Ramco

  • 403
  • 3.1k
  • 445.6k

Video should automatically replay

Apr 9 2024 4:23 PM

Hi

  I have saved Video Duration in a variable. I want once it reaches the end it should restart again & again

Below is the code

await Task.Run(async () =>
                {
                    _driver
                    .Navigate()
                    .GoToUrl($"{BASE_URL}?v={"uhaJ08EUb9A"}");

                    var timeElement = _driver.FindElement(By.XPath(XPATH_TIME));
                    timeValue = timeElement.GetAttribute("innerText");

                    var videoControls = new WebDriverWait(_driver, TimeSpan.FromSeconds(10))
                        .Until(driver => driver.FindElement(By.ClassName("ytp-chrome-controls")));

                    var action = new Actions(_driver);
                    action
                        .MoveToElement(videoControls)
                        .Perform();

                });

Thanks


Answers (5)