机器人框架使用IF条件识别卡类型

发布于 2025-02-08 05:42:14 字数 208 浏览 3 评论 0原文

选择按钮之前,需要检查输入或输出卡。 需要逻辑来使用机器人框架以及Web自动化测试条件来识别其输入或输出卡。

 **IO CARDS**
  SLOT 1 :DI
  SLOT 2 :DI
  SLOT 3 :DI
  SLOT 4 :DI
  SLOT 5 :DO
  SLOT 6 :DO
  SLOT 7 :DI

请尝试解决这个问题

Before selecting button, need to check either input or output card.
need a logic to identify either it is INPUT or OUTPUT Card using robot framework and if condition for web automation testing.

 **IO CARDS**
  SLOT 1 :DI
  SLOT 2 :DI
  SLOT 3 :DI
  SLOT 4 :DI
  SLOT 5 :DO
  SLOT 6 :DO
  SLOT 7 :DI

Please try to solve this

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

情泪▽动烟 2025-02-15 05:42:14
${elementId}= |  Set Variable | Slot${slotNumber}BTN
Log To Console |  ${elementId}    

Click Element   |    slot${slotNumber}BTN
Sleep |  3s
 
${slotLink} =  |  get text   | id=slot${slotNumber}BTN        
Log to Console |  ${slotLink}  
IF   | '${slotLink}'== 'Slot ${slotNumber} : DI'        
    Validate Input Card Options  ${slotNumber}
END
IF   | '${slotLink}'== 'Slot ${slotNumber} : DO'        
    Validate Output Card Options  ${slotNumber}
END
${elementId}= |  Set Variable | Slot${slotNumber}BTN
Log To Console |  ${elementId}    

Click Element   |    slot${slotNumber}BTN
Sleep |  3s
 
${slotLink} =  |  get text   | id=slot${slotNumber}BTN        
Log to Console |  ${slotLink}  
IF   | '${slotLink}'== 'Slot ${slotNumber} : DI'        
    Validate Input Card Options  ${slotNumber}
END
IF   | '${slotLink}'== 'Slot ${slotNumber} : DO'        
    Validate Output Card Options  ${slotNumber}
END
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文