Reputation: 57
Is there any way to get all the values displaying against "BRAND" .
I want to store all the value that will display for the BRAND and sore those value in the collection so that I can compare with one more collection and find which value will get match in between those.
below is the screenshot . Please give some input .
Upvotes: 0
Views: 98
Reputation: 1778
Probably the simplest way:
List<String> brands = new ArrayList<String>();
List<WebElement> fields = driver.findElements(By.className("asset-page__field-value"));
for (WebElement field: fields) {
brands.add(field.getText());
}
Upvotes: 1