获取当前页列表数据

1、获取当前页显示数据个数

1     ${count}    Get Matching Xpath Count    .//div[@id="tabs"]/div[2]/div[1]//div[@class="datagrid-view2"]//ancestor::table[@class="datagrid-btable"]/tbody/tr

2、循环输出单元格数据

1 log    ${count}
2     : FOR    ${n}    IN RANGE    ${count}
3     \    ${a}    Get Text    xpath=.//div[@id="tabs"]/div[2]/div[1]//ancestor::table[@class="datagrid-btable"]/tbody/tr[${n+1}]/td[@field="ProjectNo"]/div
4     \    ${b}    Get Text    xpath=.//div[@id="tabs"]/div[2]/div[1]//ancestor::table[@class="datagrid-btable"]/tbody/tr[${n+1}]/td[@field="ProjectType"]/div
5     \    Run Keyword If    ${n}==10    Exit For Loop
6     Run Keyword If    '${b}'=='成套办公'    log    pass
7     ...    ELSE    log    Fail

 

posted @ 2017-02-10 17:42  逍遥无名  阅读(574)  评论(0)    收藏  举报