zoukankan      html  css  js  c++  java
  • RF(表格数据获取)

     一、表格数据获取

    • Get Table Cell  【locator | row | col】  获取表格数据
    Open Browser    file:///D:/HBuilderX/workspace/Projects/student_msg.html    gc            
    ${msg}    Get Table Cell    xpath=/html/body/table    2    1    #获取第二行第一列数据
    log    ${msg}  
    
    #结果如下
    20200312 13:49:51.753 :  INFO : ${msg} = 密码
    20200312 13:49:51.753 :  INFO : 密码

    二、表格断言

    • Table Cell Should Contain  【locator | row | column | expected】
      • 断言表格包含文本内容
    Open Browser    file:///D:/HBuilderX/workspace/Projects/student_msg.html    gc        
    Sleep    1            
    Table Cell Should Contain    xpath=/html/body/table    2    1    密码        #断言表格第二行第一列内容为 "密码"
    
    #结果如下
    20200312 13:57:14.254 :  INFO : Table cell contains '密码'.
    • Table Column Should Contain      【locator | column | expected】
      • 断言表格某列包含文本内容
    Open Browser    file:///D:/HBuilderX/workspace/Projects/student_msg.html    gc    
    Sleep    1        
    Table Column Should Contain    xpath=/html/body/table    1    密码
    Table Column Should Contain    xpath=/html/body/table    1    性别        #断言表格第一列表包含 "密码" 和 "性别"
    • Table Row Should Contain      【locator | row | expected】
      • 断言表格某行包含文本内容
    Open Browser    file:///D:/HBuilderX/workspace/Projects/student_msg.html    gc    
    Sleep    1        
    Table Row Should Contain    xpath=/html/body/table    1    用户名        #断言表格第一行包含 "用户名"
    • Table Should Contain  【locator | expected】
      • 断言表格包含内容
    Open Browser    file:///D:/HBuilderX/workspace/Projects/student_msg.html    gc    
    Sleep    1        
    Table Should Contain    xpath=/html/body/table    用户名    #断言表格中包含 "用户名"
  • 相关阅读:
    滚动计算基础知识
    Javascript继承
    提取URL字符串的搜索字符串中的参数
    C++编程练习(13)----“排序算法 之 堆排序“
    常见网络端口 和 常见网络协议
    TCP协议中的三次握手和四次挥手(图解)
    C++编程练习(14)-------“单例模式”的实现
    编程练习------C/C++分别实现字符串与整数的转换
    IPv4地址学习总结
    C/C++中的联合体
  • 原文地址:https://www.cnblogs.com/ZhengYing0813/p/12468901.html
Copyright © 2011-2022 走看看