Subversion Repositories SmartDukaan

Rev

Rev 30373 | Rev 30592 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 30373 Rev 30375
Line 31... Line 31...
31
 
31
 
32
 
32
 
33
	private static final Logger LOGGER = LogManager.getLogger(CheckOppoWarrantyTask.class);
33
	private static final Logger LOGGER = LogManager.getLogger(CheckOppoWarrantyTask.class);
34
 
34
 
35
	public Map<String, LocalDate> checkWarranty(List<String> imeis) {
35
	public Map<String, LocalDate> checkWarranty(List<String> imeis) {
36
		String name = Thread.currentThread().getName();
-
 
37
		Map<String, LocalDate> dateMap = new HashMap<>();
36
		Map<String, LocalDate> dateMap = new HashMap<>();
38
		OpenCV.loadShared();
37
		OpenCV.loadShared();
39
		LOGGER.info("Initiating webdriver...");
38
		LOGGER.info("Initiating webdriver...");
40
		System.setProperty("webdriver.chrome.driver", "/usr/bin/chromedriver");
39
		System.setProperty("webdriver.chrome.driver", "/usr/bin/chromedriver");
41
 
40
 
Line 81... Line 80...
81
					driver.findElement(By.className("el-input__inner")).sendKeys(imei);
80
					driver.findElement(By.className("el-input__inner")).sendKeys(imei);
82
					driver.findElement(By.className("el-button--primary")).click();
81
					driver.findElement(By.className("el-button--primary")).click();
83
 
82
 
84
					// Perform click-and-hold action on the element
83
					// Perform click-and-hold action on the element
85
					int counter = 1;
84
					int counter = 1;
86
					String fileName = "/tmp/" + name + "-simple.png";
85
					String fileName = "/tmp/oppo-simple.png";
87
					boolean captchaBroken = false;
86
					boolean captchaBroken = false;
88
					do {
87
					do {
89
						try {
88
						try {
90
							System.out.println("Starting Do");
89
							System.out.println("Starting Do");
91
							wait10Sec.until(ExpectedConditions.visibilityOfElementLocated(By.id("dx_captcha_basic_wrapper_1")));
90
							wait10Sec.until(ExpectedConditions.visibilityOfElementLocated(By.id("dx_captcha_basic_wrapper_1")));