I가 I이 (가) 로그인의 버튼을 식별하는 XPath는 //a[@href='javascript:setAction('ValidateUser')']
을 사용하고요소를 식별하는 방법 클래스 이름이 같은 경우?
<a class="dboxheader" href="javascript:setAction('ValidateUser')">Sign In</a>
<a class="dboxheader" href="javascript:setAction('Reset')">Reset</a>
2 개 버튼 로그인 절차 및 재설정 .. .. 버튼 오류 아래 점점 :
org.openqa.selenium.InvalidSelectorException: The given selector //a[@href='javascript:setAction('ValidateUser')'] is either invalid or does not result in a WebElement. The following error occurred:
InvalidSelectorError: Unable to locate an element with the xpath expression //a[@href='javascript:setAction('ValidateUser')'] because of the following error:
SyntaxError: The expression is not a legal expression.
어떻게이 문제를 해결하기 위해 ???
이하이 작동하지 않습니다 .. org.openqa.selenium.NoSuchElementException을
시도 (text(), 'Sign In')] "} 명령 기간 또는 시간 초과 : 15 밀리 초 – ChanGan
이 웹 요소를 클릭하기 전에 아래 코드를 사용하십시오. assertTrue (driver.getPageSource(). contains ("Sign In")); 오류 메시지를 알려주십시오. –
boolean b = driver.getPageSource(). contains ("Sign In"); System.out.println (b); 결과 : 거짓 – ChanGan