#153 open
Zach Dennis

within should support xpath

Reported by Zach Dennis | February 3rd, 2009 @ 10:46 PM | in 0.5

The current #within method supports only css selectors. When trying to use xpath it still tries to use CSS. For example, in scope.rb the scoped_dom method always uses #css_at:

    def scoped_dom
      Webrat::XML.css_at(@scope.dom, @selector)

There are some dom traversal techniques in which xpath is better suited than css (such as traversing down the dom and then back up which css can't do). xpath can usually be spotted by checking if the selector string starts with backslashes and since backslashes aren't used with css selectors AFAIK there shouldn't be any confusion or edge cases.


Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Ruby Acceptance Testing for Web applications.

Shared Ticket Bins