这是我的代码:
:FOR ${a} IN RANGE 2 ${Row_Count}
\ Run Keyword If '${temp}'== 'True' Click Link xpath=//table[@id='listAllSTR']/tbody/tr[${a}]/td[2]/a and
\ ... Screen validation for Answered ${STR_detail} and
\ ... ELSE Continue For Loop
\ Run Keyword If ${a}>${Row_Count} Exit For Loop**
Run Code Online (Sandbox Code Playgroud)
当 if 条件通过时(即 if '${temp}'== 'True'),我需要点击一个链接,但我收到一条错误消息
关键字“Selenium2Library.Click Link”应为 1 个参数,得到 5 个。
我不知道该怎么办。
谁能帮我吗?
关于问题。
您在 if 语句中执行多个关键字,因此它将其他关键字作为第一个关键字的参数。
解决方案
您可以创建自定义关键字并向其添加其他关键字。在您的 if 语句中使用此自定义关键字。见下面的例子。
*** Keywords ***
Custom Keyword From If
[Documentation] Keywords documentation.
keyword1
keyword2
*** Test Cases ***
Test Custom Keyword
Run Keyword If '${a}'=='True' Custom Keyword From If
Run Code Online (Sandbox Code Playgroud)
笔记:
对于执行多个关键字机器人具有关键字“运行关键字”,请参阅文档链接
| 归档时间: |
|
| 查看次数: |
6638 次 |
| 最近记录: |