[ 
http://jira.openqa.org/browse/WTR-437?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=19642#action_19642
 ] 

Ethan commented on WTR-437:
---------------------------

Performance comparison of hash to arguments is negligible and no issue, agreed. 

Regarding "support both of these syntaxes for every new part you code and 
everyone else codes" - no, not at all. This only needs to be dealt with in one 
place, between container methods taking their args and initializing a new 
Element object from them. There's no reason this should affect more than one 
piece of code in one place. 

No, users won't be likely to use ole_obect. xpath is used with some frequency 
though. I don't buy into your recommendation not to use it, but either of our 
opinions on it aren't relevant here: watir does support it, and it will need to 
be in the API in some way that makes sense. It can't be combined with other 
stuff, so a hash makes less sense than two-argument how/what. 

> Allow only hash locators when searching for elements
> ----------------------------------------------------
>
>                 Key: WTR-437
>                 URL: http://jira.openqa.org/browse/WTR-437
>             Project: Watir
>          Issue Type: New Feature
>          Components: Other
>    Affects Versions: 2.0
>         Environment: any
>            Reporter: Jarmo Pertman
>
> So, text_field(:id, 'sfdsa') is not allowed anymore. Why?
> Well, it's again to have less syntax for finding elements and you can
> use only hash when using multiple identifiers anyway.
> Especially newcomers might get confused if at one place they read
> text_field(:id => 'sfdsa') and other place comma
> is used.
> This is actually a 3 step improvement:
> 1) Remove all usages of comma in tutorials/documentation/examples at Watir 
> websites and Watir code.
> 2) Having backwards incompatibilities in mind i recommend to just
> deprecate it in Watir 2.0 and remove completely in some newer version.
> What if we issue Kernel.warn for every comma usage and show some
> message when executing b.text_field(:id, "blah"):
> ***
> Using 2 parameters as a element locator is DEPRECATED! Use at
> c:/projects/project/spec/some_file_spec.rb:45 this instead:
> text_field(:id => "blah")
> ***
> It might get messy at first if comma notation is used a lot, but it
> gives a possibility to clean things up and even to create some script
> which would analyze this log and do it for you automatically.
> 3) Remove support for comma syntax completely in some newer version

-- 
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