| Line 94... |
Line 94... |
| 94 |
// Perform click-and-hold action on the element
|
94 |
// Perform click-and-hold action on the element
|
| 95 |
int counter = 1;
|
95 |
int counter = 1;
|
| 96 |
String fileName = "/tmp/" + name + "-simple.png";
|
96 |
String fileName = "/tmp/" + name + "-simple.png";
|
| 97 |
boolean captchaBroken = false;
|
97 |
boolean captchaBroken = false;
|
| 98 |
do {
|
98 |
do {
|
| 99 |
System.out.println("Starting Do");
|
- |
|
| 100 |
wait10Sec.until(ExpectedConditions.visibilityOfElementLocated(By.id("dx_captcha_basic_wrapper_1")));
|
- |
|
| 101 |
wait10Sec.until(ExpectedConditions.visibilityOfElementLocated(By.id("dx_captcha_basic_slider_1")));
|
- |
|
| 102 |
slideButton = driver.findElement(By.id("dx_captcha_basic_slider_1"));
|
- |
|
| 103 |
try {
|
99 |
try {
|
| - |
|
100 |
System.out.println("Starting Do");
|
| - |
|
101 |
wait10Sec.until(ExpectedConditions.visibilityOfElementLocated(By.id("dx_captcha_basic_wrapper_1")));
|
| - |
|
102 |
wait10Sec.until(ExpectedConditions.visibilityOfElementLocated(By.id("dx_captcha_basic_slider_1")));
|
| - |
|
103 |
slideButton = driver.findElement(By.id("dx_captcha_basic_slider_1"));
|
| 104 |
actionProvider.moveToElement(slideButton).clickAndHold().moveByOffset(10, 0).perform();
|
104 |
actionProvider.moveToElement(slideButton).clickAndHold().moveByOffset(10, 0).perform();
|
| 105 |
} catch (StaleElementReferenceException staleElementReferenceException) {
|
105 |
} catch (StaleElementReferenceException staleElementReferenceException) {
|
| 106 |
System.out.println("Found stale element for " + imei + ", lets move ahead with fresh imei");
|
106 |
System.out.println("Found stale element for " + imei + ", lets move ahead with fresh imei");
|
| 107 |
driver.get("https://support.oppo.com/in/warranty-check/");
|
107 |
driver.get("https://support.oppo.com/in/warranty-check/");
|
| - |
|
108 |
break;
|
| 108 |
}
|
109 |
}
|
| 109 |
Mat circles = getMatCircles(driver, fileName);
|
110 |
Mat circles = getMatCircles(driver, fileName);
|
| 110 |
if (circles.cols() == 2) {
|
111 |
if (circles.cols() == 2) {
|
| 111 |
double firstCircleX = circles.get(0, 0)[0];
|
112 |
double firstCircleX = circles.get(0, 0)[0];
|
| 112 |
double secondCircleX = circles.get(0, 1)[0];
|
113 |
double secondCircleX = circles.get(0, 1)[0];
|