I have this html. I am trying to count total number of li elements inside the ul element. Even though there are 20 li elements but DOM shows less than 20.
<ul class="a-pagination">
<li class="a-disabled">←<span class="a-letter-space"></span><span class="a-letter-space"></span>Previous</li>
<li class="a-selected"><a href="ff" aria-current="page">1</a></li>
<li class="a-normal"><a href="www">2</a></li>
<li class="a-normal"><a href="ddddddddddd">3</a></li>
<li class="a-disabled" aria-disabled="true">...</li>
<li class="a-disabled" aria-disabled="true">20</li>
<li class="a-last"><a href="/">Next<span class="a-letter-space"></span><span class="a-letter-space"></span>→</a></li>
</ul>
Selenium should count the li elements inside the ul class because there are other li elements outside the ul class.
I have this:
List<WebElement> list1 = driver.findElements("not sure what will go here");
System.out.println("\nsize" + list1.size() );
What should be the locator to find the total li elements under the ul class? It should return the value of 20.