|
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.Select;
public class Jqform {
public static void main(String[] args){
WebDriver driver = new FirefoxDriver();
driver.get("http://www.trirand.com/blog/jqform/");
driver.findElement(By.xpath("(//button[@type='button'])[19]")).click();
driver.findElement(By.id("bajax")).click();
driver.findElement(By.id("data")).sendKeys("test");
new Select(driver.findElement(By.id("dataType"))).selectByIndex(4);
new Select(driver.findElement(By.id("resetForm"))).selectByIndex(1);
new Select(driver.findElement(By.id("clearForm"))).selectByIndex(1);
new Select(driver.findElement(By.id("iframe"))).selectByIndex(1);
driver.findElement(By.id("iframeSrc")).sendKeys("Test123");
new Select(driver.findElement(By.id("forceSync"))).selectByIndex(1);
driver.findElement(By.cssSelector("div.CodeMirror.CodeMirror-focused > div > textarea")).sendKeys("3123123123");
}
}
最后一行代码 无法执行成功, 请大家帮忙看看 多谢了 |
|