I have the following element:
<ol class="day-tabs">
<li class="current"><a href="date1.html">a</a></li>
<li class=""><a href="date2.html">b</a></li>
<li class=""><a href="date3.html">c</a></li>
</ol>
As you may see, only the first list item has a class definition. What I need is to go to the n-th item in the list.
So it is not a problem to do:
WebElement days_tabs = chromeWebDriver.findElement(By.className("day-tabs"));
and then:
ArrayList<WebElement> listItems = new ArrayList<>(days_tabs.findElements(By.tagName("li")));
but when I tried
JavascriptExecutor ex = (JavascriptExecutor)chromeWebDriver;
ex.executeScript("arguments[0].click();", listItems.get(n));
I didn't see that the n-th item was selected.