매우 이상합니다. 테스트를 자동화하려고하는데, 파이어 폭스 53을 사용하여 셀레늄 3.4를 사용하고 있습니다. 내 테스트 코드에 아무런 문제가 보이지 않습니다. 요소를 찾을 수는 없습니다이 테스트를 실행 한 후 :}로케이터 셀렌을 찾을 수 없습니다. 3.4
public class TC001_LoginWithInvalidCredentials {
WebDriver driver ;
@BeforeTest
public void setUp(){
System.setProperty("webdriver.gecko.driver",System.getProperty("user.dir")+"/Drivers/geckodriver.exe");
driver = new FirefoxDriver();
driver.get("http://automationpractice.com/index.php?");
}
@Test
public void LoginWithInvalidCredentials(){
driver.findElement(By.xpath(".//*[@id='header']/div[2]/div/div/nav/div[1]/a")).click();
driver.findElement(By.id("email")).sendKeys("[email protected]");
driver.findElement(By.id("passwd")).sendKeys("passwrd");
driver.findElement(By.xpath(".//*[@id='SubmitLogin']")).click();
Assert.assertEquals(driver.findElement
(By.xpath(".//*[@id='center_column']/div[1]/ol/li")).getText(), "Authentication failed.");
}
@AfterTest
public void endTest(){
driver.close();
}
<div class="form_content clearfix">
<div class="form-group form-error">
<label for="email">Email address</label>
<input id="email" class="is_required validate account_input form-control" data-validate="isEmail" name="email" value="" type="text">
</div>
<div class="form-group">
<label for="passwd">Password</label>
<span>
<input id="passwd" class="is_required validate account_input form-control" data-validate="isPasswd" name="passwd" value="" type="password">
</span>
</div>
<p class="lost_password form-group">
<a href="http://automationpractice.com/index.php?controller=password" title="Recover your forgotten password" rel="nofollow">Forgot your password?</a>
</p>
<p class="submit">
<input class="hidden" name="back" value="my-account" type="hidden">
<button id="SubmitLogin" class="button btn btn-default button-medium" type="submit" name="SubmitLogin">
어떤 오류가 발생했으며 어떤 요소가 있습니까? – kushal