I am trying to store the values from a list to a global array for later use/verify in other pages.
My element looks like below:
Tried array list which gives only the 1st line, but I have multiple items in the list.
<div class="col-lg-7">
<div class="clearfix" style="padding-bottom:5px;">
<i class="fa fa-user"></i><span style="margin-left:2%">Veena Pujari (Attorney)</span>
</div>
<div class="clearfix" style="padding-bottom:5px;">
<i class="fa fa-user"></i><span style="margin-left:2%">Ranjit Nayak (Accredited Representative)</span>
</div>
</div>
I am trying to pull the values ex:
List<WebElement> PMPageCMList = driver.findElements(By.xpath("//*[@id='collapseCM']/div[2]/div[2]"));
int totalcms = PMPageCMList.size();
for(int i=1;i<=totalcms;i++){
CaseManagersreceivingreminders.add(driver.findElement(By.xpath("//*[@id='collapseCM']/div[2]/div[2]/div"+"["+i+"]"+"/span")).getText());
System.out.println(CaseManagersreceivingreminders);