我正在使用 selenium webdriver Chrome。我看到了这么奇怪的东西。我正在测试一个注册帐户。Webdriver 将进入每个字段,看起来它正在输入文本,但没有显示任何内容。字段中不显示任何文本结果。我究竟做错了什么?
@Test
public void testAlreadyUsedEmailSignUp() throws InterruptedException {
driver.findElement(By.cssSelector("html body.oneColFixCtrHdr div.container div#header div#innerHeader div#menu ul div.btn-gr")).click();
Thread.sleep(5000);
// switch to frames inside the webpage
driver.switchTo().frame("GB_frame"); // 1st frame
driver.switchTo().frame(0); // 2nd frame
driver.findElement(By.id("firstName")).click();
driver.findElement(By.id("firstName")).sendKeys("Tester");
driver.findElement(By.id("lastName")).sendKeys("Automater");
driver.findElement(By.id("email")).sendKeys("test11@gmail.com");
driver.findElement(By.id("Ppassword")).sendKeys("prd1");
driver.findElement(By.id("confirmPPassword")).sendKeys("pass7ord1");
driver.findElement(By.id("State")).sendKeys("I");
driver.findElement(By.id("myInput")).sendKeys("Mike Ward");
Thread.sleep(2000);
driver.findElement(By.name("term")).click();
driver.findElement(By.id("formAccSubmit")).click();
assertEquals(driver.findElement(By.id("errorContainer")).getText(),
"The Email field must contain a valid email address.");
Thread.sleep(5000);
}