优化自动值班系统的功能和流程- 修改了多个类和方法,优化了自动值班系统的逻辑和执行流程
- 调整了部分界面元素的定位方式,提高了自动化操作的准确性 - 优化了日报填写和提交的逻辑,提升了系统的稳定性和效率 -修复了一些可能导致程序异常的问题,增强了系统的健壮性
This commit is contained in:
parent
8c88d62502
commit
54b5ed13b1
|
|
@ -433,114 +433,114 @@ public class GetBasicData {
|
||||||
webDriver.findElement(By.xpath("/html/body/div[1]/div/header/form/div[8]/div/button[2]")).click();
|
webDriver.findElement(By.xpath("/html/body/div[1]/div/header/form/div[8]/div/button[2]")).click();
|
||||||
Thread.sleep(2000);
|
Thread.sleep(2000);
|
||||||
int i = 1;
|
int i = 1;
|
||||||
while (tf) {
|
// while (tf) {
|
||||||
Thread.sleep(10000);
|
// Thread.sleep(10000);
|
||||||
WebElement numberEle = webDriver.findElement(By.xpath("/html/body/div[1]/div/main/div/div/footer/span"));
|
// WebElement numberEle = webDriver.findElement(By.xpath("/html/body/div[1]/div/main/div/div/footer/span"));
|
||||||
log.info("numberEle:" + numberEle.getText());
|
// log.info("numberEle:" + numberEle.getText());
|
||||||
// String num = numberEle.getText().substring(2, 3);
|
//// String num = numberEle.getText().substring(2, 3);
|
||||||
String num1 = numberEle.getText().substring(2, numberEle.getText().length());
|
// String num1 = numberEle.getText().substring(2, numberEle.getText().length());
|
||||||
String num = num1.substring(0, num1.length() - 2);
|
// String num = num1.substring(0, num1.length() - 2);
|
||||||
log.info("num:" + num);
|
// log.info("num:" + num);
|
||||||
if ("0".equals(num)) {
|
// if ("0".equals(num)) {
|
||||||
tf = false;
|
// tf = false;
|
||||||
} else {
|
|
||||||
WebElement timeEle;
|
|
||||||
// if ("1".equals(num)) {
|
|
||||||
// timeEle = webDriver.findElement(By.xpath("/html/body/div/div/main/div/div/div[2]/div/div[3]/table/tbody/tr/td[8]/div"));
|
|
||||||
// } else {
|
// } else {
|
||||||
timeEle = webDriver.findElement(By.xpath("/html/body/div[1]/div/main/div/div/div[2]/div/div[3" +
|
// WebElement timeEle;
|
||||||
"]/table/tbody/tr[" + i + "]/td[8]/div"));
|
//// if ("1".equals(num)) {
|
||||||
// }
|
//// timeEle = webDriver.findElement(By.xpath("/html/body/div/div/main/div/div/div[2]/div/div[3]/table/tbody/tr/td[8]/div"));
|
||||||
|
//// } else {
|
||||||
System.out.println(timeEle.getText());
|
// timeEle = webDriver.findElement(By.xpath("/html/body/div[1]/div/main/div/div/div[2]/div/div[3" +
|
||||||
if (time.equals(timeEle.getText())) {
|
// "]/table/tbody/tr[" + i + "]/td[8]/div"));
|
||||||
//操练环节 -通信测试 日常操练
|
//// }
|
||||||
WebElement drillSessionEle;
|
//
|
||||||
// if ("1".equals(num)) {
|
// System.out.println(timeEle.getText());
|
||||||
// drillSessionEle = webDriver.findElement(By.xpath("/html/body/div/div/main/div/div/div[2]/div/div[3]/table/tbody/tr/td[6]/div"));
|
// if (time.equals(timeEle.getText())) {
|
||||||
|
// //操练环节 -通信测试 日常操练
|
||||||
|
// WebElement drillSessionEle;
|
||||||
|
//// if ("1".equals(num)) {
|
||||||
|
//// drillSessionEle = webDriver.findElement(By.xpath("/html/body/div/div/main/div/div/div[2]/div/div[3]/table/tbody/tr/td[6]/div"));
|
||||||
|
//// } else {
|
||||||
|
// drillSessionEle = webDriver.findElement(By.xpath("/html/body/div[1]/div/main/div/div/div[2" +
|
||||||
|
// "]/div/div[3]/table/tbody/tr[" + i + "]/td[6]/div"));
|
||||||
|
//// }
|
||||||
|
// log.info("操练环节:" + drillSessionEle.getText());
|
||||||
|
// //供电公司
|
||||||
|
// WebElement powerSupplyCompaniesEle;
|
||||||
|
//// if ("1".equals(num)) {
|
||||||
|
//// powerSupplyCompaniesEle = webDriver.findElement(By.xpath("/html/body/div/div/main/div/div/div[2]/div/div[3]/table/tbody/tr/td[5]/div"));
|
||||||
|
//// } else {
|
||||||
|
// powerSupplyCompaniesEle = webDriver.findElement(By.xpath("/html/body/div[1]/div/main/div/div" +
|
||||||
|
// "/div[2]/div/div[3]/table/tbody/tr[" + i + "]/td[5]/div"));
|
||||||
|
//// }
|
||||||
|
// log.info("供电公司:" + powerSupplyCompaniesEle.getText());
|
||||||
|
// if ("通信测试".equals(drillSessionEle.getText())) {
|
||||||
|
// communicationTestNum++;
|
||||||
|
// communicationTestName1 += getDailyName(powerSupplyCompaniesEle.getText()) + "、";
|
||||||
|
// } else if ("重要站线视频连线检查".equals(drillSessionEle.getText())) {
|
||||||
|
// dailyExercisesNum++;
|
||||||
|
//// dailyExercisesName1 += powerSupplyCompaniesEle.getText().substring(0, powerSupplyCompaniesEle.getText().length() - 4) + "、";
|
||||||
|
// dailyExercisesName1 += getDailyName(powerSupplyCompaniesEle.getText()) + "、";
|
||||||
// } else {
|
// } else {
|
||||||
drillSessionEle = webDriver.findElement(By.xpath("/html/body/div[1]/div/main/div/div/div[2" +
|
// dailyExercisesNum++;
|
||||||
"]/div/div[3]/table/tbody/tr[" + i + "]/td[6]/div"));
|
//// dailyExercisesName2 += powerSupplyCompaniesEle.getText().substring(0, powerSupplyCompaniesEle.getText().length() - 4) + "、";
|
||||||
|
// WebElement ele = webDriver.findElement(By.xpath("/html/body/div[1]/div/main/div/div/div[2" +
|
||||||
|
// "]/div/div[3]/table/tbody/tr[" + i + "]/td[7]/div"));
|
||||||
|
// if ("物资".equals(ele.getText()))
|
||||||
|
// materialName += getDailyName(powerSupplyCompaniesEle.getText()) + "、";
|
||||||
|
// if ("车辆".equals(ele.getText()))
|
||||||
|
// carName += getDailyName(powerSupplyCompaniesEle.getText()) + "、";
|
||||||
|
// if ("队伍".equals(ele.getText()))
|
||||||
|
// contingentName += getDailyName(powerSupplyCompaniesEle.getText()) + "、";
|
||||||
|
// dailyExercisesName2 += getDailyName(powerSupplyCompaniesEle.getText()) + "、";
|
||||||
// }
|
// }
|
||||||
log.info("操练环节:" + drillSessionEle.getText());
|
// int x = parseInt(num);
|
||||||
//供电公司
|
// if (i == parseInt(num)) {
|
||||||
WebElement powerSupplyCompaniesEle;
|
// tf = false;
|
||||||
// if ("1".equals(num)) {
|
// }
|
||||||
// powerSupplyCompaniesEle = webDriver.findElement(By.xpath("/html/body/div/div/main/div/div/div[2]/div/div[3]/table/tbody/tr/td[5]/div"));
|
// i++;
|
||||||
// } else {
|
// } else {
|
||||||
powerSupplyCompaniesEle = webDriver.findElement(By.xpath("/html/body/div[1]/div/main/div/div" +
|
// tf = false;
|
||||||
"/div[2]/div/div[3]/table/tbody/tr[" + i + "]/td[5]/div"));
|
|
||||||
// }
|
// }
|
||||||
log.info("供电公司:" + powerSupplyCompaniesEle.getText());
|
// }
|
||||||
if ("通信测试".equals(drillSessionEle.getText())) {
|
// }
|
||||||
communicationTestNum++;
|
// log.info("communicationTestName1:" + communicationTestName1);
|
||||||
communicationTestName1 += getDailyName(powerSupplyCompaniesEle.getText()) + "、";
|
// if (communicationTestNum > 0) {
|
||||||
} else if ("重要站线视频连线检查".equals(drillSessionEle.getText())) {
|
// communicationTestName = "今日市公司本部对所属" + communicationTestNum + "家县公司(" + communicationTestName1.substring(0, communicationTestName1.length() - 1) + ")进行通信测试";
|
||||||
dailyExercisesNum++;
|
// } else {
|
||||||
// dailyExercisesName1 += powerSupplyCompaniesEle.getText().substring(0, powerSupplyCompaniesEle.getText().length() - 4) + "、";
|
// communicationTestName = "今日市公司本部对所属县公司无通信测试";
|
||||||
dailyExercisesName1 += getDailyName(powerSupplyCompaniesEle.getText()) + "、";
|
// }
|
||||||
} else {
|
// if (dailyExercisesName1.length() > 0) {
|
||||||
dailyExercisesNum++;
|
// dailyExercisesName1 = dailyExercisesName1.substring(0, dailyExercisesName1.length() - 1);
|
||||||
// dailyExercisesName2 += powerSupplyCompaniesEle.getText().substring(0, powerSupplyCompaniesEle.getText().length() - 4) + "、";
|
// }
|
||||||
WebElement ele = webDriver.findElement(By.xpath("/html/body/div[1]/div/main/div/div/div[2" +
|
// if (dailyExercisesName2.length() > 0) {
|
||||||
"]/div/div[3]/table/tbody/tr[" + i + "]/td[7]/div"));
|
// dailyExercisesName2 = dailyExercisesName2.substring(0, dailyExercisesName2.length() - 1);
|
||||||
if ("物资".equals(ele.getText()))
|
// }
|
||||||
materialName += getDailyName(powerSupplyCompaniesEle.getText()) + "、";
|
// String fourElementVerification = "";
|
||||||
if ("车辆".equals(ele.getText()))
|
// if (materialName.length() > 0) {
|
||||||
carName += getDailyName(powerSupplyCompaniesEle.getText()) + "、";
|
// materialName = materialName.substring(0, materialName.length() - 1);
|
||||||
if ("队伍".equals(ele.getText()))
|
// fourElementVerification += materialName + "公司四要素物资核查、";
|
||||||
contingentName += getDailyName(powerSupplyCompaniesEle.getText()) + "、";
|
// }
|
||||||
dailyExercisesName2 += getDailyName(powerSupplyCompaniesEle.getText()) + "、";
|
// if (carName.length() > 0) {
|
||||||
}
|
// carName = carName.substring(0, carName.length() - 1);
|
||||||
int x = parseInt(num);
|
// fourElementVerification += carName + "公司四要素车辆核查、";
|
||||||
if (i == parseInt(num)) {
|
// }
|
||||||
tf = false;
|
// if (contingentName.length() > 0) {
|
||||||
}
|
// contingentName = contingentName.substring(0, contingentName.length() - 1);
|
||||||
i++;
|
// fourElementVerification += contingentName + "公司四要素队伍核查、";
|
||||||
} else {
|
// }
|
||||||
tf = false;
|
// if (dailyExercisesName1.length() > 0 && dailyExercisesName2.length() > 0) {
|
||||||
}
|
// dailyExercisesName = "今日市公司本部对所属" + dailyExercisesNum + "家县公司进行日常操练(" + fourElementVerification + dailyExercisesName1 + "公司重要站连线检查)";
|
||||||
}
|
// } else if (dailyExercisesName1.length() == 0 && dailyExercisesName2.length() > 0) {
|
||||||
}
|
// dailyExercisesName = "今日市公司本部对所属" + dailyExercisesNum + "家县公司进行日常操练(" + fourElementVerification + ")";
|
||||||
log.info("communicationTestName1:" + communicationTestName1);
|
// } else if (dailyExercisesName1.length() > 0 && fourElementVerification.length() == 0) {
|
||||||
if (communicationTestNum > 0) {
|
// dailyExercisesName = "今日市公司本部对所属" + dailyExercisesNum + "家县公司进行日常操练(" + dailyExercisesName1 + "公司重要站连线检查)";
|
||||||
communicationTestName = "今日市公司本部对所属" + communicationTestNum + "家县公司(" + communicationTestName1.substring(0, communicationTestName1.length() - 1) + ")进行通信测试";
|
// } else {
|
||||||
} else {
|
// dailyExercisesName = "今日市公司本部对所属" + dailyExercisesNum + "家县公司进行日常操练";
|
||||||
communicationTestName = "今日市公司本部对所属县公司无通信测试";
|
// }
|
||||||
}
|
//// dailyExercisesName = "今日市公司本部对所属" + 0 + "家县公司进行日常操练";
|
||||||
if (dailyExercisesName1.length() > 0) {
|
// log.info("communicationTestName:" + communicationTestName);
|
||||||
dailyExercisesName1 = dailyExercisesName1.substring(0, dailyExercisesName1.length() - 1);
|
// log.info("dailyExercisesName:" + dailyExercisesName);
|
||||||
}
|
// log.info("communicationTestNum:" + communicationTestNum);
|
||||||
if (dailyExercisesName2.length() > 0) {
|
// log.info("dailyExercisesNum:" + dailyExercisesNum);
|
||||||
dailyExercisesName2 = dailyExercisesName2.substring(0, dailyExercisesName2.length() - 1);
|
|
||||||
}
|
|
||||||
String fourElementVerification = "";
|
|
||||||
if (materialName.length() > 0) {
|
|
||||||
materialName = materialName.substring(0, materialName.length() - 1);
|
|
||||||
fourElementVerification += materialName + "公司四要素物资核查、";
|
|
||||||
}
|
|
||||||
if (carName.length() > 0) {
|
|
||||||
carName = carName.substring(0, carName.length() - 1);
|
|
||||||
fourElementVerification += carName + "公司四要素车辆核查、";
|
|
||||||
}
|
|
||||||
if (contingentName.length() > 0) {
|
|
||||||
contingentName = contingentName.substring(0, contingentName.length() - 1);
|
|
||||||
fourElementVerification += contingentName + "公司四要素队伍核查、";
|
|
||||||
}
|
|
||||||
if (dailyExercisesName1.length() > 0 && dailyExercisesName2.length() > 0) {
|
|
||||||
dailyExercisesName = "今日市公司本部对所属" + dailyExercisesNum + "家县公司进行日常操练(" + fourElementVerification + dailyExercisesName1 + "公司重要站连线检查)";
|
|
||||||
} else if (dailyExercisesName1.length() == 0 && dailyExercisesName2.length() > 0) {
|
|
||||||
dailyExercisesName = "今日市公司本部对所属" + dailyExercisesNum + "家县公司进行日常操练(" + fourElementVerification + ")";
|
|
||||||
} else if (dailyExercisesName1.length() > 0 && fourElementVerification.length() == 0) {
|
|
||||||
dailyExercisesName = "今日市公司本部对所属" + dailyExercisesNum + "家县公司进行日常操练(" + dailyExercisesName1 + "公司重要站连线检查)";
|
|
||||||
} else {
|
|
||||||
dailyExercisesName = "今日市公司本部对所属" + dailyExercisesNum + "家县公司进行日常操练";
|
|
||||||
}
|
|
||||||
// dailyExercisesName = "今日市公司本部对所属" + 0 + "家县公司进行日常操练";
|
|
||||||
log.info("communicationTestName:" + communicationTestName);
|
|
||||||
log.info("dailyExercisesName:" + dailyExercisesName);
|
|
||||||
log.info("communicationTestNum:" + communicationTestNum);
|
|
||||||
log.info("dailyExercisesNum:" + dailyExercisesNum);
|
|
||||||
String type = "";
|
String type = "";
|
||||||
if (classes == 1) {
|
if (classes == 1) {
|
||||||
type = "morning_daily";
|
type = "morning_daily";
|
||||||
|
|
@ -1222,21 +1222,21 @@ public class GetBasicData {
|
||||||
webDriver.findElement(By.xpath("/html/body/div[3]/div/div[2]/section/header/form/div/div[5]/div/div[2]")).click();
|
webDriver.findElement(By.xpath("/html/body/div[3]/div/div[2]/section/header/form/div/div[5]/div/div[2]")).click();
|
||||||
Thread.sleep(3000);
|
Thread.sleep(3000);
|
||||||
if("通信测试".equals(type)){
|
if("通信测试".equals(type)){
|
||||||
webDriver.findElement(By.xpath("/html/body/div[7]/div/div[2]/section/section/main/div/div[3]/table/tbody" +
|
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();
|
||||||
"/tr[1]")).click();
|
|
||||||
Thread.sleep(500);
|
Thread.sleep(500);
|
||||||
webDriver.findElement(By.xpath("/html/body/div[7]/div/div[2]/section/section/main/div/div[3]/table/tbody" +
|
webDriver.findElement(By.xpath("/html/body/div[7]/div/div[2]/section/main/div[1]/div[3]/table/tbody/tr[2" +
|
||||||
"/tr[2]")).click();
|
"]/td[1]/div/label")).click();
|
||||||
Thread.sleep(1000);
|
Thread.sleep(1000);
|
||||||
|
webDriver.findElement(By.xpath("/html/body/div[7]/div/div[2]/section/footer/button[2]")).click();
|
||||||
}else {
|
}else {
|
||||||
for (int i = 1; i < 9; i++) {
|
for (int i = 1; i < 9; i++) {
|
||||||
webDriver.findElement(By.xpath("/html/body/div[7]/div/div[2]/section/section/main/div/div[3]/table" +
|
webDriver.findElement(By.xpath("/html/body/div[7]/div/div[2]/section/main/div[1]/div[3]/table" +
|
||||||
"/tbody/tr["+i+"]")).click();
|
"/tbody/tr["+i+"]/td[1]/div/label")).click();
|
||||||
Thread.sleep(1000);
|
Thread.sleep(1000);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
Thread.sleep(3000);
|
Thread.sleep(3000);
|
||||||
webDriver.findElement(By.xpath("/html/body/div[7]/div/div[2]/section/footer/button[2]")).click();
|
webDriver.findElement(By.xpath("/html/body/div[7]/div/div[2]/section/footer[2]/button[2]")).click();
|
||||||
|
}
|
||||||
Thread.sleep(2000);
|
Thread.sleep(2000);
|
||||||
//提交
|
//提交
|
||||||
webDriver.findElement(By.xpath("/html/body/div[2]/div/div[2]/section/div/button[3]")).click();
|
webDriver.findElement(By.xpath("/html/body/div[2]/div/div[2]/section/div/button[3]")).click();
|
||||||
|
|
|
||||||
|
|
@ -38,22 +38,22 @@ public class TestMain {
|
||||||
// testqd();
|
// testqd();
|
||||||
// testjjb();
|
// testjjb();
|
||||||
// testGetData();
|
// testGetData();
|
||||||
// testAccounters();
|
testAccounters();
|
||||||
// testDailrb();
|
// testDailrb();
|
||||||
// testRCCL();
|
// testRCCL();
|
||||||
// testLog();
|
// testLog();
|
||||||
new Thread(new Runnable() {
|
// new Thread(new Runnable() {
|
||||||
@SneakyThrows
|
// @SneakyThrows
|
||||||
@Override
|
// @Override
|
||||||
public void run() {
|
// public void run() {
|
||||||
try {
|
// try {
|
||||||
new TestMain().autoJob();
|
// new TestMain().autoJob();
|
||||||
} catch (Exception e) {
|
// } catch (Exception e) {
|
||||||
e.printStackTrace();
|
// e.printStackTrace();
|
||||||
log.error("错误信息", e);
|
// log.error("错误信息", e);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}).start();
|
// }).start();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void testAccounters() {
|
private static void testAccounters() {
|
||||||
|
|
@ -105,7 +105,7 @@ public class TestMain {
|
||||||
Thread.sleep(2000);
|
Thread.sleep(2000);
|
||||||
autoWebTask.addExercisePlan("通信测试", array[index], index+1, emergencyPerson,
|
autoWebTask.addExercisePlan("通信测试", array[index], index+1, emergencyPerson,
|
||||||
emergencyPersonPassword);
|
emergencyPersonPassword);
|
||||||
Thread.sleep(1000 * 700);
|
Thread.sleep(1000);
|
||||||
autoWebTask.addExercisePlan("日常操练", array[index], index+1, emergencyPerson,
|
autoWebTask.addExercisePlan("日常操练", array[index], index+1, emergencyPerson,
|
||||||
emergencyPersonPassword);
|
emergencyPersonPassword);
|
||||||
Thread.sleep(2000);
|
Thread.sleep(2000);
|
||||||
|
|
@ -123,14 +123,6 @@ public class TestMain {
|
||||||
Thread.sleep(2000);
|
Thread.sleep(2000);
|
||||||
autoWebTask.getCaoLianData(2,emergencyPerson,emergencyPersonPassword);
|
autoWebTask.getCaoLianData(2,emergencyPerson,emergencyPersonPassword);
|
||||||
Thread.sleep(2000);
|
Thread.sleep(2000);
|
||||||
// GetBasicData.getYuJingActionBasicData(1);
|
|
||||||
//登录操作---杨军账号
|
|
||||||
// autoWebTask.addExercisePlan("日常操练","灵璧",5,DataConfig.USER_NAME3,DataConfig.PASS3);
|
|
||||||
// Thread.sleep(2000);
|
|
||||||
// autoWebTask.addExercisePlan("日常操练","城郊",6,DataConfig.USER_NAME3,DataConfig.PASS3);
|
|
||||||
//// Thread.sleep(2000);
|
|
||||||
// autoWebTask.addExercisePlan("日常操练","砀山",3,DataConfig.USER_NAME3,DataConfig.PASS3);
|
|
||||||
// autoWebTask.addExercisePlan("通信测试","城郊",6,DataConfig.USER_NAME3,DataConfig.PASS3);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//日报填写测试
|
//日报填写测试
|
||||||
|
|
@ -139,7 +131,7 @@ public class TestMain {
|
||||||
//操作日报
|
//操作日报
|
||||||
//日报审核工作
|
//日报审核工作
|
||||||
AutoWebTask autoWebTask = new AutoWebTask();
|
AutoWebTask autoWebTask = new AutoWebTask();
|
||||||
autoWebTask.dutyAddDailyLogsTask(1,DataConfig.USER_NAME4,DataConfig.PASS4);
|
autoWebTask.dutyAddDailyLogsTask(2,DataConfig.USER_NAME4,DataConfig.PASS4);
|
||||||
Thread.sleep(1000);
|
Thread.sleep(1000);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
@ -169,7 +161,7 @@ public class TestMain {
|
||||||
*
|
*
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
private void autoJob() throws InterruptedException {
|
private void autoJob() throws InterruptedException, IOException {
|
||||||
AutoWebTask autoWebTask = new AutoWebTask();
|
AutoWebTask autoWebTask = new AutoWebTask();
|
||||||
|
|
||||||
int logGatherCount = 0;
|
int logGatherCount = 0;
|
||||||
|
|
@ -186,10 +178,6 @@ public class TestMain {
|
||||||
int signOutzao = 0;
|
int signOutzao = 0;
|
||||||
int signOutzao2 = 0;
|
int signOutzao2 = 0;
|
||||||
int logzao = 0;
|
int logzao = 0;
|
||||||
int resetCode = 0;
|
|
||||||
|
|
||||||
int changeTodayPerson = 0;
|
|
||||||
|
|
||||||
int addExercisePlan = 0;
|
int addExercisePlan = 0;
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
|
|
@ -232,9 +220,8 @@ public class TestMain {
|
||||||
}else if (DateTimeUtils.isEffectiveDate("05:00", "05:30")) {
|
}else if (DateTimeUtils.isEffectiveDate("05:00", "05:30")) {
|
||||||
//TODO 更新今日
|
//TODO 更新今日
|
||||||
try {
|
try {
|
||||||
if (changeTodayPerson == 0){
|
autoWebTask.changeTodayPersonaTask(1,emergencyPerson,emergencyPersonPassword);
|
||||||
changeTodayPerson = autoWebTask.changeTodayPersonaTask(1,emergencyPerson,emergencyPersonPassword);
|
Thread.sleep(1000 * 60 * 5);
|
||||||
}
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
log.error("更新早上打卡人员", e);
|
log.error("更新早上打卡人员", e);
|
||||||
}
|
}
|
||||||
|
|
@ -244,8 +231,6 @@ public class TestMain {
|
||||||
getTime(1100);
|
getTime(1100);
|
||||||
try {
|
try {
|
||||||
dailyzao = autoWebTask.dutyAddDailyLogsTask(1,emergencyPerson,emergencyPersonPassword);
|
dailyzao = autoWebTask.dutyAddDailyLogsTask(1,emergencyPerson,emergencyPersonPassword);
|
||||||
|
|
||||||
|
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
log.error("日报工作", e);
|
log.error("日报工作", e);
|
||||||
}
|
}
|
||||||
|
|
@ -260,6 +245,13 @@ public class TestMain {
|
||||||
log.error("日志工作", e);
|
log.error("日志工作", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}else if (DateTimeUtils.isEffectiveDate("07:00", "07:10")) {
|
||||||
|
try {
|
||||||
|
autoWebTask.changeTodayPersonaTask(1,emergencyPerson,emergencyPersonPassword);
|
||||||
|
Thread.sleep(1000 * 60 * 5);
|
||||||
|
} catch (IOException e) {
|
||||||
|
log.error("更新早上打卡人员", e);
|
||||||
|
}
|
||||||
} else if (DateTimeUtils.isEffectiveDate("07:20", "07:50")) {
|
} else if (DateTimeUtils.isEffectiveDate("07:20", "07:50")) {
|
||||||
//自动完成当值值班签到(值班主任、值班人员都要签到)
|
//自动完成当值值班签到(值班主任、值班人员都要签到)
|
||||||
if ("error".equals(content)) {
|
if ("error".equals(content)) {
|
||||||
|
|
@ -273,8 +265,6 @@ public class TestMain {
|
||||||
//使用应急值班账号签到
|
//使用应急值班账号签到
|
||||||
try {
|
try {
|
||||||
signInzao = autoWebTask.dutySigin(1, 1, emergencyPerson, emergencyPersonPassword);
|
signInzao = autoWebTask.dutySigin(1, 1, emergencyPerson, emergencyPersonPassword);
|
||||||
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("应急值班打卡任务", e);
|
log.error("应急值班打卡任务", e);
|
||||||
}
|
}
|
||||||
|
|
@ -332,23 +322,28 @@ public class TestMain {
|
||||||
if (signOutzao2 == 0){
|
if (signOutzao2 == 0){
|
||||||
try {
|
try {
|
||||||
signOutzao2 = autoWebTask.dutySignOutTask(1, yesterdaySignOutPerson, yesterdaySignOutPersonPassword);
|
signOutzao2 = autoWebTask.dutySignOutTask(1, yesterdaySignOutPerson, yesterdaySignOutPersonPassword);
|
||||||
if (signOutzao2 == 1){
|
}catch (Exception e){
|
||||||
|
log.error("签退",e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
log.error("签退", e);
|
||||||
|
}
|
||||||
|
} else if (DateTimeUtils.isEffectiveDate("11:05", "11:10")) {
|
||||||
|
try {
|
||||||
|
autoWebTask.changeTodayPersonaTask(1,emergencyPerson,emergencyPersonPassword);
|
||||||
// TODO 更新昨日签退人员账号
|
// TODO 更新昨日签退人员账号
|
||||||
String value = GetBasicData.resolveGarbledCode("E:\\bns\\config\\今日值班账号.txt");
|
String value = GetBasicData.resolveGarbledCode("E:\\bns\\config\\今日值班账号.txt");
|
||||||
AutoUtils.write("E:\\bns\\config\\昨日值班账号.txt", value.replace("今日","昨日"));
|
AutoUtils.write("E:\\bns\\config\\昨日值班账号.txt", value.replace("今日","昨日"));
|
||||||
}
|
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
log.error("签退",e);
|
log.error("更新昨日签退人员账号", e);
|
||||||
}
|
|
||||||
}
|
|
||||||
}catch (Exception e){
|
|
||||||
log.error("签退", e);
|
|
||||||
}
|
}
|
||||||
} else if (DateTimeUtils.isEffectiveDate("09:05", "10:00")) {
|
} else if (DateTimeUtils.isEffectiveDate("09:05", "10:00")) {
|
||||||
if(addExercisePlan == 0){
|
if(addExercisePlan == 0){
|
||||||
getTime(1200);
|
getTime(1200);
|
||||||
}
|
}
|
||||||
if(addExercisePlan == 0) {
|
if(addExercisePlan == 0) {
|
||||||
|
try{
|
||||||
String[] array = {"蒙城","利辛","涡阳"};
|
String[] array = {"蒙城","利辛","涡阳"};
|
||||||
Random random = new Random();
|
Random random = new Random();
|
||||||
int index = random.nextInt(array.length);
|
int index = random.nextInt(array.length);
|
||||||
|
|
@ -361,6 +356,9 @@ public class TestMain {
|
||||||
addExercisePlan = autoWebTask.addExercisePlan("日常操练", array[index], index+1, emergencyPerson,
|
addExercisePlan = autoWebTask.addExercisePlan("日常操练", array[index], index+1, emergencyPerson,
|
||||||
emergencyPersonPassword);
|
emergencyPersonPassword);
|
||||||
Thread.sleep(2000);
|
Thread.sleep(2000);
|
||||||
|
}catch (Exception e){
|
||||||
|
log.error("日常操练出现问题", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}else if (DateTimeUtils.isEffectiveDate("12:30", "14:30")) {
|
}else if (DateTimeUtils.isEffectiveDate("12:30", "14:30")) {
|
||||||
//进行日志信息系统采集及获取工作
|
//进行日志信息系统采集及获取工作
|
||||||
|
|
@ -376,10 +374,10 @@ public class TestMain {
|
||||||
}catch (Exception e) {
|
}catch (Exception e) {
|
||||||
log.error("信息采集工作", e);
|
log.error("信息采集工作", e);
|
||||||
}
|
}
|
||||||
}else if (DateTimeUtils.isEffectiveDate("17:00", "17:40")) {
|
}else if (DateTimeUtils.isEffectiveDate("17:01", "17:29")) {
|
||||||
//自动完成当值值班日报(晚报)填写上报
|
//自动完成当值值班日报(晚报)填写上报
|
||||||
if (dailywan == 0) {
|
if (dailywan == 0) {
|
||||||
getTime(1500);
|
getTime(900);
|
||||||
try {
|
try {
|
||||||
dailywan = autoWebTask.dutyAddDailyLogsTask(2,emergencyPerson,emergencyPersonPassword);
|
dailywan = autoWebTask.dutyAddDailyLogsTask(2,emergencyPerson,emergencyPersonPassword);
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
|
|
@ -402,9 +400,6 @@ public class TestMain {
|
||||||
signOutzao2 = 0;
|
signOutzao2 = 0;
|
||||||
logzao = 0;
|
logzao = 0;
|
||||||
addExercisePlan = 0;
|
addExercisePlan = 0;
|
||||||
changeTodayPerson = 0;
|
|
||||||
} else {
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -443,10 +438,7 @@ public class TestMain {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private int randNum(int num1, int num2) {
|
private int randNum(int num1, int num2) {
|
||||||
int result = (int) (num1 + Math.random() * (num2 - num1 + 1));
|
return (int) (num1 + Math.random() * (num2 - num1 + 1));
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -155,7 +155,7 @@ public class AutoMain {
|
||||||
Thread.sleep(5000);
|
Thread.sleep(5000);
|
||||||
//执行鼠标悬停动作-管理
|
//执行鼠标悬停动作-管理
|
||||||
Actions action = new Actions(webDriver);
|
Actions action = new Actions(webDriver);
|
||||||
WebElement wegl = webDriver.findElement(By.xpath("//*[@id=\"app\"]/div/div[1]/div[5]/div/div/div[6]/span/span/div"));
|
WebElement wegl = webDriver.findElement(By.xpath("//*[@id=\"app\"]/div/div[1]/div[6]/div/div/div[6]/span/span/div"));
|
||||||
action.moveToElement(wegl).build().perform();
|
action.moveToElement(wegl).build().perform();
|
||||||
Thread.sleep(300);
|
Thread.sleep(300);
|
||||||
|
|
||||||
|
|
@ -166,7 +166,7 @@ public class AutoMain {
|
||||||
|
|
||||||
|
|
||||||
//执行鼠标悬停动作-常态值班
|
//执行鼠标悬停动作-常态值班
|
||||||
String ctzbXpath = "//*[@id=\"" + attributeId + "\"]/div/div[1]/div[2]/div[3]";
|
String ctzbXpath = "//*[@id=\"" + attributeId + "\"]/div/div[1]/div[2]/div[4]";
|
||||||
WebElement wectzb = webDriver.findElement(By.xpath(ctzbXpath));
|
WebElement wectzb = webDriver.findElement(By.xpath(ctzbXpath));
|
||||||
action.moveToElement(wectzb).build().perform();
|
action.moveToElement(wectzb).build().perform();
|
||||||
Thread.sleep(300);
|
Thread.sleep(300);
|
||||||
|
|
@ -200,7 +200,7 @@ public class AutoMain {
|
||||||
Thread.sleep(5000);
|
Thread.sleep(5000);
|
||||||
//执行鼠标悬停动作-管理
|
//执行鼠标悬停动作-管理
|
||||||
Actions action = new Actions(webDriver);
|
Actions action = new Actions(webDriver);
|
||||||
WebElement wegl = webDriver.findElement(By.xpath("//*[@id=\"app\"]/div/div[1]/div[5]/div/div/div[2]/span/span/div"));
|
WebElement wegl = webDriver.findElement(By.xpath("//*[@id=\"app\"]/div/div[1]/div[6]/div/div/div[2]/span/span/div"));
|
||||||
action.moveToElement(wegl).build().perform();
|
action.moveToElement(wegl).build().perform();
|
||||||
Thread.sleep(300);
|
Thread.sleep(300);
|
||||||
log.info("执行鼠标悬停动作-管理");
|
log.info("执行鼠标悬停动作-管理");
|
||||||
|
|
@ -239,7 +239,7 @@ public class AutoMain {
|
||||||
Thread.sleep(5000);
|
Thread.sleep(5000);
|
||||||
//执行鼠标悬停动作-管理
|
//执行鼠标悬停动作-管理
|
||||||
Actions action = new Actions(webDriver);
|
Actions action = new Actions(webDriver);
|
||||||
WebElement wegl = webDriver.findElement(By.xpath("//*[@id=\"app\"]/div/div[1]/div[5]/div/div/div[2]/span/span/div"));
|
WebElement wegl = webDriver.findElement(By.xpath("//*[@id=\"app\"]/div/div[1]/div[6]/div/div/div[2]/span/span/div"));
|
||||||
action.moveToElement(wegl).build().perform();
|
action.moveToElement(wegl).build().perform();
|
||||||
Thread.sleep(300);
|
Thread.sleep(300);
|
||||||
log.info("执行鼠标悬停动作-管理");
|
log.info("执行鼠标悬停动作-管理");
|
||||||
|
|
@ -282,7 +282,7 @@ public class AutoMain {
|
||||||
Thread.sleep(3000);
|
Thread.sleep(3000);
|
||||||
//执行鼠标悬停动作-管理
|
//执行鼠标悬停动作-管理
|
||||||
Actions action = new Actions(webDriver);
|
Actions action = new Actions(webDriver);
|
||||||
WebElement wegl = webDriver.findElement(By.xpath("//*[@id=\"app\"]/div/div[1]/div[5]/div/div/div[6]/span/span/div"));
|
WebElement wegl = webDriver.findElement(By.xpath("//*[@id=\"app\"]/div/div[1]/div[6]/div/div/div[6]/span/span/div"));
|
||||||
action.moveToElement(wegl).build().perform();
|
action.moveToElement(wegl).build().perform();
|
||||||
Thread.sleep(300);
|
Thread.sleep(300);
|
||||||
|
|
||||||
|
|
@ -293,15 +293,16 @@ public class AutoMain {
|
||||||
|
|
||||||
//执行鼠标悬停动作-检查操练管理
|
//执行鼠标悬停动作-检查操练管理
|
||||||
String ctzbXpath = "//*[@id=\"" + attributeId + "\"]/div/div[1]/div[2]/div[5]";
|
String ctzbXpath = "//*[@id=\"" + attributeId + "\"]/div/div[1]/div[2]/div[5]";
|
||||||
WebElement wectzb = webDriver.findElement(By.xpath(ctzbXpath));
|
webDriver.findElement(By.xpath(ctzbXpath)).click();
|
||||||
action.moveToElement(wectzb).build().perform();
|
// WebElement wectzb = webDriver.findElement(By.xpath(ctzbXpath));
|
||||||
|
// action.moveToElement(wectzb).build().perform();
|
||||||
Thread.sleep(300);
|
Thread.sleep(300);
|
||||||
|
|
||||||
//打开日常操练页面
|
//打开日常操练页面
|
||||||
//*[@id=\"" + attributeId + "\"]/div/div[2]/div[2]/div[1]/div[2]
|
//*[@id=\"" + attributeId + "\"]/div/div[2]/div[2]/div[1]/div[2]
|
||||||
String zbglXpath = "//*[@id=\"" + attributeId + "\"]/div/div[2]/div[2]/div/div[1]";
|
// String zbglXpath = "//*[@id=\"" + attributeId + "\"]/div/div[2]/div[2]/div/div[1]";
|
||||||
webDriver.findElement(By.xpath(zbglXpath)).click();
|
// webDriver.findElement(By.xpath(zbglXpath)).click();
|
||||||
log.info("打开日常操练页面------------");
|
// log.info("打开日常操练页面------------");
|
||||||
/* TODO 800 --> 1500 */
|
/* TODO 800 --> 1500 */
|
||||||
Thread.sleep(1500);
|
Thread.sleep(1500);
|
||||||
|
|
||||||
|
|
@ -340,7 +341,7 @@ public class AutoMain {
|
||||||
Thread.sleep(5000);
|
Thread.sleep(5000);
|
||||||
//执行鼠标悬停动作-管理
|
//执行鼠标悬停动作-管理
|
||||||
Actions action = new Actions(webDriver);
|
Actions action = new Actions(webDriver);
|
||||||
WebElement wegl = webDriver.findElement(By.xpath("//*[@id=\"app\"]/div/div[1]/div[5]/div/div/div[6]/span/span/div"));
|
WebElement wegl = webDriver.findElement(By.xpath("//*[@id=\"app\"]/div/div[1]/div[6]/div/div/div[6]/span/span/div"));
|
||||||
action.moveToElement(wegl).build().perform();
|
action.moveToElement(wegl).build().perform();
|
||||||
Thread.sleep(300);
|
Thread.sleep(300);
|
||||||
|
|
||||||
|
|
@ -351,15 +352,16 @@ public class AutoMain {
|
||||||
|
|
||||||
//执行鼠标悬停动作-检查操练管理
|
//执行鼠标悬停动作-检查操练管理
|
||||||
String ctzbXpath = "//*[@id=\"" + attributeId + "\"]/div/div[1]/div[2]/div[5]";
|
String ctzbXpath = "//*[@id=\"" + attributeId + "\"]/div/div[1]/div[2]/div[5]";
|
||||||
WebElement wectzb = webDriver.findElement(By.xpath(ctzbXpath));
|
webDriver.findElement(By.xpath(ctzbXpath)).click();
|
||||||
action.moveToElement(wectzb).build().perform();
|
// WebElement wectzb =
|
||||||
Thread.sleep(300);
|
// action.moveToElement(wectzb).build().perform();
|
||||||
|
// Thread.sleep(300);
|
||||||
|
|
||||||
//打开检查计划页面
|
//打开检查计划页面
|
||||||
//*[@id=\"" + attributeId + "\"]/div/div[2]/div[2]/div[1]/div[2]
|
//*[@id=\"" + attributeId + "\"]/div/div[2]/div[2]/div[1]/div[2]
|
||||||
String zbglXpath = "//*[@id=\"" + attributeId + "\"]/div/div[2]/div[2]/div/div[1]";
|
// String zbglXpath = "//*[@id=\"" + attributeId + "\"]/div/div[2]/div[2]/div/div[1]";
|
||||||
webDriver.findElement(By.xpath(zbglXpath)).click();
|
// webDriver.findElement(By.xpath(zbglXpath)).click();
|
||||||
log.info("打开日常操练页面------------");
|
// log.info("打开日常操练页面------------");
|
||||||
/* TODO 800 --> 1500 */
|
/* TODO 800 --> 1500 */
|
||||||
Thread.sleep(1500);
|
Thread.sleep(1500);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,12 +42,12 @@ public class DataConfig {
|
||||||
/**
|
/**
|
||||||
* 用户名4 肖国德
|
* 用户名4 肖国德
|
||||||
*/
|
*/
|
||||||
public static final String USER_NAME4 = "xiaogd1494";
|
public static final String USER_NAME4 = "bzgsajbyj01";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 密码4
|
* 密码4
|
||||||
*/
|
*/
|
||||||
public static final String PASS4 = "xgd**2271";
|
public static final String PASS4 = "Asmjm@1530";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 浏览器驱动地址
|
* 浏览器驱动地址
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ public class DutyDailyCheck {
|
||||||
|
|
||||||
//同意审核按钮点击
|
//同意审核按钮点击
|
||||||
|
|
||||||
WebElement tyCheckBtn=webDriver.findElement(By.xpath("//*[@id=\"app\"]/div/section/div/div[4]/div[1]/div[19]/button[4]"));
|
WebElement tyCheckBtn=webDriver.findElement(By.xpath("//*[@id=\"app\"]/div/section/div/div[4]/div[1]/div[16]/button[4]"));
|
||||||
if(tyCheckBtn.isDisplayed()){
|
if(tyCheckBtn.isDisplayed()){
|
||||||
//存在
|
//存在
|
||||||
log.info("同意审核按钮存在-----------");
|
log.info("同意审核按钮存在-----------");
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -3,6 +3,7 @@ package com.bonus.autoweb.base;
|
||||||
import com.bonus.autoweb.DateTimeUtils;
|
import com.bonus.autoweb.DateTimeUtils;
|
||||||
import com.bonus.autoweb.TestMain;
|
import com.bonus.autoweb.TestMain;
|
||||||
import com.bonus.autoweb.UI.entity.LogBean;
|
import com.bonus.autoweb.UI.entity.LogBean;
|
||||||
|
import com.bonus.autoweb.UI.frame.StringHelper;
|
||||||
import com.thoughtworks.xstream.XStream;
|
import com.thoughtworks.xstream.XStream;
|
||||||
import com.thoughtworks.xstream.io.json.JettisonMappedXmlDriver;
|
import com.thoughtworks.xstream.io.json.JettisonMappedXmlDriver;
|
||||||
import org.openqa.selenium.By;
|
import org.openqa.selenium.By;
|
||||||
|
|
@ -182,26 +183,38 @@ public class DutyLogIOp {
|
||||||
LogBean bean = (LogBean) xstream.fromXML(xml);
|
LogBean bean = (LogBean) xstream.fromXML(xml);
|
||||||
|
|
||||||
|
|
||||||
// //输入天气
|
//输入天气
|
||||||
// String tq = bean.getWeather();
|
String tq = bean.getWeather();
|
||||||
//// /html/body/div[3]/div/div[2]/div/form/div[3]/div/div/div[3]/div/div/div[1]/input
|
// /html/body/div[3]/div/div[2]/div/form/div[3]/div/div/div[3]/div/div/div[1]/input
|
||||||
// webDriver.findElement(By.xpath("/html/body/div[3]/div/div[2]/div/form/div[3]/div/div/div[5]/div/div/div/input")).sendKeys(tq);
|
WebElement weatherElement = webDriver.findElement(By.xpath("/html/body/div[3]/div/div[2]/div/form/div[3]/div/div/div[5]/div/div/div/input"));
|
||||||
// log.info("输入天气----------");
|
if (StringHelper.isEmptyAndNull(weatherElement.getText())){
|
||||||
// Thread.sleep(500);
|
weatherElement.clear();
|
||||||
|
weatherElement.sendKeys(tq);
|
||||||
|
log.info("输入天气----------");
|
||||||
|
}
|
||||||
|
Thread.sleep(500);
|
||||||
|
|
||||||
// //输入最低气温
|
//输入最低气温
|
||||||
// String zdqw = bean.getMin_temperature();
|
String zdqw = bean.getMin_temperature();
|
||||||
//// /html/body/div[3]/div/div[2]/div/form/div[3]/div/div/div[4]/div/div/div[1]/input
|
// /html/body/div[3]/div/div[2]/div/form/div[3]/div/div/div[4]/div/div/div[1]/input
|
||||||
// webDriver.findElement(By.xpath("/html/body/div[3]/div/div[2]/div/form/div[3]/div/div/div[7]/div/div/div/input")).sendKeys(zdqw);
|
WebElement minTemperatureElement = webDriver.findElement(By.xpath("/html/body/div[3]/div/div[2]/div/form/div[3]/div/div/div[7]/div/div/div/input"));
|
||||||
// log.info("输入最高气温----------");
|
if (StringHelper.isEmptyAndNull(minTemperatureElement.getText())){
|
||||||
// Thread.sleep(500);
|
minTemperatureElement.clear();
|
||||||
|
minTemperatureElement.sendKeys(zdqw);
|
||||||
|
log.info("输入最低气温----------");
|
||||||
|
}
|
||||||
|
Thread.sleep(500);
|
||||||
|
|
||||||
// //输入最高气温
|
//输入最高气温
|
||||||
// String zgqw = bean.getMax_temperature();
|
String zgqw = bean.getMax_temperature();
|
||||||
//// /html/body/div[3]/div/div[2]/div/form/div[3]/div/div/div[4]/div/div/div[1]/input
|
// /html/body/div[3]/div/div[2]/div/form/div[3]/div/div/div[4]/div/div/div[1]/input
|
||||||
// webDriver.findElement(By.xpath("/html/body/div[3]/div/div[2]/div/form/div[3]/div/div/div[9]/div/div/div/input")).sendKeys(zgqw);
|
WebElement maxTemperatureElement = webDriver.findElement(By.xpath("/html/body/div[3]/div/div[2]/div/form/div[3]/div/div/div[9]/div/div/div/input"));
|
||||||
// log.info("输入最高气温----------");
|
if (StringHelper.isEmptyAndNull(maxTemperatureElement.getText())){
|
||||||
// Thread.sleep(500);
|
maxTemperatureElement.clear();
|
||||||
|
maxTemperatureElement.sendKeys(zgqw);
|
||||||
|
log.info("输入最高气温----------");
|
||||||
|
}
|
||||||
|
Thread.sleep(500);
|
||||||
|
|
||||||
//事件监测 标题
|
//事件监测 标题
|
||||||
String sjjc_title = bean.getEvent_detection_title();
|
String sjjc_title = bean.getEvent_detection_title();
|
||||||
|
|
|
||||||
|
|
@ -155,15 +155,21 @@ public class AutoWebTask {
|
||||||
autoMain.startAuto(username, password);
|
autoMain.startAuto(username, password);
|
||||||
//操作日志
|
//操作日志
|
||||||
webDriver = autoMain.getWebDriver();
|
webDriver = autoMain.getWebDriver();
|
||||||
|
//将日期改为今天的日期
|
||||||
|
webDriver.findElement(By.xpath("//*[@id=\"app\"]/div/section/main/div/div[1]/div[1]/div[3]/div[1]/div[2]/div/button[2]")).click();
|
||||||
|
log.info("将日期选择回当日----------");
|
||||||
|
Thread.sleep(1000);
|
||||||
//获取账号姓名 和 账号名
|
//获取账号姓名 和 账号名
|
||||||
WebElement personNameEle = webDriver.findElement(By.xpath("//*[@id='pane-1']/div/div[3]/div/div/div[3" +
|
WebElement personNameEle = webDriver.findElement(By.xpath("//*[@id='pane-1']/div/div[3]/div/div/div[3" +
|
||||||
"]/table/tbody/tr[2]/td[2]/div/div/p[1]"));
|
"]/table/tbody/tr[2]/td[2]/div/div/p[1]"));
|
||||||
String personName = personNameEle.getText();
|
String personName = personNameEle.getText();
|
||||||
log.info("今日值班人员:" + personName);
|
log.info("今日值班人员:" + personName);
|
||||||
WebElement accountEle = webDriver.findElement(By.xpath("//*[@id='pane-1']/div/div[3]/div/div/div[3" +
|
|
||||||
"]/table/tbody/tr[2]/td[2]/div/div/p[2]"));
|
// WebElement accountEle = webDriver.findElement(By.xpath("//*[@id='pane-1']/div/div[3]/div/div/div[3" +
|
||||||
String account = accountEle.getText();
|
// "]/table/tbody/tr[2]/td[2]/div/div/p[2]"));
|
||||||
log.info("今日值班人员账号:" + account);
|
// String account = accountEle.getText();
|
||||||
|
// log.info("今日值班人员账号:" + account);
|
||||||
|
|
||||||
excelFile = new FileInputStream("E:\\bns\\config\\zhibanaccount.xlsx");
|
excelFile = new FileInputStream("E:\\bns\\config\\zhibanaccount.xlsx");
|
||||||
workbook = new XSSFWorkbook(excelFile);
|
workbook = new XSSFWorkbook(excelFile);
|
||||||
Sheet datatypeSheet = workbook.getSheetAt(0);
|
Sheet datatypeSheet = workbook.getSheetAt(0);
|
||||||
|
|
@ -173,7 +179,7 @@ public class AutoWebTask {
|
||||||
value += cell.getStringCellValue() + "]]]";
|
value += cell.getStringCellValue() + "]]]";
|
||||||
}
|
}
|
||||||
value = value.substring(0, value.length() - 3);
|
value = value.substring(0, value.length() - 3);
|
||||||
if (value.contains(account)) {
|
if (value.contains(personName)) {
|
||||||
System.out.println("今天:" + value);
|
System.out.println("今天:" + value);
|
||||||
AutoUtils.write("E:\\bns\\config\\今日值班账号.txt", "今日账号:" + value.split("]]]")[1] + ";密码:" + value.split(
|
AutoUtils.write("E:\\bns\\config\\今日值班账号.txt", "今日账号:" + value.split("]]]")[1] + ";密码:" + value.split(
|
||||||
"]]]")[2]);
|
"]]]")[2]);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue