<div id="selected">
<ul>
<li>29</li>
<li>16</li>
<li>5</li>
<li>8</li>
<li>10</li>
<li>7</li>
</ul>
</div>
I want to count the total number of "li" elements in "ul". How is that possible using nUnit, Selenium?
First of all, welcome to SO. KunduK is correct though. When you ask questions, please let everyone know what you have attempted and or researched to try and find the answer and what you are stuck with. Questions like this have been asked many times on here.
You can get a count on these elements by using FindElements.
var count = Driver.FindElements(By.XPath("//div[@id='selected']//li")).Count();
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments