Fractal
Fractal

Reputation: 1897

Microsoft Edge Driver (Incorrect XPath behavior for partial @class matches)

Windows 10 Microsoft Edge Version 40.15063.674.0 (15.15063)

An XPath that works fine in Chrome and Firefox is failing in Microsoft Edge.

var filterRow2 = Driver.FindElements(By.XPath("//table//tr[contains(@class,'table-filter')]"));

this find the element when run in Chrome and Firefox but not in Edge. I found posts in the microsoft developer forum discussing the same issue but didn't see anything stating the issue was ever resolved.

https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/4696709/ https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/8516233/


More Information:

Example code which fails in version 15063 enter image description here

Upvotes: 0

Views: 243

Answers (1)

Deepak-MSFT
Deepak-MSFT

Reputation: 11335

I test your 1 line of code with Edge web driver and chrome web driver. (Tested with Edge 44)

 static void Main(string[] args)
{
             // IWebDriver driver = new EdgeDriver();
                IWebDriver driver = new ChromeDriver();

                driver.Navigate().GoToUrl("https://stackoverflow.com/");

                String xpath = "//body[contains(@class, 'home-page new-topbar')]";

                var filterRow2 = driver.FindElements(By.XPath("//table//tr[contains(@class,'table-filter')]"));

                Console.WriteLine(filterRow2.ToString());

                driver.Close();

}

Below is the result from Chrome Web driver.

enter image description here

Below is the result from Edge Web driver.

enter image description here

I suggest you to use the latest updates for MS Edge browser and use latest web driver for Edge may help to fix the issue.

Reference:

Microsoft Edge (Incorrect XPath behavior for partial @class matches)

Let us know, if I misunderstand anything from your above description. I will try to correct myself.

Upvotes: 1

Related Questions