On Fri, Apr 15, 2011 at 8:18 PM, Alok Menghrajani <[email protected]> wrote:
> For firewatir, watir uses getAttribute:
>
> In firewatir/lib/firewatir/element.rb:
>
> 413 if(how == \"href\" || how == \"src\" || how == \"action\" || how ==
> \"name\")
> 414 {
> 415 attribute = element.getAttribute(how);
> 416 }
>
>
>
> I think we should:
> - read the attribute from the DOM (through JS, OLE, or whatever...).
> convert it to an absolute URI if it is not.
> - take the user's input.
> convert it to an absolute URI if it is not.
> - Compare the two.
>
I still think that it should be relative URI and not an absolute one. I,
myself haven't searched any link by using an absolute URI and always use a
regexp for searching. Any point to have them as an absolute?
Also, my initial email last night was pointing out some other issues:
> 1. Where should we put a unittest for this stuff ?
>
If the unittest covers FireWatir and Watir and you can make it pass for both
of them, then it should be under commonwatir/unittests.
2. Should browser.element(:xpath, ...) work (currently fails on IE &
> firefox) ?
Or is this something that's deprecated ?
>
If i'm not mistaken then the #element is a quite new method in Watir and was
meant to search for some general elements. I guess the :xpath locator is not
implemented for it. In FireWatir there isn't that method at all. I haven't
used that method at all since it returns some more general object, which
doesn't have the element-specific methods. So it's usually quite useless
IMO.
> 3. Should browser.element_by_xpath(...) work ?
> It currently fails on IE.
>
It is working. The problem is just that #element_by_xpath returns the OLE
element and that doesn't have any Ruby methods like #exists?
irb(main):005:0> b.element_by_xpath("//input")
=> #<WIN32OLE:0xfc044d0>
>
> Alok
>
Jarmo
_______________________________________________
Wtr-development mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-development