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();
不幸的是,这是行不通的。有任何想法吗?我将不胜感激您的帮助。