Currently, I am attempting to loop through the <li>
items within a <ul>
object using Selenium with C#. As a newcomer to this, I am exploring ways to simplify the coding process for my testing project.
Below is a snippet of the HTML code that I am working with and I am interested in accessing the links within...
<ul class="list-menu">
<li>
<ul>
<li><a class="head" href="/seramik-banyo-urunleri">Seramik Banyo Ürünleri</a></li>
<li><a href="/seramik-banyo-urunleri/lavabo">Lavabo</a></li>
<li><a href="/seramik-banyo-urunleri/klozet">Klozet</a></li>
The C# code I have written is as follows:
IList<IWebElement> results = driver.FindElements(By.XPath("//div[@class='list-menu']/li/lu/li"));
However, this code is not returning the links. What steps should I take to resolve this issue?