testng 프레임 워크를 사용하여 셀레늄 webdriver에 테스트 케이스를 만들었습니다. getText() 및 인쇄하고 Assert.assertEquals()에서도 사용하려고합니다.Selenium assertEqual
내가 직면 한 문제는이 테스트 사례를 실행하면 "java.lang.AssertionError : expected [] but expected [Register here]"오류가 표시되고 "ab"변수에 아무 것도 인쇄되지 않는다는 것입니다.
내 테스트 케이스 :::::::::@Test
public void signinpopup()
{
driver.get("http://uat.tfc.tv/");
driver.findElement(By.id("login_buttoni")).click();
String ab = driver.findElement(By.xpath("html/body/section[1]/div/div[1]/div[7]/div[2]/a")).getText(); //ab variable contains value "Register here"
System.out.println(ab);
System.out.println("hello1");
//Assert.assertEquals("Registe12r here", driver.findElement(By.xpath("html/body/section[1]/div/div[1]/div[7]/div[2]/a")).getText());
Assert.assertEquals(ab,"Regist5434er here");
}
내가 Assert.assertEquals에 어설 션 조건 (AB, "여기에 등록")를 변경됩니다 한 가지 더; "ab"변수를 출력합니다.
여기에 무슨 일이 일어나는지 말해주세요 !!!!!!
관련 HTML 코드 – singe3
을 공유하십시오. ab의 값을 인쇄하면 무엇이 인쇄됩니까? 관련 가치를 인쇄하고 있습니까? – Vinay
@ singe31 : http://uat.tfc.tv/ 링크를 제공합니다. – user3843578