繁体   English   中英

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

[英]Robot framework identify card types using if condition

在选择按钮之前,需要检查输入卡或输出卡。 需要一个逻辑来识别它是使用机器人框架的输入卡还是输出卡,以及网络自动化测试的条件。

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

请尝试解决这个问题

${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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM