Closed GoogleCodeExporter closed 8 years ago
This sounds reasonable (and trivial to implement)
Original comment by janne.t....@gmail.com
on 17 Oct 2011 at 5:22
1) Is innerHTML just an element attribute? If yes, isn't Get Element Attribute
enough instead of Get Inner HTML?
2) I don't think separate Log Inner HTML keyword is need anyway. We don't have
it for other elements or attributes either and you can very easily use BuiltIn
keyword Log for this purpose. The Log Source keyword is an exception for the
most common case.
Original comment by pekka.klarck
on 19 Oct 2011 at 10:40
I will confirm with a test shortly, but innerHtml is a special DOM attribute of
all elements, which might not be able to extract with the default Selenium's
getAttribute() method. Hence my suggested code snippet.
Getting attributes is generally for items that are exposed in the element
itself in source code like:
<input id=val value="some value" style="" attributeName="someValue"/>
Where id, value, style, and attributeName are all valid attributes. innerHtml
is never defined within an element tag. It's a special attribute that's only
manipulated and accessed by javascript and CSS. I believe as a Selenium user,
you also have to use javascript like browserbot to access such DOM attributes
or properties.
Original comment by manga...@gmail.com
on 19 Oct 2011 at 4:58
Verified trying to get the special DOM attribute with Get Element Attribute
fails.
FAIL ERROR: Could not find element attribute: id=promo-message@innerHTML
The following SeleniumLibrary command however works:
| ${html}= | Call Selenium Api | getEval |
this.browserbot.findElement('id=promo-message').innerHTML |
So we just need a keyword that will do that w/o user having to directly use the
Selenium API.
although the return value seemed to be a tuple for getEval, as returned by Call
Selenium Api:
${html} = OK,
<p><script>utmx_section("SMBHomePageTest")</script><a
href="/promo/tiny-prints-coupon-codes-promotions.htm"><strong>Save Big on
Holiday Cards! Enjoy Up to 20% Off Your Order</strong> | Code: OCTHO...
Original comment by manga...@gmail.com
on 24 Oct 2011 at 4:15
Original comment by pekka.klarck
on 4 May 2012 at 10:06
This issue was updated by revision 7b3c0f063258.
Original comment by robotframework@gmail.com
on 4 May 2012 at 11:59
We decided to implement only `Get Inner HTML`. You can easily use `Log` keyword
to log the value if needed.
Original comment by robotframework@gmail.com
on 4 May 2012 at 12:01
Get Inner HTML
keyword
Original issue reported on code.google.com by
manga...@gmail.com
on 17 Oct 2011 at 2:32