You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Documentation error for desription of "Using webelement" #469
The keyword documentation has:
Starting with version 1.7 of the Selenium2Library, one can pass an argument that contains a WebElement instead of a string locator. To get a WebElement, use the new Get WebElements keyword. For example:
${elem} = Get WebElements id=my_element
Click Element ${elem}
This can obviously not work, as Get WebElements returns a list. I think it should be
${elements} = Get WebElements id=my_element
Click Element ${elements}.first()
Or similar
I think it would be convenient to have Get WebElement separately.
For example, XML library has both Get Elements and Get Element keywords. The former returns a list of elements and the list can be empty. The latter fails if there is not exactly one element. Would that make sense in S2L context?
From: ext Pekka Klärck [mailto:notifications@github.com]
Sent: Tuesday, July 28, 2015 8:16 AM
To: rtomac/robotframework-selenium2library
Cc: Arand, Thomas (Nokia - DE/Munich)
Subject: Re: [robotframework-selenium2library] Documentation error for desription of "Using webelement" (#469)
I think it would be convenient to have Get WebElement separately.
For example, XML library has both Get Elements and Get Element keywords. The former returns a list of elements and the list can be empty. The latter fails if there is not exactly one element. Would that make sense in S2L context?
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/469#issuecomment-125464010.
Activity
just-be-dev commentedon Jul 27, 2015
Ugh, yeah, you're right. We'd planned on adding a
Get WebElementkeyword that just returned a single item. That slipped through the cracks though.I'll look at rewording the documentation and possibly introducing that keyword.
just-be-dev commentedon Jul 28, 2015
Should I add
Get WebElementor just suggest people useGet WebElementscombined with@{list}[0]?just-be-dev commentedon Jul 28, 2015
@pekkaklarck, is there any precedence for this? Having two keywords, one that returns a list of items and the other that returns just the first.
pekkaklarck commentedon Jul 28, 2015
I think it would be convenient to have
Get WebElementseparately.For example, XML library has both
Get ElementsandGet Elementkeywords. The former returns a list of elements and the list can be empty. The latter fails if there is not exactly one element. Would that make sense in S2L context?tarand commentedon Jul 28, 2015
I would say, yes.
Thomas
Thomas Arand
Tel. +49 (89) 5159 36328 / +49 (160) 90888023
thomas.arand@nokia.commailto:thomas.arand@nsn.com
Nokia Solutions and Networks Deutschland GmbH
From: ext Pekka Klärck [mailto:notifications@github.com]
Sent: Tuesday, July 28, 2015 8:16 AM
To: rtomac/robotframework-selenium2library
Cc: Arand, Thomas (Nokia - DE/Munich)
Subject: Re: [robotframework-selenium2library] Documentation error for desription of "Using webelement" (#469)
I think it would be convenient to have Get WebElement separately.
For example, XML library has both Get Elements and Get Element keywords. The former returns a list of elements and the list can be empty. The latter fails if there is not exactly one element. Would that make sense in S2L context?
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/469#issuecomment-125464010.
just-be-dev commentedon Jul 28, 2015
I thought it was needed originally, and I still think it'd be nice to have.
just-be-dev commentedon Aug 14, 2015
Fixed in 1.7.3