这是我的代码
System.setProperty("webdriver.chrome.driver", "D:\\Chrome Driver\\chromedriver.exe");
driver = new ChromeDriver();
Dimension d = new Dimension(400,600);
//Resize current window to the set dimension
driver.manage().window().setSize(d);
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
JavascriptExecutor jsm=(JavascriptExecutor)driver;
jsm.executeScript("window.scrollBy(0,1000)");
Thread.sleep(8000);
//driver.findElement(By.cssSelector("div.place-order-form > form:nth-child(1) > div:nth-child(1) > label:nth-child(1) > input:nth-child(1)"));
WebElement element = driver.findElement(By.xpath("//div[@class='place-order-form hidden-xs']/form[@id='placeOrderForm1']/div/label/input[@id='Terms1']"));
jsm.executeScript("arguments[0].click();", element);
//driver.findElement(By.xpath("//div[@class='place-order-form hidden-xs']/form[@id='placeOrderForm1'`enter code here`]/div/label/input[@id='Terms1']")).click();
driver.findElement(By.id("placeOrder")).click();
}
此处一切正常,但在最大化能够单击复选框但无法处理指定尺寸的窗口时单击接受条款复选框 有人可以帮忙吗 预先感谢