[wtr-general] click_no_wait doesn't work on radio buttons (Ruby1.8.7/Watir1.9.0)

2011-06-30 Thread GJHmf
Hi all,

I'm in the process of (finally) migrating from Ruby1.8.6/Watir1.6.2,
and am putting the combination of Ruby1.8.7/Watir1.9.0 through its
paces; and all credit to everyone involved in the Watir updates, it's
doing a pretty good job so far.  However, I'm running into issues
with .click_no_wait

By and large, .click_no_wait works fine on buttons, but does nothing
when used on a radio button.  It works fine under Ruby1.8.6/
Watir1.6.2, but not under Ruby1.8.7/Watir1.9.0.  I'm using the
following command:

browser.radio(:id, foo).click_no_wait

Any ideas?

Thanks,


GJHmf

-- 
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


[wtr-general] Re: click_no_wait doesn't work on radio buttons (Ruby1.8.7/Watir1.9.0)

2011-06-30 Thread Hugh McGowan
I'm not able to reproduce that on 1.9.0 or the pre-release. Could you
try with 1.9.1.rc1 (gem install watir --pre)? That release has some
fixes to handling fire_event and other 1.9 fixes that might correct
your issue.

If that still fails, can you set $DEBUG=true in your script and retry
the radio - there may be some info in there that will help point to
the issue. Failing something obvious there it would be great to get
some html that reproduces the issue.

Thanks!
Hugh

-- 
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


[wtr-general] Re: click_no_wait doesn't work on radio buttons (Ruby1.8.7/Watir1.9.0)

2011-06-30 Thread GJHmf
Hi Hugh, thanks for the reply.

Sadly this is no better on 1.9.1.rc1, and there's nothing obvious (to
me) in the debug log.  Here's all the info I have on the radio button
that I'm trying to click on, that ultimately displays an OK/Cancel
dialogue box when selected:

input name=Foo id=rdoFoo_1 onclick=ConfirmFoo();
type=radio value=rdoFoo_1/


... and to elaborate on what I'm trying to run, this works fine using
Ruby1.8.6/Watir1.6.2:

browser.radio(:id, rdoFoo_1).click_no_wait
hwnd = browser.enabled_popup(15)
if (hwnd)
popup = WinClicker.new
popup.makeWindowActive(hwnd)
popup.clickWindowsButton_hwnd(hwnd, OK)
end

... this doesn't work (for me) using Ruby1.8.7/Watir1.9.1.rc1; where
the click doesn't seem to be registered, so no dialogue box appears:

browser.radio(:id, rdoFoo_1).click_no_wait
browser.javascript_dialog.button('OK').click


A normal .click or .fire_event('onClick') successfully displays the OK/
Cancel dialogue box, but I then have seemingly no method of actioning
it without a '_no_wait' suffix.

Thanks,


Graham

-- 
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


[wtr-general] Running Watir-webdriver script causes DEP shutdown.

2011-06-30 Thread Alastair Montgomery
I've been trying to run Watir-webdriver with Firefox 5 on my XP machine, but 
every script I run cause Windows to shutdown Firefox due to Data Execution 
Prevention, even although I've set it not to apply to Firefox.
Has anyone else seen this issue?

Ruby version 1.8.7
selenium-webdriver 0.2.2
watir-webdriver 0.2.5

-- 
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


Re: [wtr-general] Running Watir-webdriver script causes DEP shutdown.

2011-06-30 Thread Jari Bakken
On Thu, Jun 30, 2011 at 3:49 PM, Alastair Montgomery doodl...@gmail.com wrote:
 I've been trying to run Watir-webdriver with Firefox 5 on my XP machine, but
 every script I run cause Windows to shutdown Firefox due to Data Execution
 Prevention, even although I've set it not to apply to Firefox.
 Has anyone else seen this issue?
 Ruby version 1.8.7
 selenium-webdriver 0.2.2
 watir-webdriver 0.2.5


That's interesting. Does it work if you turn off native events?

  prof = Selenium::WebDriver::Firefox::Profile.new
  prof.native_events = false

  Watir::Browser.new :firefox, :profile = prof

-- 
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


[wtr-general] Re: click_no_wait doesn't work on radio buttons (Ruby1.8.7/Watir1.9.0)

2011-06-30 Thread Hugh McGowan

You could also try a fire_event_no_wait and see if that works.
Otherwise I'll take a look tonight and see if I can work out what's
happening.

Hugh

-- 
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


[wtr-general] Watir to Count all objects, get the biggest

2011-06-30 Thread jose pinto optimus
Hi,

 am using watir to perform  web testes .It works fine.

Now,  I want to, perform others operations like:
-Count all objects, get the biggest.

Is it possible do it using watir ?

Thanks

José Pinto

-- 
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


[wtr-general] Re: Need help with Rspec and Watir Webdriver

2011-06-30 Thread Parag Dave


Hi

Here is the error list
./test8.rb:12: undefined method `text_field' for nil:NilClass
(NoMethodError)   from c:/ruby/lib/ruby/gems/1.8/gems/
rspec-1.2.9/lib/spec/example/example_group_methods.rb:183:in
`module_eval'  from c:/
ruby/lib/ruby/gems/1.8/gems/rspec-1.2.9/lib/spec/example/
example_group_methods.rb:183:in
`subclass' from c:/
ruby/lib/ruby/gems/1.8/gems/rspec-1.2.9/lib/spec/example/
example_group_methods.rb:55:in
`describe'  from
c:/ruby/lib/ruby/gems/1.8/gems/rspec-1.2.9/lib/spec/example/
example_group_factory.rb:31:in
`create_example_group'  from
c:/ruby/lib/ruby/gems/1.8/gems/rspec-1.2.9/lib/spec/dsl/main.rb:28:in
`describe'
from ./test8.rb:
4   from
c:/ruby/lib/ruby/gems/1.8/gems/rspec-1.2.9/lib/spec/runner/
example_group_runner.rb:15:in
`load'from
c:/ruby/lib/ruby/gems/1.8/gems/rspec-1.2.9/lib/spec/runner/
example_group_runner.rb:15:in
`load_files'  from
c:/ruby/lib/ruby/gems/1.8/gems/rspec-1.2.9/lib/spec/runner/
example_group_runner.rb:14:in
`each'from
c:/ruby/lib/ruby/gems/1.8/gems/rspec-1.2.9/lib/spec/runner/
example_group_runner.rb:14:in
`load_files'  from
c:/ruby/lib/ruby/gems/1.8/gems/rspec-1.2.9/lib/spec/runner/options.rb:
132:in
`run_examples'
from c:/ruby/lib/ruby/gems/1.8/gems/rspec-1.2.9/lib/spec/runner/
command_line.rb:9:in
`run'
from c:/ruby/lib/ruby/gems/1.8/gems/rspec-1.2.9/bin/spec:
5  from c:/Ruby/bin/spec:19:in
`load'  from c:/Ruby/bin/
spec:19

I am not able to access the elements by xpath i think (Some time i
have problem to access the element in normal watir script as well) I
generate the xpath with the Firefox Xpather and also with Inspect
element xpath generator. As i have to use xpath, as application i am
testing that might possible to  add id and name for all elements.

On Jun 29, 4:28 pm, Dave McNulla mcnu...@gmail.com wrote:
 Can you post the error messages so we can see what problems there were?

 Dave

-- 
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


[wtr-general] Re: Need help with Rspec and Watir Webdriver

2011-06-30 Thread Michael
Fix the indenting of your code and it should become clear:


require 'rubygems'
require 'watir-webdriver'
describe 'MySite' do
  before(:all) { @browser = Watir::Browser.new :firefox }
  it 'contains Google' do
@browser.goto 'http://google.com/'
@browser.text.should include 'google'
  end


# Code randomly in here - not in a validation or check that would
have
# before(:all) run before it.
@browser.text_field(:xpath,/html/body/div[@id='searchform']/
form[@id='tsf']/div/div[2]/table/tbody/tr[1]/td[1]/table/tbody/tr/
td[1]/div/table[@id='sftab']/tbody/tr/td[@id='lst-xbtn']/div/div[2]/
input).set (ruby)
@browser.button(:xpath,/html/body/div[@id='searchform']/
form[@id='tsf']/div/div[3]/center/input[1]).click



it 'contains Ruby'  do
@browser.text.should_not include 'Rails'
  end
  after(:all) { @browser.quit }
end

-- 
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


[wtr-general] Re: Need help with Rspec and Watir Webdriver

2011-06-30 Thread Michael
Sorry for the extra email - but easier to see properly indented (with
the tabs converted to spaces):

require 'rubygems'
require 'watir-webdriver'
describe 'MySite' do
  before(:all) { @browser = Watir::Browser.new :firefox }
  it 'contains Google' do
@browser.goto 'http://google.com/'
@browser.text.should include 'google'
  end


  # Code randomly in here - not in a validation or check that would
have
  # before(:all) run before it.
  @browser.text_field(:xpath,/html/body/div[@id='searchform']/
form[@id='tsf']/div/div[2]/table/tbody/tr[1]/td[1]/table/tbody/tr/
td[1]/div/table[@id='sftab']/tbody/tr/td[@id='lst-xbtn']/div/div[2]/
input).set (ruby)
  @browser.button(:xpath,/html/body/div[@id='searchform']/
form[@id='tsf']/div/div[3]/center/input[1]).click



  it 'contains Ruby'  do
@browser.text.should_not include 'Rails'
  end
  after(:all) { @browser.quit }
end

-- 
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


[wtr-general] Re: click_no_wait doesn't work on radio buttons (Ruby1.8.7/Watir1.9.0)

2011-06-30 Thread GJHmf
Hi,

My mistake, I forgot to add that into my post.  'fire_event_no_wait'
doesn't seem to do anything for me either.  I tried it after seeing a
similar thread from a few months ago; but having never used it in
anger, I discarded it once it didn't work.

Thanks,


GJHmf

-- 
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


[wtr-general] Re: click_no_wait doesn't work on radio buttons (Ruby1.8.7/Watir1.9.0)

2011-06-30 Thread Hugh McGowan
I set up something similar and was still not able to reproduce so
there's got to be something else going on here. I also tried in
IE7,8,9 and Quirks mode for the Document Mode but the click is always
succeeding.

It may be useful to see if this pared-down test will work for you:

!doctype html
input name=fire_event id=fire_event
onclick=javascript:alert('event fired'); type=radio value=1/
/html

browser.radio(:name= 'fire_event').click_no_wait

Can you give that a try?

Hugh

-- 
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


[wtr-general] Re: Need help with Rspec and Watir Webdriver

2011-06-30 Thread Parag Dave
Sorry Michael
Next time i will keep in mind that to post formatted code. By the way
the code that you post that also did not work for me.


./test8.rb:31: undefined local variable or method `have' for
Spec::Examor)
from c:/ruby/lib/ruby/gems/1.8/gems/rspec-1.2.9/lib/spec/
examplal'
from c:/ruby/lib/ruby/gems/1.8/gems/rspec-1.2.9/lib/spec/
exampl
from c:/ruby/lib/ruby/gems/1.8/gems/rspec-1.2.9/lib/spec/exampl
from c:/ruby/lib/ruby/gems/1.8/gems/rspec-1.2.9/lib/spec/
examplmple_group'
from c:/ruby/lib/ruby/gems/1.8/gems/rspec-1.2.9/lib/spec/dsl/ma
from ./test8.rb:24
from c:/ruby/lib/ruby/gems/1.8/gems/rspec-1.2.9/lib/spec/runner
from c:/ruby/lib/ruby/gems/1.8/gems/rspec-1.2.9/lib/spec/runner
from c:/ruby/lib/ruby/gems/1.8/gems/rspec-1.2.9/lib/spec/runner
from c:/ruby/lib/ruby/gems/1.8/gems/rspec-1.2.9/lib/spec/runner
from c:/ruby/lib/ruby/gems/1.8/gems/rspec-1.2.9/lib/spec/runner
from c:/ruby/lib/ruby/gems/1.8/gems/rspec-1.2.9/lib/spec/runner
from c:/ruby/lib/ruby/gems/1.8/gems/rspec-1.2.9/bin/spec:5
from c:/Ruby/bin/spec:19:in `load'
from c:/Ruby/bin/spec:19

On Jun 30, 11:29 am, Michael mmcwill...@gmail.com wrote:
 Sorry for the extra email - but easier to see properly indented (with
 the tabs converted to spaces):

 require 'rubygems'
 require 'watir-webdriver'
 describe 'MySite' do
   before(:all) { @browser = Watir::Browser.new :firefox }
   it 'contains Google' do
     @browser.goto 'http://google.com/'
     @browser.text.should include 'google'
   end

   # Code randomly in here - not in a validation or check that would
 have
   # before(:all) run before it.
   @browser.text_field(:xpath,/html/body/div[@id='searchform']/
 form[@id='tsf']/div/div[2]/table/tbody/tr[1]/td[1]/table/tbody/tr/
 td[1]/div/table[@id='sftab']/tbody/tr/td[@id='lst-xbtn']/div/div[2]/
 input).set (ruby)
   @browser.button(:xpath,/html/body/div[@id='searchform']/
 form[@id='tsf']/div/div[3]/center/input[1]).click

   it 'contains Ruby'  do
     @browser.text.should_not include 'Rails'
   end
   after(:all) { @browser.quit }
 end

-- 
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


[wtr-general] Watir 1.9.1 released - IE9 bug fixes

2011-06-30 Thread Hugh McGowan
Hi all,

Watir 1.9.1 has been released, containing fixes specific to IE9. There
are no feature changes in this release.

The only known IE9 problem is that file_fields are not working
properly (they of course work fine in IE8). We're currently looking
into this issue

Thanks!
Hugh

-- 
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