我正在嘗試檢索父(grand-grand-parent)元素的id。Robot Framework:如何獲取元素的xpath?
我得到的所有信息是// div [@ class =「preset_name」]是「all」。知道這一點,我需要使用任何Robot Framework關鍵字檢索「preset_3」(作爲字符串)。 我該怎麼做?或者我怎樣才能獲得「全部」的完整xpath?
<table id="preset_list">
<tbody>
<tr id="preset_0">
<td>
<div class="preset_title_line">
<div class="preset_button_group">
<button class="preset_button">Apply</button>
</div>
<div class="preset_name">Factory default</div>
</div>
<div class="preset_sections">System, Network, Sources, EDID, Channels, Automatic File Upload, Touch screen, Output ports</div>
</td>
</tr>
<tr id="preset_1">
<td>
...
到OP:請絕對不要發佈XML/HTML(或任何類型的代碼)的圖像。改爲發佈文字。後者更有用,因爲人們可以使用它來測試他們的XPath。謝謝 – har07
告訴我們你已經嘗試過了。這看起來像是一個相對直接的問題,可以用簡單的xpath表達式來解決。 –