How to count Id's in UI page records in c# selenium

Rakesh kumar 106 Reputation points
2022-04-08T19:38:33.877+00:00

Hi
How to count Id's in UI page records in c# selenium. I have try it different ways am not able to count the records.

                            IList<IWebElement> webElements = driver.FindElements(By.XPath("/html/body/div/div/div[1]/div[2]/div/div/div/div/div/div[1]/div/div/div/div/div/div/div[1]/div[2]/div/div/div/div[2]/div/div[2]/div[1]/div[2]/div[2]/div/div[1]/div/div[1]/div"));  
                            int NumberOfItems = webElements.Count;  
                            for (int j = 0; j < NumberOfItems; j++)  
                            {  
                                  
                            }  

191481-image.png
191376-image.png

Developer technologies | .NET | .NET Runtime
Developer technologies | .NET | Other
Developer technologies | C#
Developer technologies | C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.