Scenario:
As seen in the above screen there are 2 ids in the same row which are seperated by comma.
My method is there where i get the lastest id.The Problem over here is it fetches both the Ids. Since i use the id to search i dont want both the Ids.
Below is my method which i use to Fetch the Ids
public static HashMap<String, String> Values;
public static void PlanningScreenFetchPlanningandDemandID(WebDriver driver) throws InterruptedException
{
Values = new HashMap<String, String>();
List<WebElement> tableValue = driver.findElements(By.xpath("//table//tr//td[contains(@class,'mat-column-demandId')]//span"));
int tableValueSizes = tableValue.size();
WebElement latestIds = driver.findElement(By.xpath("(//table//tr//td[contains(@class,'mat-column-demandId')]//span)["+tableValueSize +"]"));
Values.put("latestDataId", latestIds.getText());
System.out.println(Values.put("latestDataId", latestIds.getText()));
String Id = AppXPathsConstants.columnInputEntryXpath_replace.replace("XXXX", "ID") ;
inputEntry(driver, Id , Values.put("latestDataId", latestId.getText()));
}