Robotframework 如何在robot框架中不使用python处理动态webtable
我已尝试使用此问题答案中提到的代码:- 我必须选择表数据中的所有复选框,请告诉我是否可以以更好的方式完成 以下是html:Robotframework 如何在robot框架中不使用python处理动态webtable,robotframework,Robotframework,我已尝试使用此问题答案中提到的代码:- 我必须选择表数据中的所有复选框,请告诉我是否可以以更好的方式完成 以下是html: <div class="col-sm-12"> <table id="grddesignation" class="table display table-bordered dataTable no-footer dtr-inline" role="grid" aria-describedby="grddesignation_info" style
<div class="col-sm-12">
<table id="grddesignation" class="table display table-bordered dataTable no-footer dtr-inline" role="grid" aria-describedby="grddesignation_info" style="width: 0px;">
<thead>
<tr style="text-align: center;" role="row">
<th style="text-align: center; width: 0px;" class="hidden sorting_asc" tabindex="0" aria-controls="grddesignation" rowspan="1" colspan="1" aria-label="EmpId: activate to sort column descending" aria-sort="ascending">EmpId</th><th style="text-align: center; width: 0px;" class="sorting" tabindex="0" aria-controls="grddesignation" rowspan="1" colspan="1" aria-label="Employee Id: activate to sort column ascending">Employee Id</th>
<th style="text-align: center; width: 0px;" class="sorting" tabindex="0" aria-controls="grddesignation" rowspan="1" colspan="1" aria-label="Employee Name: activate to sort column ascending">Employee Name</th>
<th style="text-align: center; width: 0px;" class="sorting_disabled" rowspan="1" colspan="1" aria-label="Sunday">Sunday</th>
<th style="text-align: center; width: 0px;" class="sorting_disabled" rowspan="1" colspan="1" aria-label="Monday">Monday</th><th style="text-align: center; width: 0px;" class="sorting_disabled" rowspan="1" colspan="1" aria-label="Tuesday">Tuesday</th>
<th style="text-align: center; width: 0px;" class="sorting_disabled" rowspan="1" colspan="1" aria-label="Wednesday">Wednesday</th><th style="text-align: center; width: 0px;" class="sorting_disabled" rowspan="1" colspan="1" aria-label="Thursday">Thursday</th><th style="text-align: center; width: 0px;" class="sorting_disabled" rowspan="1" colspan="1" aria-label="Friday">Friday</th>
<th style="text-align: center; width: 0px;" class="sorting_disabled" rowspan="1" colspan="1" aria-label="Saturday">Saturday</th></tr>
</thead>
<tbody>
<tr role="row" class="odd">
<td class="hidden sorting_1" tabindex="0">
<input id="wEmployeeID" class="form-control EmpCode hidden" name="EmpCode" value="962">962
</td>
<td>000971</td><td>TESTING TWO</td>
<td>
<input id="wsun" class="form-control wsun" type="checkbox" value="0">
</td>
<td>
<input id="wmon" class="form-control wmon" type="checkbox" value="1">
</td>
<td>
<input id="wtue" class="form-control wtue" type="checkbox" value="2">
</td>
<td>
<input id="wwed" class="form-control wwed" type="checkbox" value="3">
</td>
<td>
<input id="wthu" class="form-control wthu" type="checkbox" value="4">
</td>
<td>
<input id="wfri" class="form-control wfri" type="checkbox" value="5">
</td>
<td>
<input id="wsat" class="form-control wsat" type="checkbox" value="6">
</td>
</tr>
</tbody>
</table>
</div>
员工Id
员工姓名
星期日
星期一星期二
星期三星期四星期五
星期六
962
000971测试二
要开始使用robot框架,您需要具备一些python的基本知识
关于处理动态表-我假设标题字段Employee Id
将具有唯一的值,并且我使用它绘制xpath-以下几行应该可以为您完成这项工作,只需稍加修改,您可以根据需要进行更改-
***** Test Case *****
Launch browser and select checkbox
open browser file:///C:/Users/xxxx/xxxx/temp.html Chrome
#wait until page loads the element
Wait Until Page Contains Element //th[text()='Employee Id']/ancestor::thead/following-sibling::tbody//td[text()='000971']
#select the checkbox of sunday for employee id 000971
select checkbox //th[text()='Employee Id']/ancestor::thead/following-sibling::tbody//td[text()='000971']/following-sibling::td[2]/input
输出-
robotframework不过是python,不使用python的
是什么意思?用例是什么?我不想使用任何python类,如果我想实现robot框架,学习python是必须的吗?为什么你删除了链接到帖子的问题?现在检查第一条语句代码在哪里?这有意义吗?除非你不清楚你在做什么,你在问什么,否则没有朋友能帮助你,即使他们想帮助你!!下次请阅读并发布问题。我删除了它,因为我不确定它是否是我所问问题的正确解决方案。