Oops, that was a bad subject line before. It's not Watir's fault IE8 is screwy.
On Fri, Sep 3, 2010 at 1:34 PM, 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 > > -- 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