1718192021222324252627
System.out.printf("now accesss %s \n", secondUrl); dr.get(secondUrl); Thread.sleep(1000); System.out.printf("now back to %s \n", firstUrl); dr.navigate().back(); Thread.sleep(1000); System.out.printf("forward to %s \n", secondUrl); dr.navigate().forward(); Thread.sleep(1000);
2122232425262728293031
System.out.printf("now back to %s \n", firstUrl); dr.navigate().back(); Thread.sleep(1000); System.out.printf("forward to %s \n", secondUrl); dr.navigate().forward(); Thread.sleep(1000); System.out.println("browser will be close"); dr.quit(); }
2324252627282930313233
// 选择所有的checkbox并全部勾上 List<WebElement> checkboxes = dr.findElements(By.cssSelector("input[type=checkbox]")); for(WebElement checkbox : checkboxes) { checkbox.click(); } dr.navigate().refresh(); // 打印当前页面上有多少个checkbox System.out.printf("%d\n", checkboxes.size()); // 选择页面上所有的input,然后从中过滤出所有的checkbox并勾选之
102103104105106107108109110111112
SignalCreator sc = new SignalCreator(t.getZuluData()); sc.createFile(path + "SIGNAL.CSV"); driver.navigate().refresh(); Thread.sleep(60000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace();