2012-12-31 2 views
0

요소의 XPath를 따라 왔으며 셀렌에서 verifyText() 명령을 사용하여 텍스트를 추출하려고합니다.xpath를 사용하여 셀렌에서 verifyText() 명령을 사용하는 방법?

전체 XPATH : html/body/table [2]/tbody/tr/td [3]/테이블/tbody/tr [4]/td/table/tbody/tr [2]/td/table/tbody/tr [2]/td

아래에 표시된 부분은 텍스트를 가져 오는 방법입니다. 셀렌에서 verifyText() 명령을 사용하여 "로드하는 중 아이콘이 나타납니다."

이 텍스트는 동적이며 변경할 수 있습니다.

<table width="730" cellspacing="0" cellpadding="0" border="0" align="center"> 
<tbody> 
    <tr> 
    <tr> 
    <td height="30" colspan="2"> 
    <strong>A Loading icon will appear when you click "Login" button.</strong> 
In case you do not see such icon, it would mean that you are not using a compatible browser 
    </td> 
    </tr> 
    <form id="form1" method="post" autocomplete="off" action="/Login/Password"/> 
    <tr> 
    <tr> 
    <tr> 
    <tr> 
</tbody> 
</table> 

답변

0

페이지의 텍스트와 일치하는 패턴을 허용하는 verifyTextPresent 명령을 사용할 수 있습니다.

또는 언급 한대로 태그가있는 경우 verifyText ("// td", "Message to verified")를 사용할 수 있습니다.

관련 문제