-
FEATURED COMPONENTS
First time here? Check out the FAQ!
1 | initial version | |
Hi digulla, The following is a simple sample
WebDriver driver = new FirefoxDriver();
driver.get("URL");
WebElement element = driver.findElement(By.id("zk_comp_5")); // the input id
Actions builder = new Actions(driver);
//Use Keys.LEFT_CONTROL here
builder.click(element).sendKeys(Keys.LEFT_CONTROL,"a").build().perform();
//zul alert is not a js alert, it calls Messagebox.show();
//Alert alert = driver.switchTo().alert();
//wait for the msgbox generated, or the selenium will execute faster than the browser;
Thread.sleep(1000);
//we need to find Element ourselves
WebElement alertOK = driver.findElement(By.id("zk_comp_14")); //the OK button's ID in the msgbox
new Actions(driver).click(alertOK).build().perform();
Thread.sleep(1000);
builder.sendKeys(element, Keys.ENTER).perform();
For more information please refer to smalltalk