Warm tip: This article is reproduced from stackoverflow.com, please click
robotframework selenium2library

Keyword 'Selenium2Library.Click Element' expected 1 to 3 arguments, got 0

发布于 2020-04-16 12:36:48

I'm trying to select the first item from the list below using 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>

With this snippet:

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

I get the error Keyword 'Selenium2Library.Click Element' expected 1 to 3 arguments, got 0.

I dont get it because from the way i understand the documentation the Click Element needs the locator and optional offsets. Can anyone help me check what I'm missing here.

Questioner
micthaworm
Viewed
46
asprtrmp 2020-02-05 15:47

Add locator strategy (xpath:) before the actual locator and remember to have at least two spaces between keyword and argument:

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