Hi,
Newbie with selenium with watir webdriver...
I have the following code( I have omitted code I suppose is less
likely to be relevant):
label = $browser.label(:text, what)
if label.exists?
if label.for.blank?
puts no 'for' attribute, will try first content if $DEBUG
begin
puts trying checkbox
return label.checkbox(:index, 1)
rescue
...
And content like this
labelinput type=checkbox autocomplete=off name=topiccode
value=2Regnskab/label
When I look for the label Regnskab I find it, but when I run the
label.checkbox(:index, 1) I get
And I click Regnskab #
features/step_definitions/general_navigation.rb:61
unable to locate element, using
{:index=1, :tag_name=input, :type=checkbox}
(Watir::Exception::UnknownObjectException)
Any particular explanation on this?
In case I can't find a solution on this I was thinking to use xpath -
can someone give me an example of doing the above with xpath in
selenium using watir webdriver?
Thanks,
Bryan Rasmussen
--
Before posting, please read http://watir.com/support. In short: search before
you ask, be nice.
watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com