那有2種擷取的方式
css選擇器 | css=#group_3 |
預設方法 | id=group_3 |
<div class=’zone area-list></div>
xpath = //div[contains(@class,'zone area-list')]
3.抓ul底下li的超連結文字(ref.stackexchange)
<ul id="group_3" class="area-list" style="">
<li class="select_form_b">
<a id="5181_14" style="opacity: 1;">
<span style="background: #f9581d;"> </span>
2800
<font color="#FF0000">剩餘 2</font></a>
</li>
</ul>
xpath = /ul/li/a[contains(text(),'橙208區2800 ')]
4.抓ul底下li的超連結文字 並且包含 剩餘 (ref.stackoverflow)
xpath=/ul/li/a[contains(text(),'橙208區2800 ') and ./font[contains(text(),'剩餘')]]
5.下拉選單,選擇項目(ref.stackoverflow)
<select class="mobile-select" id="TicketForm_ticketPrice_04">
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
command | Target | Value |
select | id=TicketForm_ticketPrice_03 | label=2 |
select | xpath=//select[contains(@id,'TicketForm_ticketPrice')] | label=2 |
6.取得焦點
<input type="text" id="TicketForm_verifyCode" style="width: 220px; min-height: 35px;">
command | Target | Value |
focus | id=TicketForm_verifyCode |
Katalon Docs
沒有留言:
張貼留言