2021年3月3日星期三

How to store the Array List values in a String in java ...Can some one please provide the inputs

List Applicationfor = driver.findElements(By.xpath("//ul[contains(@id,'projectMainForm:projectTabSubview')]/li"));

(The above line iam capturing all the values that are there in the list)

    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]"));

(Iam 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....can someone please let me know where iam going wrong...

}

https://stackoverflow.com/questions/66468901/how-to-store-the-array-list-values-in-a-string-in-java-can-some-one-please-pr March 04, 2021 at 01:06PM

没有评论:

发表评论