| Line 116... |
Line 116... |
| 116 |
System.out.println("Success at attempt " + counter);
|
116 |
System.out.println("Success at attempt " + counter);
|
| 117 |
List<WebElement> warrantyDateElements = driver.findElements(By.className("warranty-service--result_info__dateValue"));
|
117 |
List<WebElement> warrantyDateElements = driver.findElements(By.className("warranty-service--result_info__dateValue"));
|
| 118 |
if (warrantyDateElements.size() > 0) {
|
118 |
if (warrantyDateElements.size() > 0) {
|
| 119 |
String warrantyDate = warrantyDateElements.get(0).getText();
|
119 |
String warrantyDate = warrantyDateElements.get(0).getText();
|
| 120 |
System.out.println("Date -- " + warrantyDate);
|
120 |
System.out.println("Date -- " + warrantyDate);
|
| - |
|
121 |
try {
|
| 121 |
dateMap.put(imei, LocalDate.parse(warrantyDate, DateTimeFormatter.ofPattern("yyyy/MM/dd")).minusYears(1));
|
122 |
dateMap.put(imei, LocalDate.parse(warrantyDate, DateTimeFormatter.ofPattern("yyyy/MM/dd")).minusYears(1));
|
| - |
|
123 |
} catch (Exception e) {
|
| - |
|
124 |
dateMap.put(imei, null);
|
| - |
|
125 |
}
|
| 122 |
} else {
|
126 |
} else {
|
| 123 |
System.out.println("Could not capture date");
|
127 |
System.out.println("Could not capture date");
|
| 124 |
dateMap.put(imei, null);
|
128 |
dateMap.put(imei, null);
|
| 125 |
}
|
129 |
}
|
| 126 |
WebElement checkAgainButton = driver.findElement(By.className("van-button--normal"));
|
130 |
WebElement checkAgainButton = driver.findElement(By.className("van-button--normal"));
|