2013-04-18 5 views
0
<table id="RegTable" class="GSTable" cellspacing="0" cellpadding="0" style="margin: 20px auto 0px; width: 580px; padding: 5px; font-size: 12px;"> 
<tbody> 
<tr> 
<td id="termstab" height="150" colspan="2"> 
<div style="width:100%; height:100%; padding-right:5px; overflow-y:auto;"> 
<p align="justify"></p> 
<h2 class="paraHead" align="center">Terms and Conditions</h2> 

이 웹 페이지에서 '이용 약관'텍스트를 어떻게 확인할 수 있습니까? 나는 verifyTextPresent 메서드와 다른 가능한 메서드를 시도했지만 작동하지 않습니다. 그래서 나는 길을 찾을 필요가있다. 해당 위치에서 '이용 약관'텍스트를 어떻게 얻을 수 있습니까?xptha에서 셀렌과 phpunit을 사용하여 텍스트 가져 오기

답변

0

다양한 방법으로 ...

비아의 XPath은 다음과 같습니다

//h2[text()='Terms and Conditions'] 

또는

//h2[@class='paraHead'] 

또는

//table[@id='RegTable']/descendant::h2[text()='Terms and Conditions'] 

또는 CSS를 사용하여 :

h2.parahead 
+0

텍스트 '이용 약관'을 해당 위치에서 얻으려고합니다. 나는 $ this-> getText (// table [@ id = 'RegTable']/descendant :: h2 [text() = '이용 약관']을 사용했지만 작동하지 않는다. –

관련 문제