系统更新

This commit is contained in:
zfh 2025-02-28 16:27:11 +08:00
parent ac520b2e4c
commit 9d46f884bc
3 changed files with 77 additions and 19 deletions

View File

@ -70,7 +70,18 @@ public class DutyChangeShifts {
//交接事项说明 //交接事项说明
if (type == 1) { if (type == 1) {
// /html/body/div[3]/div/div[2]/div/form/div[7]/div/div[1]/textarea // /html/body/div[3]/div/div[2]/div/form/div[7]/div/div[1]/textarea
try {
webDriver.findElement(By.xpath("/html/body/div[3]/div/div[2]/div/form/div[2]/div/div[1]/textarea")).sendKeys("正常"); webDriver.findElement(By.xpath("/html/body/div[3]/div/div[2]/div/form/div[2]/div/div[1]/textarea")).sendKeys("正常");
}catch (Exception e){
log.info("交接事项说明div[3]不存在----------");
}
try {
webDriver.findElement(By.xpath("/html/body/div[8]/div/div[2]/div/form/div[2]/div/div[1]/textarea")).sendKeys("正常");
}catch (Exception e){
log.info("交接事项说明div[8]不存在----------");
}
log.info("交接事项说明----------"); log.info("交接事项说明----------");
Thread.sleep(500); Thread.sleep(500);
//提交 //提交

View File

@ -21,7 +21,6 @@ public class DutyClock {
} }
public void openDutyClock() throws InterruptedException { public void openDutyClock() throws InterruptedException {
Thread.sleep(1000 * 4); Thread.sleep(1000 * 4);
//定位值班打卡并点击 //定位值班打卡并点击
@ -64,14 +63,47 @@ public class DutyClock {
xpaht = "//*[@id=\"pane-2\"]/div/div[3]/div[2]/div[1]/div[2]/button[2]"; xpaht = "//*[@id=\"pane-2\"]/div/div[3]/div[2]/div[1]/div[2]/button[2]";
} }
} }
Thread.sleep(1000 * 4); Thread.sleep(1000 * 4);
webDriver.findElement(By.xpath(xpaht)).click(); webDriver.findElement(By.xpath(xpaht)).click();
log.info("打卡签到----------"); log.info("打卡签到----------");
Thread.sleep(1000 * 5); Thread.sleep(1000 * 5);
//判断是否有相应的元素
try {
Thread.sleep(2000);
webDriver.findElement(By.xpath("html/body/div[2]/div/div[3]/button[2]")).click();
log.info("确认提前签到div[2]----------");
} catch (Exception e) {
log.info("无确认框,在时间范围内----------");
}
//判断是否有相应的元素
try {
Thread.sleep(2000);
webDriver.findElement(By.xpath("html/body/div[6]/div/div[3]/button[2]")).click();
log.info("确认提前签到div[6]----------");
} catch (Exception e) {
log.info("无确认框,在时间范围内----------");
}
try {
//点击弹出框确认 //点击弹出框确认
webDriver.findElement(By.xpath("/html/body/div[2]/div/div[2]/div/div[2]/div[1]")).click(); webDriver.findElement(By.xpath("/html/body/div[2]/div/div[2]/div/div[2]/div[1]")).click();
} catch (Exception e) {
log.info("当前打卡确认按钮不存在div[2]");
}
try {
//点击弹出框确认
webDriver.findElement(By.xpath("/html/body/div[3]/div/div[2]/div/div[2]/div[1]")).click();
} catch (Exception e) {
log.info("当前打卡按钮不存在div[3]");
}
//点击弹出框确认
// webDriver.findElement(By.xpath("/html/body/div[2]/div/div[2]/div/div[2]/div[1]")).click();
log.info("点击弹出框确认----------"); log.info("点击弹出框确认----------");
Thread.sleep(800); Thread.sleep(800);
} }

View File

@ -349,6 +349,21 @@ public class DutyLogIOp {
log.info("提交日志----------"); log.info("提交日志----------");
Thread.sleep(2000); Thread.sleep(2000);
//判断是否有相应的元素
try{
Thread.sleep(2000);
webDriver.findElement(By.xpath("html/body/div[3]/div/div[3]/button[2]")).click();
log.info("是否确认签到----------");
}catch (Exception e){
log.info("无确认框在时间范围内div[3]----------");
}
try{
Thread.sleep(2000);
webDriver.findElement(By.xpath("html/body/div[4]/div/div[3]/button[2]")).click();
log.info("是否确认签到----------");
}catch (Exception e){
log.info("无确认框在时间范围内div[4]----------");
}
//点击弹出框确认 /html/body/div[4]/div/div[3]/button[2] //点击弹出框确认 /html/body/div[4]/div/div[3]/button[2]
WebElement qrBtn = webDriver.findElement(By.xpath("/html/body/div[4]/div/div[3]/button[2]")); WebElement qrBtn = webDriver.findElement(By.xpath("/html/body/div[4]/div/div[3]/button[2]"));
@ -379,7 +394,7 @@ public class DutyLogIOp {
WebElement dutyIframe = webDriver.findElement(By.id("zbgln")); WebElement dutyIframe = webDriver.findElement(By.id("zbgln"));
webDriver.switchTo().frame(dutyIframe); webDriver.switchTo().frame(dutyIframe);
log.info("定位值班管理iframe的标签----------"); log.info("定位值班管理iframe的标签----------");
Thread.sleep(500); Thread.sleep(3000);
} }