我正在尝试使用机器人框架在 html 标签上找到一个元素。我想单击第一个元素,无论元素是什么。
例如
在文本字段中输入文本,然后按回车键
该项目将显示,我想点击第一个项目,但我不能
我的机器人代码
Open Browser http://www.tarad.com chrome
Wait Until Element Is Visible id=keyword
Input Text id=keyword dog
Press Key id=keyword \\13
Wait Until Element Is Visible id=wrapper_body_all
Element Should Be Visible id=wrapper_body_all
Click Element xpath=//div[id='warpper_all']/div[id='wapper_body_all']//ul/il//img[constains(@src,'//img.trd.cm/120/120/sumpow/img-lib/spd_20140314140410_b.jpg')]
我的 HTML 标签
<div id="wrapper_body_all">
<div class="main-wrap">
<!--start : #rightProduct-->
<div class="section-col-right">
<!--start : rec_product -->
<div class="rec_product">
<!-- end : rec_product -->
<div class="rec_product">
<div class="section-products-box">
<div class="hitproduct-body">
<ul class="hitproduct-list list">
<!--start : product-list-->
<li>
<div class="item-border list">
<div class="item-image">
<a href="//www.tarad.com/product/5913180" title="ลำโพงน่ารัก dog">
<img src="//img.trd.cm/120/120/sumpow/img-lib/spd_20140314140410_b.jpg"
alt="ลำโพงน่ารัก dog" data-pagespeed-url-hash="3676782613"
onload="pagespeed.CriticalImages.checkImageForCriticality(this);">
</a>
</div>
<div class="item-details">
<div class="product-name">
<a href="//www.tarad.com/product/5913180" title="ลำโพงน่ารัก dog">ลำโพงน่ารัก dog</a>
</div>
</div>
</div>
</li>
<!--end : product-list-->
<!--start : product-list-->
<li>
<div class="item-border list">
<div class="item-image">
<a href="//www.tarad.com/product/6755464" title="Brewdog Magic Stone Dog - 330 ml - 5">
<img src="//www.tarad.com/images/web_main/default150x150.gif"
alt="Brewdog Magic Stone Dog - 330 ml - 5" data-pagespeed-url-hash="2123596038"
onload="pagespeed.CriticalImages.checkImageForCriticality(this);">
</a>
</div>
<div class="item-details">
<div class="product-name">
<a href="//www.tarad.com/product/6755464" title="Brewdog Magic Stone Dog - 330 ml - 5">
Brewdog Magic Stone Dog - 330 ml - 5</a>
</div>
</div>
</div>
</li>
<!--end : product-list-->
....
....
....
</ul>
</div>
</div>
</div>
</div>
</div>