diff --git a/src/main/java/com/bonus/autoweb/GetBasicData.java b/src/main/java/com/bonus/autoweb/GetBasicData.java index 4f9b348..5190352 100644 --- a/src/main/java/com/bonus/autoweb/GetBasicData.java +++ b/src/main/java/com/bonus/autoweb/GetBasicData.java @@ -653,11 +653,13 @@ public class GetBasicData { } private void executePlan(String type, String company, String projectName) throws InterruptedException { - Thread.sleep(2000); + Thread.sleep(5000); + webDriver.findElement(By.xpath("//*[@id=\"pane-sec\"]/section/header/form/div[1]/div[8]/div/div/button[2]")).click(); + Thread.sleep(10000); String checkContent = resolveGarbledCode("D:\\bns\\config\\检查计划评价.txt"); String[] checkContentArrayArray = checkContent.split("检查评价:"); //勾选计划 - webDriver.findElement(By.xpath("/html/body/div[1]/section/div[1]/div[2]/div[2]/section/main/section/main/div/div[3]/table/tbody/tr[1]")).click(); + webDriver.findElement(By.xpath("//*[@id=\"pane-sec\"]/section/main/section/main/div/div[3]/table/tbody/tr[1]")).click(); Thread.sleep(800); //点击执行按钮--打开选择被检查对象 webDriver.findElement(By.xpath("/html/body/div[1]/section/div[1]/div[2]/div[2]/section/main/section/header/button[4]")).click(); @@ -695,8 +697,6 @@ public class GetBasicData { webDriver.findElement(By.xpath("/html/body/div/section/main/section/form/div[4]/button[2]")).click(); Thread.sleep(1500); - // /html/body/div/div/div/div[2]/div[1]/section/div/section/section/div/div[3]/table/tbody/tr[1]/td[9]/div - } private void auditPlan(String type, String company) throws InterruptedException { @@ -781,31 +781,14 @@ public class GetBasicData { Thread.sleep(1000); webDriver.findElement(By.xpath("/html/body/div[6]/div[1]/div/div/div[1]/div[1]/span[2]")).click(); log.info("选择被检查单位----------"); - Thread.sleep(500); -// //选择被检查对象 -// webDriver.findElement(By.xpath("/html/body/div[3]/div/div[2]/section/header/form/div/div[5]/div/div[2]")).click(); -// Thread.sleep(3000); -// if("通信测试".equals(type)){ -// webDriver.findElement(By.xpath("/html/body/div[7]/div/div[2]/section/main/div[1]/div[3]/table/tbody/tr[1]/td[1]/div/label")).click(); -// Thread.sleep(500); -// webDriver.findElement(By.xpath("/html/body/div[7]/div/div[2]/section/main/div[1]/div[3]/table/tbody/tr[2" + -// "]/td[1]/div/label")).click(); -// Thread.sleep(1000); -// webDriver.findElement(By.xpath("/html/body/div[7]/div/div[2]/section/footer/button[2]")).click(); -// Thread.sleep(2000); -// }else { -// for (int i = 1; i < 5; i++) { -// webDriver.findElement(By.xpath("/html/body/div[7]/div/div[2]/section/main/div[1]/div[3]/table" + -// "/tbody/tr["+i+"]/td[1]/div/label")).click(); -// Thread.sleep(1000); -// } -// webDriver.findElement(By.xpath("/html/body/div[7]/div/div[2]/section/footer[2]/button[2]")).click(); -// Thread.sleep(2000); -// } Thread.sleep(3000); + Thread.sleep(2000); //提交 - webDriver.findElement(By.xpath("/html/body/div[4]/div/div[2]/section/div/button[3]")).click(); - Thread.sleep(3000); + try { + webDriver.findElement(By.xpath("/html/body/div[4]/div/div[2]/section/div/button[3]")).click(); + } catch (Exception e) { + webDriver.findElement(By.xpath("/html/body/div[3]/div/div[2]/section/div/button[3]")).click(); + } } }