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

Bret Pettichord commented on WTR-437:
-------------------------------------

I like this idea, and have proposed it myself in the past. I think it would 
take some time to push people to use the new syntax.

I particularly like the idea of us pushing the "Watir Way" (like the Ruby Way) 
which means that although there is more than one way to do it, there is a way 
that is considered to be the best idiom. In my personal practice, for some time 
now, I have focused on using the hash syntax exclusively.

I also agree that this would be a three step process, as outlined.

I suppose the first step is to really get agreement within the community that 
we want to exclusively promote the hash syntax and therefore update all our 
documentation to feature it. I think it is worth seeking agreement on that even 
if we can't get agreement on all three steps.



> 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