[Celerity-users] Magic transmogrifying row object

Ben Butler-Cole ben at bridesmere.com
Wed Nov 25 10:37:34 EST 2009


Hello

I need to get at the underlying HtmlUnit object for a table row. When
I first tried it I discovered that it didn't have the methods I was
expecting. By trial and error I have discovered that the first time I
access the row's HtmlUnit object (via the .object method) it returns a
List. The second time it returns an HtmlTableRow. Ummm????

Here is the log of a real, live irb session where you can see this
happing. As a bonus we learn that Google's front page has tables in
it.

irb(main):019:0> browser = Celerity::Browser.new
irb(main):020:0> browser.goto('http://www.google.com')
irb(main):021:0> e = browser.row(:index, 1)

irb(main):022:0> puts e.object.getClass
class java.util.Collections$UnmodifiableRandomAccessList

irb(main):023:0> puts e.object.getClass
class com.gargoylesoftware.htmlunit.html.HtmlTableRow

I can live with this because a random e.object in my code fixes the
problem. But any idea what's going on? Shall I raise a bug?

Thanks
Ben


More information about the Celerity-users mailing list