culerity icon indicating copy to clipboard operation
culerity copied to clipboard

elements_by_xpath seem not to be working since upgrading to 0.1.7 from 0.1.5

Open michaelglass opened this issue 15 years ago • 3 comments

just upgraded to 0.1.7 and most of my tests started breaking. Getting this error:

undefined method `to_xml' for "Culerity::RemoteObjectProxy.new(94, @io)":String (NoMethodError)

coming from this code:
$browser.elements_by_xpath("//table[@class='aeDays']//td")[day].to_xml

like I said: works in celerity. Works in 0.1.5. Any ideas?

michaelglass avatar Jun 22 '09 20:06 michaelglass

can you write a spec for this?

langalex avatar Aug 17 '09 18:08 langalex

you might also want to look at the commit history, there's not that many changes between 1.5 and 1.7 to find out what the problem is.

langalex avatar Aug 17 '09 18:08 langalex

Ran into this issue as well.

It was probably "working" in 0.1.5 because there was no special handling of Arrays in CelerityServer#proxify -- now there is, but it's broken. Now we're returning an Array of proxy objects rather than a proxy object which represents an Array. The problem is that the proxy objects are being eval'd on the other side as Strings instead of RemoteProxyObjects.

Wrote a spec for this and implemented a fix which is working for me.

http://gist.github.com/175700

brentd avatar Aug 26 '09 18:08 brentd