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

Rakesh kumar 106 Reputation points

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++)  


.NET Standard
.NET Standard
A formal specification of .NET APIs that are available on multiple .NET implementations.
504 questions
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.
8,138 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: The period of time during which a program is being executed in a computer.
996 questions
{count} votes