Reputation: 1897
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
Upvotes: 0
Views: 243
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.
Below is the result from Edge Web driver.
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