I’m trying to check that a filter works by ensuring that every row of a table contains the correct value in one of it’s cells. The xPath I have is the following:
var tableBody = testDriver.AwaitElement(By.CssSelector("tbody"));
var xPath = "//td[contains(@data-kendo-grid-column-index, '13')]/span/span[1]/span[not(contains(text(),'" + resourceId + "'))]";
var elements = tableBody.FindElements(By.XPath(xPath));
I am using C# and xUnit to write me test with Selenium and running it on Browserstack with Chrome Latest.
When debugging, the elements list returns 33 items, which is the total number of rows in the table. But I am expecting it to return 0. If I navigate to the page in chrome and open the developer tools and paste in the full string
//td[contains(@data-kendo-grid-column-index, '13')]/span/span[1]/span[not(contains(text(),'TEXT TO FIND'))]
Since this isn’t working, I navigated to the page in Chrome directly, and edited the first row in the dev tools to have the Inner text of for “TEXT TO NOT FIND”. Then I search using the dev tools and get 1 result as I would expect.
So is this an issue with what I’m looking for, or does it need to be done differently in selenium, or is it an issue with the setup of browserstack?
Cheers
0