Get  Text关键字:用来获取文本内容;

 

接受一个参数 [ locator ],locator参数指的是定位界面元素的方式;

 

=============================================================

 

示例:打开百度首页,获取name=tj_trnews包含的文本内容;

 

Open Browser    http://www.baidu.com    chrome

${text} Get  Text    name=tj_trnews                                    //通过name来进行定位的

log ${text}                                                  //打印 新闻  2个字

Close Browser

 

----------------------------------------------------------------------------------------------------------------

 

Open Browser    http://www.baidu.com    chrome

${text} Get  Text    //*[@/a[1]]                                    //通过xpath来进行定位的

log ${text}                                                  //打印 新闻  2个字

Close Browser

 

相关文章:

  • 2021-12-22
  • 2022-12-23
  • 2022-12-23
  • 2021-09-24
  • 2021-12-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-02-16
  • 2022-12-23
  • 2022-01-23
  • 2021-07-04
  • 2022-12-23
相关资源
相似解决方案