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

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,517 questions
C#
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.
10,464 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,135 questions
{count} votes