[ 
http://jira.openqa.org/browse/WTR-419?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Zeljko closed WTR-419.
----------------------


If this is still a problem, please report it here: 
https://github.com/watir/watir-classic/issues

> :xpath performaing wrong call to nokogiri in ie-class.rb
> --------------------------------------------------------
>
>                 Key: WTR-419
>                 URL: http://jira.openqa.org/browse/WTR-419
>             Project: Watir
>          Issue Type: Bug
>          Components: Xpath Support
>    Affects Versions: 1.6.5
>         Environment: Windows/Watir 1.6.5
>            Reporter: Matt Baker
>            Assignee: Charley Baker
>             Fix For: 1.6.6
>
>
> Line 910 of ie-class.rb uses the "search" method provided by Nokogiri, which 
> will search for either a CSS selector or an xpath. Nokogiri decides which 
> type you're using via a regex that matches an expression starting with a "(" 
> as a CSS selector.
> Because of this some xpaths will fail when using the search() method.
> Ex.
> When /^I select option ([1-9]+) of "([^\"]*)"$/ do |idx, field_name|
>         @browser.radio(:xpath, "(//input[@name='#{field_name}'])[position()=#
> {idx}]").click
> end
> This example is a valid xpath expression, I'm relying upon those parentheses 
> to allow me to refer nodes in the node-set by index.
> My proposal would be to change the following in ie-class.rb...
> doc.search(xpath).each do |element|
> ...to...
> doc.xpath(xpath).each do |element|
> ... which will explicitly treat the string as an xpath expression. I think 
> this is semantically correct since we refer to the "how" by saying ":xpath." 
> From an end-user perspective I would expect the corresponding call underneath 
> to be explicit instead of supporting css or xpath selectors.
> If folks need the CSS selectors perhaps we could provide a :css option?
> I'm sure some folks might have differing opinions on this, but we've made the 
> switch and it seems to be working nicely so far, plus we've been able to 
> continue development.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.openqa.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        
_______________________________________________
Wtr-development mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-development

Reply via email to