1). How can I get all element value in array/list?
2). And How I click by value of the element?
<div class="Choice" style="margin-top: -483px;>
<div class="ChoiceEntry Choice_1"> 5</div>
<div class="ChoiceEntry Choice_3"> 10</div>
<div class="ChoiceEntry Choice_2"> 20</div>
<div class="ChoiceEntry Choice_4"> 50</div>
<div class="ChoiceEntry Choice_7"> 75</div>
<div>...</div>
</div>
private static String choiceXPATH =
".//div[@class='Choice']//div[contains(@class,'ChoiceEntry')]";
//this getSize() method work Correctly.!
public int getSize() {
waitUntilXXXButtonIsVisible();
List<WebElement> count = getDriver().findElements(By.xpath(XPATH));
return count.size();
}
How can I get all element value in array/list?
public String getAllListValue(){
List<WebElement> list = getDriver().findElements(By.xpath(xpath));
return list.toString();;
}
I tought, i will get String array like "5,10,20,50,75". :-)
My second question is How can we click by div element value or div class Name(ChoiceEntry Choice_{index} )?
Many thanks in advance.