温馨提示:本文翻译自stackoverflow.com,查看原文请点击:robotframework - Keyword 'Selenium2Library.Click Element' expected 1 to 3 arguments, got 0
robotframework selenium2library

robotframework - 关键字“ Selenium2Library.Click元素”预期为1到3个参数,得到0

发布于 2020-04-17 15:27:38

我正在尝试使用robotframework从下面的列表中选择第一项:

<select id="organization_saml_enabled" name="organization[saml_enabled]">
   <option value="true">SAML SSO enabled</option>
   <option value="false" selected="selected">SAML SSO disabled</option>
</select>

使用此代码段:

Click Element  //select[@id="organization_saml_enabled"]/option[@value="true"]

我得到错误 Keyword 'Selenium2Library.Click Element' expected 1 to 3 arguments, got 0.

我不明白,因为从理解文档的方式来看,Click元素需要定位器和可选的偏移量。谁能帮我检查一下我在这里缺少什么。

查看更多

提问者
micthaworm
被浏览
23
asprtrmp 2020-02-05 15:47

xpath:在实际定位符之前添加定位符策略(),并记住在关键字和参数之间至少有两个空格:

Click Element    xpath://select[@id="organization_saml_enabled"]/option[@value="true"]