Thanks, Ethan and Charley.

I didn't write this script, and the person who did left a few years ago, so
I can't say why he did what he did, but he wrote LOTS of scripts that parse
html in this way. He was trying to make the scripts really flexible, and
kind of act like a manual tester just trying lots of different cases on the
page. So the test scrapes all the data on the page and clicks different
anniversary dates for different people listed.

I think it's overkill, and we need to refactor these tests and simplify
them. I didn't know about the order with html - that's good to know. It's a
wonder the test has run fine all these years.

I'll put a bug in about the error message.
thanks,
Lisa

On Fri, Sep 3, 2010 at 2:03 PM, Ethan <notet...@gmail.com> wrote:

> There are several problems here.
>
> - The attributes of an html object aren't meant to be in any particular
> order; them changing is not really a bug.
> - Using a regexp to parse html is a fundamentally broken idea.
> - Why are you passing a third argument to #radio at all if you are just
> getting that value from the html, corresponding to the same element you are
> trying to retrieve? why not just do ie.radio(:name, 'anniversaryDate') ?
>
> The error message isn't great, that is true. I would recommend to open a
> ticket for that at http://jira.openqa.org/browse/WTR
>
>
> On Fri, Sep 3, 2010 at 15:34, Lisa Crispin <lisa.cris...@gmail.com> wrote:
>
>> I had a script fail when running it on IE8, it's several years old and
>> works fine on IE7. It's setting a radio button:
>> ie.radio(:name, 'anniversaryDate', anniversary_date).set
>> The value of anniversary_date is a date like '10-01-2008' (at least, in
>> IE7), it's set by using regex to parse the html
>>   anniv_regex = /id=anniversaryDate(\d+).*?value="?(.+?)"? name=/
>>
>> In IE7 the html looks like this:
>> <input type="radio" value="10-01-1992" name="anniversaryDate"
>> id="anniversaryDate1">
>>
>> In IE8 the html looks like this:
>> <input name="anniversaryDate" id="anniversaryDate1" type="radio"
>> value="10-01-1992"/>
>>
>> In IE7, the value of anniversary_date ends up as: 10-01-2010
>> In IE8, the value of anniversary_date ends up as: 10-01-2010 type=radio
>>
>> And I get an error "Watir::Exception::UnknownObjectException: Unable to
>> locate element, using :name, "anniversaryDate"
>>     C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:56:in
>> `assert_exists'
>>     C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:288:in
>> `enabled?'
>>     C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:60:in
>> `assert_enabled'
>>
>> C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/input_elements.rb:538:in
>> `set'"
>>
>> But in IRB if I type ie.radio(:name, 'anniversaryDate', '10-01-2010').set
>> it works fine - so it's not that it can't find the name, the value is wrong.
>>
>>
>> So one problem is a weird IE8 thing, I don't know what to do about that.
>> But the other problem is, the error message is misleading. I wasted some
>> time thinking something was wrong with the name.
>>
>> Thanks
>> Lisa
>>
>> --
>> Lisa Crispin
>> Co-author with Janet Gregory, _Agile Testing: A Practical Guide for
>> Testers and Agile Teams_ (Addison-Wesley 2009)
>> Contributor to _Beautiful Testing_ (O'Reilly 2009)
>> http://lisacrispin.com
>> @lisacrispin on Twitter
>>
>>  --
>> Before posting, please read http://watir.com/support. In short: search
>> before you ask, be nice.
>>
>> You received this message because you are subscribed to
>> http://groups.google.com/group/watir-general
>> To post: watir-general@googlegroups.com
>> To unsubscribe: 
>> watir-general+unsubscr...@googlegroups.com<watir-general%2bunsubscr...@googlegroups.com>
>>
>
>  --
> Before posting, please read http://watir.com/support. In short: search
> before you ask, be nice.
>
> You received this message because you are subscribed to
> http://groups.google.com/group/watir-general
> To post: watir-general@googlegroups.com
> To unsubscribe: 
> watir-general+unsubscr...@googlegroups.com<watir-general%2bunsubscr...@googlegroups.com>
>



-- 
Lisa Crispin
Co-author with Janet Gregory, _Agile Testing: A Practical Guide for Testers
and Agile Teams_ (Addison-Wesley 2009)
Contributor to _Beautiful Testing_ (O'Reilly 2009)
http://lisacrispin.com
@lisacrispin on Twitter

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: watir-general@googlegroups.com
To unsubscribe: watir-general+unsubscr...@googlegroups.com

Reply via email to