refactor(path): 更新文件路径和浏览器配置
- 更新 DataConfig 中的 URL 和驱动路径 - 修改 DutyLogIOp 中的元素定位方式 - 调整 GetBasicData 中的文件读取路径 - 修改日志输出路径
This commit is contained in:
parent
76f287f6e2
commit
85716e216b
|
|
@ -247,7 +247,8 @@ public class GetBasicData {
|
||||||
public void getYuJingBasicData(int classes) throws ParseException, InterruptedException {
|
public void getYuJingBasicData(int classes) throws ParseException, InterruptedException {
|
||||||
Thread.sleep(5000);
|
Thread.sleep(5000);
|
||||||
String code = "";
|
String code = "";
|
||||||
String code_child = "共安排抢险队伍12支,合计167人(主业159人、外包8人)、车辆12台、发电机4台值守待命,准备照明灯具40套、配变10台、电缆5千米、电杆50根、绝缘子100只。";
|
|
||||||
|
String code_child = "灵璧公司安排抢修以伍12支(主网10支,配网2支)、车辆12台、发电机1台、照明灯40套、配变10台、箱变4台、电缆1千米、电杆50根、金具50套、绝缘子100串。";
|
||||||
String code_chlid2 = "针对此次预警,今日宿州灵璧供电公司开展预警响应,对重要保电线路、变电站进行特巡,安排抢修队伍、绑定应急车辆、装备,抢修队长,通过i" +
|
String code_chlid2 = "针对此次预警,今日宿州灵璧供电公司开展预警响应,对重要保电线路、变电站进行特巡,安排抢修队伍、绑定应急车辆、装备,抢修队长,通过i" +
|
||||||
"国网反馈巡视照片、视频,在新一代系统里均形成巡视记录、车辆队伍轨迹,未发现问题。";
|
"国网反馈巡视照片、视频,在新一代系统里均形成巡视记录、车辆队伍轨迹,未发现问题。";
|
||||||
//判断是否有发布数据
|
//判断是否有发布数据
|
||||||
|
|
@ -284,8 +285,8 @@ public class GetBasicData {
|
||||||
DailyBean dailyBean = readDailyBean("morning_daily");
|
DailyBean dailyBean = readDailyBean("morning_daily");
|
||||||
DailyBean dailyBean2 = readDailyBean("evening_daily");
|
DailyBean dailyBean2 = readDailyBean("evening_daily");
|
||||||
LogBean logBean = readDutyBean();
|
LogBean logBean = readDutyBean();
|
||||||
String dailyContent = resolveGarbledCode("E:\\bns\\config\\日报基本信息.txt");
|
String dailyContent = resolveGarbledCode("D:\\bns\\config\\日报基本信息.txt");
|
||||||
String logContent = resolveGarbledCode("E:\\bns\\config\\日志基本信息.txt");
|
String logContent = resolveGarbledCode("D:\\bns\\config\\日志基本信息.txt");
|
||||||
String[] dailyContentArrayArray = dailyContent.split("--头部不可修改--");
|
String[] dailyContentArrayArray = dailyContent.split("--头部不可修改--");
|
||||||
String[] logContentArrayArray = logContent.split("--头部不可修改--");
|
String[] logContentArrayArray = logContent.split("--头部不可修改--");
|
||||||
log.info("dailyContent:" + dailyContent);
|
log.info("dailyContent:" + dailyContent);
|
||||||
|
|
@ -313,7 +314,7 @@ public class GetBasicData {
|
||||||
logBean.setGeneral_chronicles_content(logBean.getGeneral_chronicles_content());
|
logBean.setGeneral_chronicles_content(logBean.getGeneral_chronicles_content());
|
||||||
insertData(null, logBean, "log");
|
insertData(null, logBean, "log");
|
||||||
log.info("天气预警日志更新完成");
|
log.info("天气预警日志更新完成");
|
||||||
dailyBean.setWarning_company(data+code + dailyContentArrayArray[20]+code_chlid2);
|
dailyBean.setWarning_company(data+code + code_child + dailyContentArrayArray[20]+code_chlid2);
|
||||||
|
|
||||||
//一、总体情况
|
//一、总体情况
|
||||||
dailyBean.setOverall(data + dailyContentArrayArray[2].trim() + (classes == 1 ? data3+"08:30," : data2+"17:30" +
|
dailyBean.setOverall(data + dailyContentArrayArray[2].trim() + (classes == 1 ? data3+"08:30," : data2+"17:30" +
|
||||||
|
|
@ -325,7 +326,7 @@ public class GetBasicData {
|
||||||
",") + dailyContentArrayArray[3].trim() + code +
|
",") + dailyContentArrayArray[3].trim() + code +
|
||||||
"对系统检测图层中气象实况风速、温度、降雨进行查看、对专题灾害图层地震、台风防汛进行查看均正常,未对宿州灵璧辖区造成影响。通过首页公共气象图层检查宿州灵璧内公共预警正常;降雨预报、预警正常;雷达预报正常。");
|
"对系统检测图层中气象实况风速、温度、降雨进行查看、对专题灾害图层地震、台风防汛进行查看均正常,未对宿州灵璧辖区造成影响。通过首页公共气象图层检查宿州灵璧内公共预警正常;降雨预报、预警正常;雷达预报正常。");
|
||||||
dailyBean2.setPersonnel_daily_work(dailyBean2.getPersonnel_daily_work());
|
dailyBean2.setPersonnel_daily_work(dailyBean2.getPersonnel_daily_work());
|
||||||
dailyBean2.setWarning_company(data+code+ dailyContentArrayArray[20]+code_chlid2);
|
dailyBean2.setWarning_company(data+code+ code_child + dailyContentArrayArray[20]+code_chlid2);
|
||||||
insertData(dailyBean, null, "morning_daily");
|
insertData(dailyBean, null, "morning_daily");
|
||||||
insertData(dailyBean2, null, "evening_daily");
|
insertData(dailyBean2, null, "evening_daily");
|
||||||
log.info("日志内容:" + readDutyBean());
|
log.info("日志内容:" + readDutyBean());
|
||||||
|
|
@ -337,10 +338,10 @@ public class GetBasicData {
|
||||||
DailyBean dailyBean = readDailyBean("morning_daily");
|
DailyBean dailyBean = readDailyBean("morning_daily");
|
||||||
DailyBean dailyBean2 = readDailyBean("evening_daily");
|
DailyBean dailyBean2 = readDailyBean("evening_daily");
|
||||||
LogBean logBean = readDutyBean();
|
LogBean logBean = readDutyBean();
|
||||||
String dailyContent = resolveGarbledCode("E:\\bns\\config\\日报基本信息.txt");
|
String dailyContent = resolveGarbledCode("D:\\bns\\config\\日报基本信息.txt");
|
||||||
String checkContent = resolveGarbledCode("E:\\bns\\config\\资源核查情况.txt");
|
String checkContent = resolveGarbledCode("D:\\bns\\config\\资源核查情况.txt");
|
||||||
String logContent = resolveGarbledCode("E:\\bns\\config\\日志基本信息.txt");
|
String logContent = resolveGarbledCode("D:\\bns\\config\\日志基本信息.txt");
|
||||||
String videoContent = resolveGarbledCode("E:\\bns\\config\\变电站名称.txt");
|
String videoContent = resolveGarbledCode("D:\\bns\\config\\变电站名称.txt");
|
||||||
String[] dailyContentArrayArray = dailyContent.split("--头部不可修改--");
|
String[] dailyContentArrayArray = dailyContent.split("--头部不可修改--");
|
||||||
String[] logContentArrayArray = logContent.split("--头部不可修改--");
|
String[] logContentArrayArray = logContent.split("--头部不可修改--");
|
||||||
String[] checkContentArrayArray = checkContent.split("资源核查情况:");
|
String[] checkContentArrayArray = checkContent.split("资源核查情况:");
|
||||||
|
|
@ -573,10 +574,10 @@ public class GetBasicData {
|
||||||
DailyBean dailyBean = readDailyBean("morning_daily");
|
DailyBean dailyBean = readDailyBean("morning_daily");
|
||||||
DailyBean dailyBean2 = readDailyBean("evening_daily");
|
DailyBean dailyBean2 = readDailyBean("evening_daily");
|
||||||
LogBean logBean = readDutyBean();
|
LogBean logBean = readDutyBean();
|
||||||
String dailyContent = resolveGarbledCode("E:\\bns\\config\\日报基本信息.txt");
|
String dailyContent = resolveGarbledCode("D:\\bns\\config\\日报基本信息.txt");
|
||||||
String checkContent = resolveGarbledCode("E:\\bns\\config\\资源核查情况.txt");
|
String checkContent = resolveGarbledCode("D:\\bns\\config\\资源核查情况.txt");
|
||||||
String logContent = resolveGarbledCode("E:\\bns\\config\\日志基本信息.txt");
|
String logContent = resolveGarbledCode("D:\\bns\\config\\日志基本信息.txt");
|
||||||
String videoContent = resolveGarbledCode("E:\\bns\\config\\变电站名称.txt");
|
String videoContent = resolveGarbledCode("D:\\bns\\config\\变电站名称.txt");
|
||||||
String[] dailyContentArrayArray = dailyContent.split("--头部不可修改--");
|
String[] dailyContentArrayArray = dailyContent.split("--头部不可修改--");
|
||||||
String[] logContentArrayArray = logContent.split("--头部不可修改--");
|
String[] logContentArrayArray = logContent.split("--头部不可修改--");
|
||||||
String[] checkContentArrayArray = checkContent.split("资源核查情况:");
|
String[] checkContentArrayArray = checkContent.split("资源核查情况:");
|
||||||
|
|
@ -653,7 +654,7 @@ public class GetBasicData {
|
||||||
|
|
||||||
private void executePlan(String type, String company, String projectName) throws InterruptedException {
|
private void executePlan(String type, String company, String projectName) throws InterruptedException {
|
||||||
Thread.sleep(2000);
|
Thread.sleep(2000);
|
||||||
String checkContent = resolveGarbledCode("E:\\bns\\config\\检查计划评价.txt");
|
String checkContent = resolveGarbledCode("D:\\bns\\config\\检查计划评价.txt");
|
||||||
String[] checkContentArrayArray = checkContent.split("检查评价:");
|
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("/html/body/div[1]/section/div[1]/div[2]/div[2]/section/main/section/main/div/div[3]/table/tbody/tr[1]")).click();
|
||||||
|
|
@ -781,29 +782,29 @@ public class GetBasicData {
|
||||||
webDriver.findElement(By.xpath("/html/body/div[6]/div[1]/div/div/div[1]/div[1]/span[2]")).click();
|
webDriver.findElement(By.xpath("/html/body/div[6]/div[1]/div/div/div[1]/div[1]/span[2]")).click();
|
||||||
log.info("选择被检查单位----------");
|
log.info("选择被检查单位----------");
|
||||||
Thread.sleep(500);
|
Thread.sleep(500);
|
||||||
//选择被检查对象
|
// //选择被检查对象
|
||||||
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/main/div[1]/div[3]/table/tbody/tr[1]/td[1]/div/label")).click();
|
// 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);
|
// Thread.sleep(500);
|
||||||
webDriver.findElement(By.xpath("/html/body/div[7]/div/div[2]/section/main/div[1]/div[3]/table/tbody/tr[2" +
|
// 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();
|
// "]/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();
|
// webDriver.findElement(By.xpath("/html/body/div[7]/div/div[2]/section/footer/button[2]")).click();
|
||||||
Thread.sleep(2000);
|
// Thread.sleep(2000);
|
||||||
}else {
|
// }else {
|
||||||
for (int i = 1; i < 5; i++) {
|
// 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" +
|
// 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();
|
// "/tbody/tr["+i+"]/td[1]/div/label")).click();
|
||||||
Thread.sleep(1000);
|
// Thread.sleep(1000);
|
||||||
}
|
// }
|
||||||
webDriver.findElement(By.xpath("/html/body/div[7]/div/div[2]/section/footer[2]/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);
|
||||||
}
|
// }
|
||||||
Thread.sleep(3000);
|
Thread.sleep(3000);
|
||||||
//提交
|
//提交
|
||||||
webDriver.findElement(By.xpath("/html/body/div[2]/div/div[2]/section/div/button[3]")).click();
|
webDriver.findElement(By.xpath("/html/body/div[4]/div/div[2]/section/div/button[3]")).click();
|
||||||
Thread.sleep(3000);
|
Thread.sleep(3000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -310,7 +310,7 @@ public class TestMain {
|
||||||
DataConfig.PASS1);
|
DataConfig.PASS1);
|
||||||
Thread.sleep(2000);
|
Thread.sleep(2000);
|
||||||
}
|
}
|
||||||
} else if (DateTimeUtils.isEffectiveDate("12:30", "16:20")) {
|
}else if (DateTimeUtils.isEffectiveDate("12:30", "16:20")) {
|
||||||
//进行日志信息系统采集及获取工作
|
//进行日志信息系统采集及获取工作
|
||||||
try {
|
try {
|
||||||
if (logGatherCount1 == 0){
|
if (logGatherCount1 == 0){
|
||||||
|
|
@ -336,6 +336,7 @@ public class TestMain {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else if (DateTimeUtils.isEffectiveDate("16:30", "16:45")) {
|
}else if (DateTimeUtils.isEffectiveDate("16:30", "16:45")) {
|
||||||
|
// }else if (DateTimeUtils.isEffectiveDate("10:00", "16:45")) {
|
||||||
//完成值班日志填写提交(白班日志,此次值班日志为总结前一天晚上的情况)
|
//完成值班日志填写提交(白班日志,此次值班日志为总结前一天晚上的情况)
|
||||||
if (logwan == 0) {
|
if (logwan == 0) {
|
||||||
getTime(600);
|
getTime(600);
|
||||||
|
|
@ -503,7 +504,7 @@ public class TestMain {
|
||||||
// 设置文件输出流格式
|
// 设置文件输出流格式
|
||||||
Dispatch.putRef(spFileStream, "Format", spAudioFormat);
|
Dispatch.putRef(spFileStream, "Format", spAudioFormat);
|
||||||
// 调用输出 文件流打开方法,创建一个.wav文件
|
// 调用输出 文件流打开方法,创建一个.wav文件
|
||||||
Dispatch.call(spFileStream, "Open", new Variant("E:\\bns\\audio.wav"), new Variant(3), new Variant(true));
|
Dispatch.call(spFileStream, "Open", new Variant("D:\\bns\\audio.wav"), new Variant(3), new Variant(true));
|
||||||
// 设置声音对象的音频输出流为输出文件对象
|
// 设置声音对象的音频输出流为输出文件对象
|
||||||
Dispatch.putRef(spVoice, "AudioOutputStream", spFileStream);
|
Dispatch.putRef(spVoice, "AudioOutputStream", spFileStream);
|
||||||
// 设置音量 0到100
|
// 设置音量 0到100
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,8 @@ public class AutoMain {
|
||||||
option.setBinary("C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe");
|
option.setBinary("C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe");
|
||||||
|
|
||||||
option.addArguments("--start-maximized");
|
option.addArguments("--start-maximized");
|
||||||
option.addArguments("--force-device-scale-factor=0.75");
|
// option.addArguments("--force-device-scale-factor=0.75");
|
||||||
|
option.addArguments("--force-device-scale-factor=0.6");
|
||||||
option.addArguments("disable-infobars");
|
option.addArguments("disable-infobars");
|
||||||
// if(type != 7) {
|
// if(type != 7) {
|
||||||
// //隐藏浏览器
|
// //隐藏浏览器
|
||||||
|
|
@ -211,17 +212,6 @@ public class AutoMain {
|
||||||
String attributeId = wegl.getAttribute("aria-describedby");
|
String attributeId = wegl.getAttribute("aria-describedby");
|
||||||
log.info("管理标签的ID值为:" + attributeId);
|
log.info("管理标签的ID值为:" + attributeId);
|
||||||
Thread.sleep(300);
|
Thread.sleep(300);
|
||||||
|
|
||||||
|
|
||||||
// //执行鼠标悬停动作-常态值班
|
|
||||||
// String ctzbXpath = "//*[@id=\"" + attributeId + "\"]/div/div[1]/div[2]/div[3]";
|
|
||||||
// WebElement wectzb = webDriver.findElement(By.xpath(ctzbXpath));
|
|
||||||
// action.moveToElement(wectzb).build().perform();
|
|
||||||
// Thread.sleep(300);
|
|
||||||
|
|
||||||
|
|
||||||
//打开预警响应管理页面
|
|
||||||
//*[@id=\"" + attributeId + "\"]/div/div[2]/div[2]/div[1]/div[2]
|
|
||||||
String zbglXpath = "//*[@id=\"" + attributeId + "\"]/div/div/div[2]/div[3]";
|
String zbglXpath = "//*[@id=\"" + attributeId + "\"]/div/div/div[2]/div[3]";
|
||||||
webDriver.findElement(By.xpath(zbglXpath)).click();
|
webDriver.findElement(By.xpath(zbglXpath)).click();
|
||||||
log.info("打开预警页面------------");
|
log.info("打开预警页面------------");
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ public class DataConfig {
|
||||||
/**
|
/**
|
||||||
* url 网站地址
|
* url 网站地址
|
||||||
*/
|
*/
|
||||||
protected static final String URL = "http://20.50.16.10/ecs/#/yjtsgz";
|
protected static final String URL = "http://xydyjzh.ah.sgcc.com.cn";
|
||||||
/**
|
/**
|
||||||
* 驱动名称
|
* 驱动名称
|
||||||
*/
|
*/
|
||||||
|
|
@ -35,11 +35,11 @@ public class DataConfig {
|
||||||
/**
|
/**
|
||||||
* 浏览器驱动地址
|
* 浏览器驱动地址
|
||||||
*/
|
*/
|
||||||
protected static final String drivePath = "E:\\bns\\chromedriver_win32\\chromedriver.exe";
|
protected static final String drivePath = "D:\\bns\\chromedriver_win32\\chromedriver.exe";
|
||||||
/**
|
/**
|
||||||
* 文件地址
|
* 文件地址
|
||||||
*/
|
*/
|
||||||
public static final String filePath = "E:\\bns\\config";
|
public static final String filePath = "D:\\bns\\config";
|
||||||
|
|
||||||
public static String weatherUrl =
|
public static String weatherUrl =
|
||||||
"http://10.138.4.27:9021/EPCIM/control/ypdgt/qxyj/getQXYJ?city=灵璧&rectime="+ DateTimeUtils.getCurrentDay();
|
"http://10.138.4.27:9021/EPCIM/control/ypdgt/qxyj/getQXYJ?city=灵璧&rectime="+ DateTimeUtils.getCurrentDay();
|
||||||
|
|
|
||||||
|
|
@ -37,9 +37,9 @@ public class DutyDailyCheck {
|
||||||
String checkXpath;
|
String checkXpath;
|
||||||
//早报
|
//早报
|
||||||
if(type ==1){
|
if(type ==1){
|
||||||
checkXpath="//*[@id=\"pane-4\"]/div/div[3]/div/div/div[3]/table/tbody/tr[1]/td[5]/div/p[2]";
|
checkXpath="//*[@id=\"pane-4\"]/div/div[3]/div/div/div[3]/table/tbody/tr[1]/td[5]/div/div/p[2]";
|
||||||
}else{
|
}else{
|
||||||
checkXpath="//*[@id=\"pane-4\"]/div/div[3]/div/div/div[3]/table/tbody/tr[2]/td[5]/div/p[2]";
|
checkXpath="//*[@id=\"pane-4\"]/div/div[3]/div/div/div[3]/table/tbody/tr[2]/td[5]/div/div/p[2]";
|
||||||
}
|
}
|
||||||
|
|
||||||
//点击审核按钮
|
//点击审核按钮
|
||||||
|
|
|
||||||
|
|
@ -49,9 +49,9 @@ public class DutyDailyOp {
|
||||||
Thread.sleep(500);
|
Thread.sleep(500);
|
||||||
|
|
||||||
//早报编辑标签定位
|
//早报编辑标签定位
|
||||||
String zaoBxPath = "//*[@id=\"pane-4\"]/div/div[3]/div/div/div[3]/table/tbody/tr[1]/td[5]/div/p[1]";
|
String zaoBxPath = "//*[@id=\"pane-4\"]/div/div[3]/div/div/div[3]/table/tbody/tr[1]/td[5]/div/div/p[1]";
|
||||||
//晚报编辑标签定位
|
//晚报编辑标签定位
|
||||||
String wanBxpath = "//*[@id=\"pane-4\"]/div/div[3]/div/div/div[3]/table/tbody/tr[2]/td[5]/div/p[1]";
|
String wanBxpath = "//*[@id=\"pane-4\"]/div/div[3]/div/div/div[3]/table/tbody/tr[2]/td[5]/div/div/p[1]";
|
||||||
if (type == 1) {
|
if (type == 1) {
|
||||||
webDriver.findElement(By.xpath(zaoBxPath)).click();
|
webDriver.findElement(By.xpath(zaoBxPath)).click();
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -379,21 +379,21 @@ public class DutyDailyOp {
|
||||||
|
|
||||||
//操作附表3 无
|
//操作附表3 无
|
||||||
// private void dailySchedule3(AnnexThreeBean obj, DailyBean bean) throws InterruptedException {
|
// private void dailySchedule3(AnnexThreeBean obj, DailyBean bean) throws InterruptedException {
|
||||||
//// //填写合计-新增-确诊
|
// //填写合计-新增-确诊
|
||||||
//// String totalAddDiagnosedNum = obj.getTotalAddDiagnosed();
|
// String totalAddDiagnosedNum = obj.getTotalAddDiagnosed();
|
||||||
//// WebElement totalAddDiagnosedEle= webDriver.findElement(By.xpath("//*[@id=\"app\"]/div/section/div/div[4]/div[1]/div[2]/div[2]/div/div/div[3]/table/tbody/tr/td[3]/div/div/input"));
|
// WebElement totalAddDiagnosedEle= webDriver.findElement(By.xpath("//*[@id=\"app\"]/div/section/div/div[4]/div[1]/div[2]/div[2]/div/div/div[3]/table/tbody/tr/td[3]/div/div/input"));
|
||||||
//// totalAddDiagnosedEle.clear();
|
// totalAddDiagnosedEle.clear();
|
||||||
//// totalAddDiagnosedEle.sendKeys(totalAddDiagnosedNum);
|
// totalAddDiagnosedEle.sendKeys(totalAddDiagnosedNum);
|
||||||
//// log.info("填写合计-新增-确诊----------");
|
// log.info("填写合计-新增-确诊----------");
|
||||||
//// Thread.sleep(300);
|
// Thread.sleep(300);
|
||||||
////
|
//
|
||||||
//// //填写合计-现有-确诊
|
// //填写合计-现有-确诊
|
||||||
//// String totalExistingDiagnosedNum = obj.getTotalExistingDiagnosed();
|
// String totalExistingDiagnosedNum = obj.getTotalExistingDiagnosed();
|
||||||
//// WebElement totalExistingDiagnosedNumEle= webDriver.findElement(By.xpath("//*[@id=\"app\"]/div/section/div/div[4]/div[1]/div[2]/div[2]/div/div/div[3]/table/tbody/tr/td[4]/div/div/input"));
|
// WebElement totalExistingDiagnosedNumEle= webDriver.findElement(By.xpath("//*[@id=\"app\"]/div/section/div/div[4]/div[1]/div[2]/div[2]/div/div/div[3]/table/tbody/tr/td[4]/div/div/input"));
|
||||||
//// totalExistingDiagnosedNumEle.clear();
|
// totalExistingDiagnosedNumEle.clear();
|
||||||
//// totalExistingDiagnosedNumEle.sendKeys(totalExistingDiagnosedNum);
|
// totalExistingDiagnosedNumEle.sendKeys(totalExistingDiagnosedNum);
|
||||||
//// log.info("填写合计-现有-确诊----------");
|
// log.info("填写合计-现有-确诊----------");
|
||||||
//// Thread.sleep(300);
|
// Thread.sleep(300);
|
||||||
//
|
//
|
||||||
// try {
|
// try {
|
||||||
// //填写电网调度-新增-确诊
|
// //填写电网调度-新增-确诊
|
||||||
|
|
@ -485,21 +485,21 @@ public class DutyDailyOp {
|
||||||
// log.info("填写电网建设-新增-确诊不存在此元素----------");
|
// log.info("填写电网建设-新增-确诊不存在此元素----------");
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
//// //填写合计-新增-治愈
|
// //填写合计-新增-治愈
|
||||||
//// String totalAddHealNum = obj.getTotalAddHeal();
|
// String totalAddHealNum = obj.getTotalAddHeal();
|
||||||
//// WebElement totalAddHealEle= webDriver.findElement(By.xpath("//*[@id=\"app\"]/div/section/div/div[4]/div[1]/div[2]/div[2]/div/div/div[3]/table/tbody/tr/td[3]/div/div/input"));
|
// WebElement totalAddHealEle= webDriver.findElement(By.xpath("//*[@id=\"app\"]/div/section/div/div[4]/div[1]/div[2]/div[2]/div/div/div[3]/table/tbody/tr/td[3]/div/div/input"));
|
||||||
//// totalAddHealEle.clear();
|
// totalAddHealEle.clear();
|
||||||
//// totalAddHealEle.sendKeys(totalAddHealNum);
|
// totalAddHealEle.sendKeys(totalAddHealNum);
|
||||||
//// log.info("填写合计-新增-治愈----------");
|
// log.info("填写合计-新增-治愈----------");
|
||||||
//// Thread.sleep(300);
|
// Thread.sleep(300);
|
||||||
////
|
//
|
||||||
//// //填写合计-现有-治愈
|
// //填写合计-现有-治愈
|
||||||
//// String totalExistingHealNum = obj.getTotalExistingHeal();
|
// String totalExistingHealNum = obj.getTotalExistingHeal();
|
||||||
//// WebElement totalExistingHealNumEle= webDriver.findElement(By.xpath("//*[@id=\"app\"]/div/section/div/div[4]/div[1]/div[2]/div[2]/div/div/div[3]/table/tbody/tr/td[4]/div/div/input"));
|
// WebElement totalExistingHealNumEle= webDriver.findElement(By.xpath("//*[@id=\"app\"]/div/section/div/div[4]/div[1]/div[2]/div[2]/div/div/div[3]/table/tbody/tr/td[4]/div/div/input"));
|
||||||
//// totalExistingHealNumEle.clear();
|
// totalExistingHealNumEle.clear();
|
||||||
//// totalExistingHealNumEle.sendKeys(totalExistingHealNum);
|
// totalExistingHealNumEle.sendKeys(totalExistingHealNum);
|
||||||
//// log.info("填写合计-现有-治愈----------");
|
// log.info("填写合计-现有-治愈----------");
|
||||||
//// Thread.sleep(300);
|
// Thread.sleep(300);
|
||||||
//
|
//
|
||||||
// try {
|
// try {
|
||||||
// //填写电网调度-新增-治愈
|
// //填写电网调度-新增-治愈
|
||||||
|
|
@ -575,21 +575,21 @@ public class DutyDailyOp {
|
||||||
// constructionExistingHealEle.sendKeys(constructionExistingHealNum);
|
// constructionExistingHealEle.sendKeys(constructionExistingHealNum);
|
||||||
// log.info("填写营销服务-现有-治愈----------");
|
// log.info("填写营销服务-现有-治愈----------");
|
||||||
//
|
//
|
||||||
//// //填写合计-新增-疑似
|
// //填写合计-新增-疑似
|
||||||
//// String totalAddSuspectedNum = obj.getTotalAddSuspected();
|
// String totalAddSuspectedNum = obj.getTotalAddSuspected();
|
||||||
//// WebElement totalAddSuspectedEle= webDriver.findElement(By.xpath("//*[@id=\"app\"]/div/section/div/div[4]/div[1]/div[2]/div[2]/div/div/div[3]/table/tbody/tr/td[3]/div/div/input"));
|
// WebElement totalAddSuspectedEle= webDriver.findElement(By.xpath("//*[@id=\"app\"]/div/section/div/div[4]/div[1]/div[2]/div[2]/div/div/div[3]/table/tbody/tr/td[3]/div/div/input"));
|
||||||
//// totalAddSuspectedEle.clear();
|
// totalAddSuspectedEle.clear();
|
||||||
//// totalAddSuspectedEle.sendKeys(totalAddSuspectedNum);
|
// totalAddSuspectedEle.sendKeys(totalAddSuspectedNum);
|
||||||
//// log.info("填写合计-新增-疑似----------");
|
// log.info("填写合计-新增-疑似----------");
|
||||||
//// Thread.sleep(300);
|
// Thread.sleep(300);
|
||||||
////
|
//
|
||||||
//// //填写合计-现有-疑似
|
// //填写合计-现有-疑似
|
||||||
//// String totalExistingSuspectedNum = obj.getTotalExistingSuspected();
|
// String totalExistingSuspectedNum = obj.getTotalExistingSuspected();
|
||||||
//// WebElement totalExistingSuspectedNumEle= webDriver.findElement(By.xpath("//*[@id=\"app\"]/div/section/div/div[4]/div[1]/div[2]/div[2]/div/div/div[3]/table/tbody/tr/td[4]/div/div/input"));
|
// WebElement totalExistingSuspectedNumEle= webDriver.findElement(By.xpath("//*[@id=\"app\"]/div/section/div/div[4]/div[1]/div[2]/div[2]/div/div/div[3]/table/tbody/tr/td[4]/div/div/input"));
|
||||||
//// totalExistingSuspectedNumEle.clear();
|
// totalExistingSuspectedNumEle.clear();
|
||||||
//// totalExistingSuspectedNumEle.sendKeys(totalExistingSuspectedNum);
|
// totalExistingSuspectedNumEle.sendKeys(totalExistingSuspectedNum);
|
||||||
//// log.info("填写合计-现有-疑似----------");
|
// log.info("填写合计-现有-疑似----------");
|
||||||
//// Thread.sleep(300);
|
// Thread.sleep(300);
|
||||||
//
|
//
|
||||||
// //填写电网调度-新增-疑似
|
// //填写电网调度-新增-疑似
|
||||||
// String dispatchAddSuspectedNum = obj.getDispatchAddSuspected();
|
// String dispatchAddSuspectedNum = obj.getDispatchAddSuspected();
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,11 @@ 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;
|
||||||
|
import org.openqa.selenium.NoSuchElementException;
|
||||||
import org.openqa.selenium.WebDriver;
|
import org.openqa.selenium.WebDriver;
|
||||||
import org.openqa.selenium.WebElement;
|
import org.openqa.selenium.WebElement;
|
||||||
|
import org.openqa.selenium.support.ui.ExpectedConditions;
|
||||||
|
import org.openqa.selenium.support.ui.WebDriverWait;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
|
@ -16,6 +19,7 @@ import java.io.FileInputStream;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.Charset;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
|
import java.time.Duration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 操作值班日志类
|
* 操作值班日志类
|
||||||
|
|
@ -149,7 +153,6 @@ public class DutyLogIOp {
|
||||||
*/
|
*/
|
||||||
private void dutyLogContent() throws InterruptedException {
|
private void dutyLogContent() throws InterruptedException {
|
||||||
//值班时间
|
//值班时间
|
||||||
// /html/body/div[3]/div/div[2]/div/form/div[1]/div/div/div[1]/div/div/div/div
|
|
||||||
webDriver.findElement(By.xpath("/html/body/div[3]/div/div[2]/div/form/div[1]/div/div/div[1]/div/div/div/div[1]")).click();
|
webDriver.findElement(By.xpath("/html/body/div[3]/div/div[2]/div/form/div[1]/div/div/div[1]/div/div/div/div[1]")).click();
|
||||||
log.info("值班时间----------");
|
log.info("值班时间----------");
|
||||||
Thread.sleep(500);
|
Thread.sleep(500);
|
||||||
|
|
@ -182,42 +185,41 @@ 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
|
||||||
// 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"));
|
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"));
|
||||||
// if (StringHelper.isEmptyAndNull(weatherElement.getText())){
|
if (StringHelper.isEmptyAndNull(weatherElement.getText())){
|
||||||
// weatherElement.clear();
|
weatherElement.clear();
|
||||||
// weatherElement.sendKeys(tq);
|
weatherElement.sendKeys(tq);
|
||||||
// log.info("输入天气----------");
|
log.info("输入天气----------");
|
||||||
// }
|
}
|
||||||
// Thread.sleep(500);
|
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
|
||||||
// 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"));
|
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"));
|
||||||
// if (StringHelper.isEmptyAndNull(minTemperatureElement.getText())){
|
if (StringHelper.isEmptyAndNull(minTemperatureElement.getText())){
|
||||||
// minTemperatureElement.clear();
|
minTemperatureElement.clear();
|
||||||
// minTemperatureElement.sendKeys(zdqw);
|
minTemperatureElement.sendKeys(zdqw);
|
||||||
// log.info("输入最低气温----------");
|
log.info("输入最低气温----------");
|
||||||
// }
|
}
|
||||||
// Thread.sleep(500);
|
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
|
||||||
// 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"));
|
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"));
|
||||||
// if (StringHelper.isEmptyAndNull(maxTemperatureElement.getText())){
|
if (StringHelper.isEmptyAndNull(maxTemperatureElement.getText())){
|
||||||
// maxTemperatureElement.clear();
|
maxTemperatureElement.clear();
|
||||||
// maxTemperatureElement.sendKeys(zgqw);
|
maxTemperatureElement.sendKeys(zgqw);
|
||||||
// log.info("输入最高气温----------");
|
log.info("输入最高气温----------");
|
||||||
// }
|
}
|
||||||
// Thread.sleep(500);
|
Thread.sleep(500);
|
||||||
|
|
||||||
//事件监测 标题
|
//事件监测 标题
|
||||||
String sjjc_title = bean.getEvent_detection_title();
|
String sjjc_title = bean.getEvent_detection_title();
|
||||||
// /html/body/div[3]/div/div[2]/div/form/div[4]/table/tr[2]/td/table[1]/tr[1]/td/div[3]/div/div[1]/textarea
|
|
||||||
webDriver.findElement(By.xpath("/html/body/div[3]/div/div[2]/div/form/div[4]/table/tr[2]/td/table[1]/tr[1]/td/div[3]/div/div/textarea")).sendKeys(sjjc_title);
|
webDriver.findElement(By.xpath("/html/body/div[3]/div/div[2]/div/form/div[4]/table/tr[2]/td/table[1]/tr[1]/td/div[3]/div/div/textarea")).sendKeys(sjjc_title);
|
||||||
log.info("事件监测 标题----------");
|
log.info("事件监测 标题----------");
|
||||||
Thread.sleep(1000);
|
Thread.sleep(1000);
|
||||||
|
|
@ -240,7 +242,6 @@ public class DutyLogIOp {
|
||||||
|
|
||||||
bdgzContentElement.clear();
|
bdgzContentElement.clear();
|
||||||
bdgzContentElement.sendKeys(bdgz_content.trim());
|
bdgzContentElement.sendKeys(bdgz_content.trim());
|
||||||
// webDriver.findElement(By.xpath("/html/body/div[3]/div/div[2]/div/form/div[4]/table/tr[2]/td/table[2]/tr[2]/td/div/div/div[1]/textarea")).sendKeys(bdgz_content);
|
|
||||||
log.info("保电工作 内容----------");
|
log.info("保电工作 内容----------");
|
||||||
Thread.sleep(2000);
|
Thread.sleep(2000);
|
||||||
|
|
||||||
|
|
@ -253,11 +254,39 @@ public class DutyLogIOp {
|
||||||
String zyhc_content = bean.getResource_check_content();
|
String zyhc_content = bean.getResource_check_content();
|
||||||
webDriver.findElement(By.xpath("/html/body/div[3]/div/div[2]/div/form/div[4]/table/tr[2]/td/table[3]/tr[2]/td/div/div/div/textarea")).sendKeys(zyhc_content);
|
webDriver.findElement(By.xpath("/html/body/div[3]/div/div[2]/div/form/div[4]/table/tr[2]/td/table[3]/tr[2]/td/div/div/div/textarea")).sendKeys(zyhc_content);
|
||||||
log.info("资源核查 内容----------");
|
log.info("资源核查 内容----------");
|
||||||
Thread.sleep(500);
|
Thread.sleep(2000);
|
||||||
|
|
||||||
//通信测试 标题
|
//通信测试 标题
|
||||||
String txcs_title = bean.getCommunications_test_title();
|
String txcs_title = bean.getCommunications_test_title();
|
||||||
webDriver.findElement(By.xpath("/html/body/div[3]/div/div[2]/div/form/div[4]/table/tr[2]/td/table[4]/tr[1]/td/div[3]/div/div/textarea")).sendKeys(txcs_title);
|
log.info("txcs_title:{}", txcs_title);
|
||||||
|
// WebElement element = webDriver.findElement(By.xpath("/html/body/div[3]/div/div[2]/div/form/div[4]/table/tr[2]/td/table[4]/tr[1]/td/div[3]/div/div/textarea"));
|
||||||
|
WebElement element = webDriver.findElement(By.cssSelector("body > div.el-dialog__wrapper.ecs-dialog.otherDialog.limit.no-padding.no-radius.with-footer > div > div.el-dialog__body > div > form > div.btnShow > table > tr:nth-child(2) > td > table:nth-child(4) > tr:nth-child(1) > td > div.el-form-item.addId-box-title.is-required.el-form-item--small > div > div > textarea"));
|
||||||
|
element.clear();
|
||||||
|
element.sendKeys(txcs_title.trim());
|
||||||
|
log.info("输入成功");
|
||||||
|
// try {
|
||||||
|
// log.info("通信测试 走到了----------1");
|
||||||
|
// WebDriverWait wait = new WebDriverWait(webDriver, 10);
|
||||||
|
// element = wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("/html/body/div[3]/div/div[2]/div/form/div[4]/table/tr[2]/td/table[4]/tr[1]/td/div[3]/div/div/textarea")));
|
||||||
|
// log.info("Element text: " + element.getText());
|
||||||
|
// log.info("Element toString: " + element.toString());
|
||||||
|
// if (element.isEnabled()) {
|
||||||
|
// element.sendKeys("今日开展通信测试1项,均正常");
|
||||||
|
// log.info("输入成功");
|
||||||
|
// } else {
|
||||||
|
// log.error("Element not enabled for input");
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// log.info("通信测试 走到了----------2");
|
||||||
|
//
|
||||||
|
// } catch (NoSuchElementException e) {
|
||||||
|
// log.info("通信测试 报错走catch----------1");
|
||||||
|
// element = webDriver.findElement(By.xpath("/html/body/div[3]/div/div[2]/div/form/div[4]/table/tr[2]/td/table[4]/tr[1]/td/div[3]/div/div[1]/textarea"));
|
||||||
|
// log.info(element.getText());
|
||||||
|
// log.info(String.valueOf(element));
|
||||||
|
// element.sendKeys(txcs_title);
|
||||||
|
// log.info("通信测试 报错走catch----------2");
|
||||||
|
// }
|
||||||
log.info("通信测试 标题----------");
|
log.info("通信测试 标题----------");
|
||||||
Thread.sleep(500);
|
Thread.sleep(500);
|
||||||
//通信测试 内容
|
//通信测试 内容
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ log4j.appender.stdout.Target = System.out
|
||||||
log4j.appender.stdout.layout = org.apache.log4j.PatternLayout
|
log4j.appender.stdout.layout = org.apache.log4j.PatternLayout
|
||||||
log4j.appender.stdout.layout.ConversionPattern = [%-5p] %d{yyyy-MM-dd HH:mm:ss,SSS} method:%l%n%m%n
|
log4j.appender.stdout.layout.ConversionPattern = [%-5p] %d{yyyy-MM-dd HH:mm:ss,SSS} method:%l%n%m%n
|
||||||
|
|
||||||
### 输出DEBUG 级别以上的日志到=E://logs/error.log ###
|
### 输出DEBUG 级别以上的日志到=D://logs/error.log ###
|
||||||
log4j.appender.D = org.apache.log4j.DailyRollingFileAppender
|
log4j.appender.D = org.apache.log4j.DailyRollingFileAppender
|
||||||
log4j.appender.D.File = logs/log.log
|
log4j.appender.D.File = logs/log.log
|
||||||
log4j.appender.D.Append = true
|
log4j.appender.D.Append = true
|
||||||
|
|
@ -15,7 +15,7 @@ log4j.appender.D.Threshold = DEBUG
|
||||||
log4j.appender.D.layout = org.apache.log4j.PatternLayout
|
log4j.appender.D.layout = org.apache.log4j.PatternLayout
|
||||||
log4j.appender.D.layout.ConversionPattern = %-d{yyyy-MM-dd HH:mm:ss} [ %t:%r ] - [ %p ] %m%n
|
log4j.appender.D.layout.ConversionPattern = %-d{yyyy-MM-dd HH:mm:ss} [ %t:%r ] - [ %p ] %m%n
|
||||||
|
|
||||||
### 输出ERROR 级别以上的日志到=E://logs/error.log ###
|
### 输出ERROR 级别以上的日志到=D://logs/error.log ###
|
||||||
log4j.appender.E = org.apache.log4j.DailyRollingFileAppender
|
log4j.appender.E = org.apache.log4j.DailyRollingFileAppender
|
||||||
log4j.appender.E.File =logs/error.log
|
log4j.appender.E.File =logs/error.log
|
||||||
log4j.appender.E.Append = true
|
log4j.appender.E.Append = true
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue