0
硒PHPUnit的選擇元素,我有以下的HTML代碼片段:通過標籤文本
<div class="modal-body" style="max-height: 317px;">
<div class="radio">
<label>
<input type="radio" name="template" value="5">
<img src="/img/custom-icons/Monitor.png" style="height: 24px">
First descriptive title
<p class="text-muted">Some description text</p>
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="template" value="37">
<img src="/img/custom-icons/Monitor.png" style="height: 24px">
Second descriptive title
<p class="text-muted"></p>
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="template" value="46">
<img src="/img/custom-icons/Chart_Area_Up.png" style="height: 24px">
Third descriptive title
<p class="text-muted">Some text that describes an item.</p>
</label>
</div>
</div>
我想通過它的標籤文本選擇電臺元素並單擊它。我在做什麼:
$this->byXPath("//label[text()='Second descriptive title']")->click();
不幸的是,這是行不通的。有任何想法嗎?我將不勝感激您的幫助。