I have a code which stores the values for later use. But I need to find the exact names and not the whole. I am getting output like below:
Output result shows: [ Ranjit Nayak ( Attorney ), ranjti Nyak ( Case Manager ), shenoy attorney ( Parallegal ) ]
So I need to use some method to remove content including brackets. Please help.
In the code: CaseManagersreceivingreminders is a global ArrayList, I have a similar another ArrayList stored values. Once the string is edited successfully I need to compare both the array values.
Tried trim, replace. Nothing works.
List<WebElement> PMPageCMList =
driver.findElements(By.xpath("//div[@id='collapseCM']/div[2]/div[2]/div"));
int totalcms = PMPageCMList.size();
for (int i = 1; i <= totalcms; i++) {
CaseManagersreceivingreminders.add(
driver
.findElement(By.xpath("//div[@id='collapseCM']/div[2]/div[2]/div" + "[" + i + "]" + "/span"))
.getText()
);
}
Collections.sort(CaseManagersreceivingreminders);
Collections.sort(ReminderCMsList);
try {
boolean isEqual = CaseManagersreceivingreminders.contains(ReminderCMsList);
System.out.println(isEqual);
Log.pass("Data matching" + isEqual);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
I should get the output like: [ Ranjit Nayak, ranjti Nyak, shenoy attorney ]
split()andtrim()related to Selenium? Am I missing something?