modal dialog support

7 views
Skip to first unread message

marcoa

unread,
May 9, 2008, 9:07:12 AM5/9/08
to Watir General
Being a newbie to all this and having a requirement to control a web
site which has modal dialogs I was wondering if someone could point me
to the latest and greatest combination of ruby and watir which will
support this task. I have tried using 182 and 1.5.x and numersious
interations via trial and error but I always errors out as soon as i
issue the require 'Watir' statement. If someone could help me work
through this it would be appreciated.

Marco

Carl Shaulis

unread,
May 9, 2008, 10:13:49 AM5/9/08
to watir-...@googlegroups.com
Marco,
 
Please send a snippet of code and any error messages for review.  After installing WATIR did you execute the unit tests? 
 
If not please run the unit tests and report on any errors.
 
The unit tests are a great indicator of installation stability and a great resource for troubleshooting. 
 
Cheers,
 
Carl

 

Ravi

unread,
May 9, 2008, 10:22:20 AM5/9/08
to Watir General
> I always errors out as soon as i issue the require 'Watir' statement.

Is it as simple as changing 'Watir' to 'watir'? (lower case w)

marcoa

unread,
May 9, 2008, 12:12:40 PM5/9/08
to Watir General
hmm execute unit tests, dumb question how do I do that??
> > Marco- Hide quoted text -
>
> - Show quoted text -

marcoa

unread,
May 9, 2008, 12:53:25 PM5/9/08
to Watir General
So I installed version 182-15 of ruby then installed the watir gem
using "gem install watir" accepted all default dependencies. I then
ran the interactive session as below and got the following:

Any suggestions will be considered :)

C:\>irb
irb(main):001:0> require 'watir'
Windows::API::Error: #<Windows::API::Error:0x2b07110>
from c:/ruby/lib/ruby/gems/1.8/gems/windows-api-0.2.3/lib/
windows/api.rb:331:in `initialize'
from c:/ruby/lib/ruby/gems/1.8/gems/windows-pr-0.8.3/lib/
windows/window.rb:40:in `new'
from c:/ruby/lib/ruby/gems/1.8/gems/windows-pr-0.8.3/lib/
windows/window.rb:40
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
18:in `require__'
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
18:in `require'
from c:/ruby/lib/ruby/gems/1.8/gems/win32-process-0.5.8/lib/
win32/process.rb:8
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
18:in `require__'
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
18:in `require'
from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.4/./watir/ie-
process.rb:1
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
18:in `require__'
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
18:in `require'
from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.4/./watir.rb:47
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
18:in `require__'
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
18:in `require'
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems.rb:175:in
`activate'
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
23:in `require'
from (irb):1
irb(main):002:0>





On May 9, 10:13 am, "Carl Shaulis" <carl.shau...@gmail.com> wrote:

Carl Shaulis

unread,
May 9, 2008, 3:05:16 PM5/9/08
to watir-...@googlegroups.com
On my local machine the unit tests are located here:
 
C:\Apps\watir_bonus\unitTests
 
You will need to find this path and execute the all_tests.rb script.
 
In the unitTests folder you will find example code for most common test scenarios.  I use this code as a guide to develop our tests.
 
I prefer to use eclipse to run the scripts, but you can run the script via command line.

marcoa

unread,
May 9, 2008, 4:51:53 PM5/9/08
to Watir General
Found the all_tests.rb and executed it from commandline see results
following:

C:\ruby\lib\ruby\gems\1.8\gems\watir-1.5.4\unittests>ruby all_tests.rb
c:/ruby/lib/ruby/gems/1.8/gems/windows-api-0.2.3/lib/windows/api.rb:
331:in `initialize':
GetProcAddress() failed for 'GetLayeredWindowAttributes',
'GetLayeredWindowAttributesA' and 'GetLayeredWindowAttributesW':
The specified procedure could not be found. Windows::API::Error)
from c:/ruby/lib/ruby/gems/1.8/gems/windows-pr-0.8.3/lib/
windows/window.rb:40:in `new'
from c:/ruby/lib/ruby/gems/1.8/gems/windows-pr-0.8.3/lib/
windows/window.rb:40
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
18:in `require__'
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
18:in `require'
from c:/ruby/lib/ruby/gems/1.8/gems/win32-process-0.5.8/lib/
win32/process.rb:8
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
24:in `require__'
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
24:in `require'
from ./../watir/ie-process.rb:1
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
18:in `require__'
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
18:in `require'
from ./../watir.rb:47
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
18:in `require__'
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
18:in `require'
from ./../unittests/setup.rb:2
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
18:in `require__'
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
18:in `require'
from all_tests.rb:4

It almost looks like something is missing??

Marco
> > > - Show quoted text -- Hide quoted text -

Bill Agee

unread,
May 9, 2008, 5:27:59 PM5/9/08
to watir-...@googlegroups.com
Are you running this on your Windows 2000 machine?  Looks like Windows::API expects the function GetLayeredWindowAttributesW to be available, but it's only in Win XP and later, at least according to the  "Minimum operating systems" line in the function's documentation:
 
 
Can you try running the same suite on your XP box?

 
On Fri, May 9, 2008 at 1:51 PM, marcoa <m...@rwdi.com> wrote:

Found the all_tests.rb  and executed it from commandline see results
following:

C:\ruby\lib\ruby\gems\1.8\gems\watir-1.5.4\unittests>ruby all_tests.rb
c:/ruby/lib/ruby/gems/1.8/gems/windows-api-0.2.3/lib/windows/api.rb:
331:in `initialize':
GetProcAddress() failed for 'GetLayeredWindowAttributesW',

Bill Agee

unread,
May 9, 2008, 5:39:21 PM5/9/08
to watir-...@googlegroups.com
Actually, I was shooting the messenger by pointing a finger at Windows::API - looks like it's actually windows-pr that is trying to look for GetLayeredWindowAttributesW and failing.
 
The error you pasted in shows where the problem file/line is:
 
from c:/ruby/lib/ruby/gems/1.8/gems/windows-pr-0.8.3/lib/windows/window.rb:40
 
windows-pr-0.6.2 did not attempt to look for GetLayeredWindowAttributesW.  So this same problem might not have existed in that version.
 
Not sure what the best solution here is - I guess this means the lastest windows-pr requires Windows XP or higher.  I'm also not sure if this means the same is true for recent Watir releases.

marcoa

unread,
May 9, 2008, 5:49:55 PM5/9/08
to Watir General
yes I am running it under windows 2000, I will try in under xp and get
back to you

marcoa

unread,
May 10, 2008, 8:10:31 AM5/10/08
to Watir General
ok I did try it on a clean xp box and installing 182-15 and then doing
gem install watir seems to have worked out. So you were correct that
there is now a dependency on winxp for the latest version of watir as
it installs the latest gems which is what causes the dependency on xp.
thanks very much for picking that out, now onto learning about watir
and ruby :)
marco

Bret Pettichord

unread,
May 13, 2008, 1:25:06 PM5/13/08
to watir-...@googlegroups.com
I recommend using an older version of windows-pr. Before installing the
watir gem, do
gem install windows-pr -v 0.6.6.

I am considering changing the Watir install so that it only uses this
gem (and not a more recent one). Please let me know if the instructions
above cures this problem.

Bret

Reply all
Reply to author
Forward
0 new messages