如何将变量从.yaml文件访问到robot框架脚本?

2024-09-30 23:29:50 发布

您现在位置:Python中文网/ 问答频道 /正文

我有Myvariable.yaml文件和sample.robot文件,我想使用从.yaml文件到robot文件的变量

  • Myvariable.yaml文件:

      ACFC NEWS:
           Doc_Title:  XPath=//div[@class='ng-scope']
           Open_selector:  xpath=//button[@class='btn btn-default ng-binding]
    
  • Sample.robot文件

      ***Settings****
      Variables  Myvariable.yaml
    
      ***Keywords****
      Choose Topic:
           Input Text   ${Doc_Title}   "Some text"
           Click Button   ${Open_Selector}
    

错误:找不到变量

如果有人能帮我解决这个问题,那就太好了。

提前谢谢


Tags: 文件sampledivyamldoctitlerobotopen