SafariDriver throws webdriver exception with empty message when running selenium test in Safari Browser (Monterey version)

87 Views Asked by At

Here's my code

public static By headers = By.CssSelector("div[class*=hero-component] h1");

public int getHomePageHeaders() {

     try
        {
             return webDriver.FindElements(headers).Count;
        }
     catch (Exception e)
        {
            return 0;
        }

    }

Other details: My tests are working properly on Chrome, Firefox, Edge and on iPhone12 but it fails on Safari.

I am using Selenium Webdriver (version 4.3.0)

Screenshot of the error: QuickWatch

0

There are 0 best solutions below