Documentation: | Return value of element attribute. |
---|---|
Start / End / Elapsed: | 20110418 17:49:52.221 / 20110418 17:49:56.707 / 00:00:04.486 |
17:49:56.707 | INFO | ${fieldType} = frm_inputShort |
When i get a 'type' attribute it returns error: KEYWORD: ${fieldType} = SeleniumLibrary.Get Element Attribute //input[@id="lastName"]@type
|
Since class works I suspect this could be a Selenium issue. Could you
try can you get the type value if you use Selenium IDE? The Selenium
command `Get Element Attribute` ends up using is `getAttribute`.
Cheers,
.peke
--
Agile Tester/Developer/Consultant :: http://eliga.fi
Lead Developer of Robot Framework :: http://robotframework.org
At least the first isn't too much related because it affects the new
WebDriver based APIs and SeleniumLibrary still uses old Selenium 1.0
APIs (that are still present in Selenium 2.0).
> more over i tried to
> Call Selenium Api getAttribute //input[@id="lastName"]@type
>
> and got the same result.
This pretty much confirms that this is a Selenium issue, though. Have
you tested this with different browsers? The problem could be somehow
related to how browsers parse the source code into DOM. Anyway, you
might want to submit an issue about this to Selenium's issue tracker.
> What a workaround can be proposed here? hm...
>
> More obvious is to write own RegExp parser function for a while...
Getting the whole page source and verifying it contains expected
content sounds like a good plan. Notice, though, that the source you
get from Selenium may also differ depending on the browser.
> Pekka, thanks for reply.
Glad I was able to help!
I recently created a small utility library for verifying content on
HTML pages[1]. It currently only works for local files, but could
easily be extended to also remote files. Verifying attributes of
elements would also be very easy to add.
If you are interested in helping with this approach, feel free to
create an issue in the project pages to get started.
[1] https://github.com/robotframework/HTMLChecker/
thanks,
--J
--
Janne Härkönen | http://reaktor.fi
http://twitter.com/#!/janneharkonen