[Wtr-general] Multiple failure scenarios with Checkbox methods

Scott Pack softwarespack at yahoo.com
Thu Jun 23 19:44:15 EDT 2005


Hi,

Not sure you are aware of this, I didn't see any
mention of the problem in the archives.

Checkbox methods fail if on the page under test you
have a table that contains hrefs, and or
ordered/numbered lists as data. The methods either
fail to find the checkbox's or find the incorrect
element. Does not have to be in the same table either.

In the case below checkbox.flash finds the incorrect
object -> hrefs, li, etc and FLASHES them! But for
exists and set, I am unable to find the controls by
any combination of name, value or index attributes. 

I hope that you will address this very soon.

Below is a test script and html:

#--------------------------------------------------------------------------------
# Checkbox failures for tables with href and ul/ol
elements
#--------------------------------------------------------------------------------

require 'test/unit'
require 'watir'
include Watir

class TestAdministration < Test::Unit::TestCase
  @ie = nil;
  @url = "HTTP://localhost/epmcheckbox.html"
	
  def setup
    @ie = IE.new
    @ie.goto("HTTP://localhost/velocity.html")
  end

  def teardown
    @ie.close
  end

  def testEditCapabilities
    @ie.checkbox(:index, 1).flash
    @ie.checkbox(:index, 2).flash
    @ie.checkbox(:index, 3).flash
    @ie.checkbox(:index, 4).flash
    @ie.checkbox(:index, 5).flash
    @ie.checkbox(:index, 6).flash
    @ie.checkbox(:index, 7).flash
    @ie.checkbox(:index, 8).flash
  end
end

<!-- velocity.html -->
<html>
<head><title >FooBar</title></head>
<body>

<form action="" method="post">
<table>
<!-- a/hrefs tags cause checkbox methods to fail -->
<tr><td width="100%">Row1</td></tr>
<tr><td><a href="">HRef1</a></td></tr>
<tr><td><a href="">HRef2</a></td></tr>

<!-- and ul/ol tags in tables cause checkbox methods
to fail -->
<!-- checkbox.flash causes three hits: 2 for LI1/HRef1
and 1 for HRef2 -->
<tr><td>
<ul>
<li><a href="">ListItem1 and HRef3</a></li>
<li><span>ListItem2</span></li>
</ul>
</td>
</tr>

<tr>
<td>
<!-- only the first checkbox is flashed.... -->
<input type="checkbox" name="FooBarCheckbox"
value="CB1"><span>CB1</span><br>
<input type="checkbox" name="FooBarCheckbox"
value="CB2"><span>CB2</span><br>
<input type="checkbox" name="FooBarCheckbox"
value="CB3"><span>CB3</span><br>
<input type="checkbox" name="FooBarCheckbox"
value="CB4"><span>CB4</span><br>
<input type="checkbox" name="FooBarCheckbox"
value="CB5"><span>CB5</span><br>
<input type="checkbox" name="FooBarCheckbox"
value="CB6"><span>CB6</span><br>
<input type="checkbox" name="FooBarCheckbox"
value="CB7"><span>CB7</span><br>
<input type="checkbox" name="FooBarCheckbox"
value="CB8"><span>CB8</span><br>
</td>
</tr>
</table>
</form>
</body>
</html>


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the Wtr-general mailing list