List<WebElement> Applicationfor = driver.findElements(By.xpath("//ul[contains(@id,'projectMainForm:projectTabSubview')]/li"));
// (I am capturing all the values that are there in the list with the above line)
List<String> applicationfor = new ArrayList<String>();
WebElement applicationfordropdown = driver.findElement(By.xpath("//td[normalize-
space()='Application For*']/following::div[contains(@class,'ui-selectonemenu-trigger')][1]"));
// (I am clicking on the dropdown and fetching the values which is assigned to the ArrayLIST)
applicationfordropdown.click();
Applicationfor.forEach(Ele -> applicationfor.add(Ele.getText()));
//System.out.println("Print the colvalues:"+applicationfor);
for(String text : applicationfor)
{
System.out.println("Print the lst values:"+text);
}
My question is if the applicationfor value is assigned to the Array List as seen in the above code it
prints only the first value in the list. where am I going wrong?