我想驗證某個特定元素的網頁上是否存在特定圖像。圖像:如何使用Robot Framework在特定元素內驗證圖像
- 沒有唯一ID
- 沒有唯一ALT
- src屬性包含查詢字符串我試圖忽視
- 頁面
上多次出現我不能使用頁面應該包含圖像,因爲它出現多次,但我需要驗證它出現在特定的表格單元格中。該圖片src看起來是這樣的:
${BaseUrl}/status_submitted.png?master_2017217_17-29
這裏的周邊圖像的HTML:
<table id="mass_list" class="grid">
<tr>
<th class="shrink align_center">Status</th>
<th>Action</th>
<th class="shrink align_right">Submitted</th>
<th class="shrink">Submitted By</th>
</tr>
<tr>
<td>
<img src="https://{baseurl}/images/status_submitted.png?master_2017217_17-29" alt="Submitted" width="70" height="20" />
</td>
<td class="nowrap">
Automation Test 1488321180.7
<br />
<small class="mute">
<strong>0</strong> of <strong>2</strong> records processed
</small>
</td>
<td class="nowrap align_right">Yesterday at 4:33 PM</td>
<td class="nowrap">Tina Tester</td>
</tr>
<tr>
<td>
<img src="https://{baseurl}/images/status_submitted.png?master_2017217_17-29" alt="Submitted" width="70" height="20" />
</td>
<td class="nowrap">
Add an attribute
<br />
<small class="mute">
<strong>0</strong> of <strong>16</strong> records processed
</small>
</td>
<td class="nowrap align_right">Yesterday at 8:06 AM</td>
<td class="nowrap">Tina Tester</td>
</tr>
我需要驗證頁面上是否存在特定的表中,只是$ {}的BaseURL /status_submitted.png單元格或xpath位置。我該怎麼做呢?
我們能看到該圖片的HTML? – Goralight
是的,添加到問題中。 – pgtips