I am trying to get all the web elements in a section/panel as shown using the above code. But, I am getting only the labels of few drop down boxes and inside options of one drop down. Also, I am not getting the results for buttons.
I have to do this exercise for 60 such dashboards. Kindly look into my code and screen shots and the results.
List<WebElement> elementlist = driver.findElements
(By.xpath(".//*[@id='idBSRT']/div/div[contains(@class, 'card-
inner')]/section/div[contains(@id,'update')]"));
List<String> all_elementlist=new ArrayList<>();
for(int ele=0; ele<elementlist.size(); ele++)
{
all_elementlist.add(elementlist.get(ele).getText());
System.out.println(elementlist.get(ele).getText());
}
Results:
Sub Country
All
Region
All
Sub Region
All
Territory
All
Select Village
All
Executor
All
Segment
All
Activity Type
All
Package or Individual
Select
INDIVIDUAL
PACKAGE
Activity
1 selected
Select Season
All
Crop
All
Brand
All
Activity Status
All
Select From Date
Select To Date
done[![enter image description here][1]][1]