系统更新
This commit is contained in:
parent
a239ff5636
commit
a20d2c3911
Binary file not shown.
|
|
@ -31,14 +31,6 @@ public class TestMain {
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
log.info("执行任务开始。。。。。。");
|
log.info("执行任务开始。。。。。。");
|
||||||
// testRCCL();
|
|
||||||
// testqd();
|
|
||||||
// testjjb();
|
|
||||||
// testGetData();
|
|
||||||
// testDailrb();
|
|
||||||
// start("工作人员请注意,桌号8001顾客正在寻求帮助!!");
|
|
||||||
// testLog();
|
|
||||||
// testWeather();
|
|
||||||
new Thread(new Runnable() {
|
new Thread(new Runnable() {
|
||||||
@SneakyThrows
|
@SneakyThrows
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -182,7 +174,7 @@ public class TestMain {
|
||||||
*
|
*
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
private void autoJob() throws InterruptedException {
|
void autoJob() throws InterruptedException {
|
||||||
AutoWebTask autoWebTask = new AutoWebTask();
|
AutoWebTask autoWebTask = new AutoWebTask();
|
||||||
|
|
||||||
int logGatherCount = 0;
|
int logGatherCount = 0;
|
||||||
|
|
@ -318,18 +310,6 @@ public class TestMain {
|
||||||
if (jjbzaoNum>10){
|
if (jjbzaoNum>10){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// if (jjbzao == 0 && jjbzao2 == 0){
|
|
||||||
// getTime(420);
|
|
||||||
// }
|
|
||||||
// //自动在系统内完成接班(上一值完成交班后)
|
|
||||||
// if (jjbzao == 0 || jjbzao2 == 0){
|
|
||||||
// if (jjbzao == 0){
|
|
||||||
// jjbzao = autoWebTask.dutyChangeTask1(1,DataConfig.USER_NAME1,DataConfig.PASS1);
|
|
||||||
// }
|
|
||||||
// if (jjbzao2 == 0){
|
|
||||||
// jjbzao2 = autoWebTask.dutyChangeTask2(1,DataConfig.USER_NAME1,DataConfig.PASS1);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
if (jjbzao == 0) {
|
if (jjbzao == 0) {
|
||||||
getTime(420);
|
getTime(420);
|
||||||
}
|
}
|
||||||
|
|
@ -413,7 +393,6 @@ 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")) {
|
|
||||||
logwanNum++;
|
logwanNum++;
|
||||||
if (logwanNum>10){
|
if (logwanNum>10){
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
|
|
@ -39,16 +39,12 @@ 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.7");
|
option.addArguments("--force-device-scale-factor=0.7");
|
||||||
if (type==8){
|
if (type==8){
|
||||||
option.addArguments("--force-device-scale-factor=0.6");
|
option.addArguments("--force-device-scale-factor=0.6");
|
||||||
}
|
}
|
||||||
option.addArguments("disable-infobars");
|
option.addArguments("disable-infobars");
|
||||||
// if(type != 7) {
|
|
||||||
// //隐藏浏览器
|
|
||||||
// option.addArguments("--headless");
|
|
||||||
// }
|
|
||||||
webDriver = new ChromeDriver(option);
|
webDriver = new ChromeDriver(option);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -142,15 +138,6 @@ public class AutoMain {
|
||||||
*/
|
*/
|
||||||
private void openDuty() throws InterruptedException {
|
private void openDuty() throws InterruptedException {
|
||||||
Thread.sleep(5000);
|
Thread.sleep(5000);
|
||||||
//
|
|
||||||
// try {
|
|
||||||
// WebElement alertDiv = webDriver.findElement(By.xpath("/html/body/div[2]/div/div[1]/div/div[1]/div[1]/span"));
|
|
||||||
// if(alertDiv.getText()) {
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
// }catch (Exception e){
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
webDriver.manage().timeouts().implicitlyWait(3, TimeUnit.SECONDS);
|
webDriver.manage().timeouts().implicitlyWait(3, TimeUnit.SECONDS);
|
||||||
|
|
@ -171,7 +158,6 @@ public class AutoMain {
|
||||||
Thread.sleep(2000);
|
Thread.sleep(2000);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//判断是否有相应的元素
|
//判断是否有相应的元素
|
||||||
try {
|
try {
|
||||||
Thread.sleep(2000);
|
Thread.sleep(2000);
|
||||||
|
|
@ -277,14 +263,6 @@ public class AutoMain {
|
||||||
log.info("管理标签的ID值为:" + attributeId);
|
log.info("管理标签的ID值为:" + attributeId);
|
||||||
Thread.sleep(2000);
|
Thread.sleep(2000);
|
||||||
|
|
||||||
|
|
||||||
// //执行鼠标悬停动作-预警行动
|
|
||||||
// String ctzbXpath = "//*[@id=\"" + attributeId + "\"]/div/div[1]/div[2]/div[4]";
|
|
||||||
// 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]
|
//*[@id=\"" + attributeId + "\"]/div/div[2]/div[2]/div[1]/div[2]
|
||||||
String zbglXpath = "//*[@id=\"" + attributeId + "\"]/div/div/div[2]/div[4]";
|
String zbglXpath = "//*[@id=\"" + attributeId + "\"]/div/div/div[2]/div[4]";
|
||||||
|
|
@ -338,16 +316,7 @@ public class AutoMain {
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.info("无确认框,在时间范围内----------");
|
log.info("无确认框,在时间范围内----------");
|
||||||
}
|
}
|
||||||
// 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[2]/div[2]/div/div[1]";
|
|
||||||
// webDriver.findElement(By.xpath(zbglXpath)).click();
|
|
||||||
// log.info("打开日常操练页面------------");
|
|
||||||
// /* TODO 800 --> 1500 */
|
|
||||||
Thread.sleep(1500);
|
Thread.sleep(1500);
|
||||||
|
|
||||||
//定位日常操练iframe的标签
|
//定位日常操练iframe的标签
|
||||||
|
|
@ -400,8 +369,6 @@ public class AutoMain {
|
||||||
|
|
||||||
//执行鼠标悬停动作-检查操练管理
|
//执行鼠标悬停动作-检查操练管理
|
||||||
|
|
||||||
// WebElement wectzb =
|
|
||||||
// action.moveToElement(wectzb).build().perform();
|
|
||||||
//判断是否有相应的元素
|
//判断是否有相应的元素
|
||||||
try {
|
try {
|
||||||
Thread.sleep(2000);
|
Thread.sleep(2000);
|
||||||
|
|
@ -418,15 +385,8 @@ public class AutoMain {
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.info("无确认框,在时间范围内----------");
|
log.info("无确认框,在时间范围内----------");
|
||||||
}
|
}
|
||||||
Thread.sleep(300);
|
|
||||||
|
|
||||||
// //打开检查计划页面
|
Thread.sleep(1800);
|
||||||
// //*[@id=\"" + attributeId + "\"]/div/div[2]/div[2]/div[1]/div[2]
|
|
||||||
// String zbglXpath = "//*[@id=\"" + attributeId + "\"]/div/div[2]/div[2]/div/div[1]";
|
|
||||||
// webDriver.findElement(By.xpath(zbglXpath)).click();
|
|
||||||
// log.info("打开检查计划页面------------");
|
|
||||||
// /* TODO 800 --> 1500 */
|
|
||||||
Thread.sleep(1500);
|
|
||||||
|
|
||||||
//定位检查计划iframe的标签
|
//定位检查计划iframe的标签
|
||||||
WebElement dutyIframe = webDriver.findElement(By.id("rccl"));
|
WebElement dutyIframe = webDriver.findElement(By.id("rccl"));
|
||||||
|
|
@ -436,10 +396,5 @@ public class AutoMain {
|
||||||
//点击抽查按钮
|
//点击抽查按钮
|
||||||
webDriver.findElement(By.xpath("/html/body/div/section/div[1]/div[1]/div/div/div/div[3]")).click();
|
webDriver.findElement(By.xpath("/html/body/div/section/div[1]/div[1]/div/div/div/div[3]")).click();
|
||||||
|
|
||||||
// //定位日常操练iframe的标签
|
|
||||||
// WebElement insideIframe = webDriver.findElement(By.xpath("/html/body/div/section/div[1]/div[2]/div[1]/iframe"));
|
|
||||||
// webDriver.switchTo().frame(insideIframe);
|
|
||||||
// log.info("定位到日常操练内部iframe-----------");
|
|
||||||
// Thread.sleep(3000);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -356,31 +356,6 @@ public class AutoWebTask {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
|
||||||
// String content = read("C:\\Users\\24526\\Desktop\\宿州部分代码实例\\七个公司资源核查情况.txt");
|
|
||||||
// String[] array = content.toString().split("资源核查情况:");
|
|
||||||
//
|
|
||||||
// ArrayList<String> list = new ArrayList<String>();
|
|
||||||
// list.add("1");
|
|
||||||
// list.add("2");
|
|
||||||
// list.add("3");
|
|
||||||
// list.add("4");
|
|
||||||
// list.add("5");
|
|
||||||
// list.add("6");
|
|
||||||
// list.add("7");
|
|
||||||
// // 打乱顺序
|
|
||||||
// Collections.shuffle(list);
|
|
||||||
//// // 遍历取出元素
|
|
||||||
//// for (String day : list) {
|
|
||||||
//// System.out.println(day);
|
|
||||||
//// }
|
|
||||||
// System.out.println(list.get(0));
|
|
||||||
// System.out.println(array[Integer.parseInt(list.get(0))].toString());
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String read(String filename){
|
public static String read(String filename){
|
||||||
String line;
|
String line;
|
||||||
StringBuilder content = new StringBuilder();
|
StringBuilder content = new StringBuilder();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue