Re: [Wtr-general] hidden control..

2007-07-10 Thread Chris McMahon
I think this is in contrib:
http://jira.openqa.org/browse/WTR-53

On 7/10/07, mihai [EMAIL PROTECTED] wrote:
 exist method does not work, because the control exist but its hidden, and 
 there is not a hidden? methodthat the reason for what ive asked if how i 
 can find out that a control is hidden or not..
 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] WYSIWYG editor inside iframe - entire new html tag I can't access

2007-06-19 Thread Chris McMahon
 Any thoughts???

I think this is the same issue I reported here:
http://jira.openqa.org/browse/WTR-152

There is a pure-javascript workaround, see if that does the job for you.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] OT-ish: How many reqistered OpenQA Watir users?

2007-06-15 Thread Chris McMahon
I'm interested in how many registered users the project has.
Other information like page traffic, downloads, would be fun to know also.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] OT-ish - What is determining the order this hash gets iterated through?

2007-06-12 Thread Chris McMahon
 So here's the question: Why aren't the csv results in the order of the hash?
 And what order /are/ they in? There seems to be some method to the madness
 here, because they come out consistently in the /same/ order...but it isn't
 the order they are listed in the hash, or alphabetical by key or
 value...anyone know how this works?

Hashes are not sorted in predictable ways, regardless of which
language you're using.  Luckily, in Ruby, the Hash object has a sort()
method:  http://www.rubycentral.com/book/ref_c_hash.html#Hash.sort

I'm not a huge expert at this stuff, but I've tripped over it before.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] OT-ish - What is determining the order this hash gets iterated through?

2007-06-12 Thread Chris McMahon
 I'm not a huge expert at this stuff, but I've tripped over it before.

  ...and here comes Chris McMahon, champion of the off topic question! Thanks
 dude. I half-wondered if my tagging my post as OT would call you out. ;)


heehee!

I am so not-Ruby not-Watir these days.  I am heads-down-elbows-up in
Selenium/Perl,  but I remember dealing with hash sorting in Perl back
in the day, and I had to jump in...
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] forum do not get the postings made using the mailing list

2007-06-07 Thread Chris McMahon
 Because of the increased traffic on this list and the ongoing troubles
 we have had keeping the forums and mailing list synchronized, I have
 been considering migrating watir-general to google groups. I would like
 to hear comments on this idea, as well as other suggestions.

+1
Now that I'm subscribed to selenium and selenium-rc groups also, I'm
really missing the yahoo/google config options that openqa doesn't
have.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Trouble selecting list box item - Any suggestions

2007-06-07 Thread Chris McMahon
On 6/7/07, Norris [EMAIL PROTECTED] wrote:
 Hi,

 I'm currently having trouble selecting a list box item, any solutions?

 For example, I'm trying to select the Quantity from the attached Gap site, 
 but I can't.

 http://www.gap.com/browse/product.do?cid=7389pid=453549

I hope Charley answers this.  Firefox DOM Inspector doesn't recognize
that Quantity box.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Can an 'excel' file be renamed with a Watir command?

2007-06-06 Thread Chris McMahon
 I have got a script that creates an 'excel_file' while running.  After 
 running, I want to rename it so that next time, when the script is run, it 
 will create the excel file anew.  Can I do that?  I tried a few DOS commands 
 but I could find only two DOS commands working in Watir.  They are 
 'Dir.mkdir(directory)' and 'rmdir(directory)'

That's not DOS and that's not Watir.  That's Ruby.
You should definitely read up on the Ruby language itself.  The only
thing Watir knows about is the browser.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] How would you approach verification of data in *xml* format with Watir?

2007-06-06 Thread Chris McMahon
On 6/6/07, Lana [EMAIL PROTECTED] wrote:
 Thank You,
 here is my final basic piece working with your help:

You're welcome, I'm glad you got it to go!
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] How would you approach verification of data in *xml* format with Watir?

2007-06-05 Thread Chris McMahon
On 6/5/07, Lana [EMAIL PROTECTED] wrote:
 How would you approach verification of data in *xml* format with Watir 
 through the browser?
 data example: _http://www.live365.com/stations/easytempo?site=xml_
 is there some XMLParser available?

My understanding is that REXML is pretty much the standard.
http://www.germane-software.com/software/rexml/
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] How would you approach verification of data in *xml* format with Watir?

2007-06-05 Thread Chris McMahon
It's been a while since I've mucked around with REXML, but this works:

#
require rexml/document
include REXML

xml = REXML::Document.new(LIVE365_STATION_INFO
 STATION_BROADCASTERusername/STATION_BROADCASTER
 /LIVE365_STATION_INFO)

 xml.elements.each(*/STATION_BROADCASTER) {|e| puts e.text}
##

I'll recommend that you read the tutorial over and over.  If I'm not
mistaken, there's a REXML mail list, or comp.lang.ruby is always a
good place to find information from people much more experienced than
me.

http://www.germane-software.com/software/rexml/docs/tutorial.html

On 6/5/07, Lana [EMAIL PROTECTED] wrote:
 Thank you for right direction, this helped me to get started:
 -
 #includes
 require 'watir'
 require rexml/document
 include Watir
 include REXML


 doc = Document.new File.new(station.xml)
 root = doc.root
 puts root.elements[STATION_BROADCASTER]
 =
 result:
 STATION_BROADCASTERusername/STATION_BROADCASTER
 =
 But I seems can't find how to get actual value of element 
 'STATION_BROADCASTER', as there is no attribute, any suggestions?

 this is my xml:
 LIVE365_STATION_INFO
   STATION_BROADCASTERusername/STATION_BROADCASTER

 Thank You,
 Lana
 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] A query on Watir - Will watir/firewatir work on Linux?

2007-05-31 Thread Chris McMahon
 2.  Is Firewatir completely operational like Watir? (though, I could see that 
 firewatir is being used currently, I just wants a confirmation from the 
 appropriate persons)

In a sense.

Think of it like this:

Watir is a set of instructions in Ruby for manipulating Windows OLE
and COM interfaces.  FireWatir removes the OLE/COM stuff and replaces
it with the jssh (javascript shell) Firefox extension.  SafariWatir
removes the OLE/COM stuff and replaces it with Applescript.

In practice, this means that some methods available on one platform
won't be available on another platform.  Also, since these are all
separate projects started at different times and growing at different
rates, some features that might be shared, won't be shared.  For
instance, Watir has a built-in page-load timer, but FireWatir does
not.

These feature-mismatches are something that Bret, Angrez, and others
would like to improve.  If you were to use Watir and FireWatir in a
serious manner and report discrepancies between them here and on
OpenQA/Rubyforge, that would be a big incentive to make the projects
share more code and more features.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Script failing today, but worked yesterday?

2007-05-31 Thread Chris McMahon
 So, this shows that we've outgrown the current script and need something
 more robust (probably proper parsing through REXML), and that when you least
 expect it, consultants will throw a few landmines under your scooter.

I'd like to underscore this point:

IF YOU HAVE XML, USE AN XML PARSER TO DEAL WITH IT.

I rarely shout, but using split() and gsub() and other
string-manipulation tools to handle XML will always go wrong
eventually.   Probably in a very expensive way, as this example shows.
 Take the time to learn REXML, it will save you immense trouble later.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Basic accessibility testing with Watir and RAAKT...

2007-05-25 Thread Chris McMahon
 The tool is called Raakt (Ruby Accessibility Analysis Kit) and the
 project wiki can be found here:
 http://www.peterkrantz.com/raakt/wiki/

This is very cool and I'm going to try it out.
But your site looks awful in Firefox on OS X.  :)
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Basic accessibility testing with Watir and RAAKT...

2007-05-25 Thread Chris McMahon
Hmm, error on both Windows and Mac from the demo script:

raakt.rb:14: uninitialized constant Raakt (NameError)
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require'
from raakt.rb:3


On 5/25/07, Peter Krantz [EMAIL PROTECTED] wrote:
 Hi!

 I have been tinkering with an open source accessibility testing tool
 that easily hooks into Watir. The idea is to check for basic
 accessibility issues while you are running your Watir functional tests
 (because you have access to the complete html output from your
 application).

 The idea is to capture as many accessibility errors as possible before
 your app is tested by the QA people. This will hopefully save both
 time and money see [0] for more on why.

 The tool is called Raakt (Ruby Accessibility Analysis Kit) and the
 project wiki can be found here:
 http://www.peterkrantz.com/raakt/wiki/

 Instructions on how to use it in Watir are here:
 http://www.peterkrantz.com/raakt/wiki/frameworks/watir

 I would be grateful for feedback on how well this integrates with
 Watir and if you had any specific issues with it.

 Kind regards,

 Peter Krantz
 http://www.standards-schmandards.com

 [0]: http://www.standards-schmandards.com/2007/rapid-accessibility-feedback/
 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Basic accessibility testing with Watir and RAAKT...

2007-05-25 Thread Chris McMahon
Error from the standalone script also Windows and Mac:

mechanize.rb:334:in `to_absolute_uri': no history. please specify an
absolute URL (RuntimeError)
from 
/usr/local/lib/ruby/gems/1.8/gems/mechanize-0.6.8/lib/mechanize.rb:170:in
`get'
from ./raakt.rb:12
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require'
from raakt2.rb:4

The error below is from the command-line script.

On 5/25/07, Chris McMahon [EMAIL PROTECTED] wrote:
 Hmm, error on both Windows and Mac from the demo script:

 raakt.rb:14: uninitialized constant Raakt (NameError)
 from 
 /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
 `gem_original_require'
 from 
 /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
 `require'
 from raakt.rb:3
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] My mistake! Re: Basic accessibility testing with Watir and RAAKT...

2007-05-25 Thread Chris McMahon
It must be Friday.
Some free advice:  don't name your test file raakt.rb.:)


On 5/25/07, Chris McMahon [EMAIL PROTECTED] wrote:
 Error from the standalone script also Windows and Mac:

 mechanize.rb:334:in `to_absolute_uri': no history. please specify an
 absolute URL (RuntimeError)
 from 
 /usr/local/lib/ruby/gems/1.8/gems/mechanize-0.6.8/lib/mechanize.rb:170:in
 `get'
 from ./raakt.rb:12
 from 
 /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
 `gem_original_require'
 from 
 /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
 `require'
 from raakt2.rb:4

 The error below is from the command-line script.

 On 5/25/07, Chris McMahon [EMAIL PROTECTED] wrote:
  Hmm, error on both Windows and Mac from the demo script:
 
  raakt.rb:14: uninitialized constant Raakt (NameError)
  from 
  /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
  `gem_original_require'
  from 
  /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
  `require'
  from raakt.rb:3

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] watir, rspec, screen shots

2007-05-24 Thread Chris McMahon
Aslak Hellesoy's been working with Watir:
http://blog.aslakhellesoy.com/2006/12/2/getting-screenshots-from-watir
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Seg-faults with 4 ie windows (hello)

2007-05-23 Thread Chris McMahon
Maybe you're running out of memory?  Take a look at taskmanager, or
see if you can run more browsers on a beefier machine.   I know I've
personally run about 80-90 browsers simultaneously on a single desktop
some time ago, but they weren't holding any large amounts of test
data.

Just BTW, you'll never achieve reasonable loads with browser-based
test tools.  You should consider something like Grinder for generating
load.

On 5/23/07, Michael Sofaer [EMAIL PROTECTED] wrote:




 Hello, all.



 I recently started using WATIR to automate load testing for my company's
 application, and I'm running into some trouble when I try to run more than
 four client windows at the same time.



 Each window needs its own ie process, since it needs its own session
 variables, so I got the development gem and am using ie.new_process, which
 works well most of the time. But when I try to run with more than about four
 windows, I eventually get this error:



 c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir/contrib/ie-new-process.rb:44:
 [BUG] Segmentation fault

 ruby 1.8.6 (2007-03-13) [i386-mswin32]



 Can anyone help me with this? I tried running multiple small sessions in
 multiple command windows but it didn't seem to help.



 This is also my first foray into the world of open-source mailing lists, so
 if I've made an etiquette violation, please forgive me.



 Thanks,

 Michael Sofaer
 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Accessing a web page when a server request for username/password appears?

2007-05-23 Thread Chris McMahon
We don't have a more elegant way of dealing with Basic Authentication
yet.  Someday Watir might borrow some of the code from Net::HTTP to do
this, but it won't be happening any time soon.

If you search the archives, you'll find some discussion of me trying
to hack Basic Auth into Watir's goto() method.   I could get to the
main page OK with automated Basic Auth credentials, but I couldn't
fool IE into giving me access to links, frames, etc.



On 5/23/07, Kevin Scott [EMAIL PROTECTED] wrote:
 I was not able to get this to work via Watir. I created a very small Autoit 
 file which ran before the script. I used a batch file to execute both files. 
 The Auotit code is below (just in case, someone else runs into the issue):

 Run(C:\Program Files\Internet Explorer\iexplore.exe)
 WinWaitActive(Blank Page - Windows Internet Explorer)
 Send(http://mytest_site;)
 Send({ENTER})
 WinWaitActive(Title of mytest_site)
 Send({ENTER})
 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] IE7 security issues and changing action value of a form

2007-05-21 Thread Chris McMahon
Might be worth trying Mechanize to bypass the nasty UI:
http://rubyforge.org/projects/mechanize/
-C

On 5/21/07, Erik Oliver [EMAIL PROTECTED] wrote:
 A web page I'm trying to automate with Watir works as follows: Visible
 to user is a link to a javascript (JS1), JS1 in turn sets a bunch of
 hidden form values AND the action URL of the form, JS1 then calls
 submit on the form.

 Purpose of using Watir is to automate a repetitive task (download of
 multiple XML files from the website).

 **STRATEGY 1***

 Use the straightforward ie.link(:text, [text of link]) to cause JS1 to
 invoke. That causes IE7 to pop up one of those nasty download warnings
 and the script gets hung up.

 Any suggestions for bypassing this?

 **STRATEGY 2**

 I tried to simulate the JS itself since what I'm trying to do is
 automate a repetitive form task and batch download files, I generated
 the following basic code:

 form = ie.form(:name, 'appsByCustomer')
 form.hidden(:name,'isSubmitted').value = 'isSubmitted'
 form.hidden(:name,'paramForXmlDownload').value = 'forMultipleDownloads'
 form.hidden(:name,'dosnum').value = 'null'
 ### problem is how do I set form.action, the obvious form.action =
 'url string' doesn't work?
 form.submit

 Suggestions for how to set the action attribute?

 Regards,
 Erik

 PS: The page basically has about 5 different Javascripts wrapping the
 same form, the html has form name=appsByCustomer action= etc,
 each of the javascripts sets the action to a different value.
 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Controlling IE popups with stock Watir: simplest way?

2007-05-19 Thread Chris McMahon
You might be interested in my venerable Perl controller below.  It
launches a ruby script using system(1,), which returns control to the
calling process.  A short explanation of how system() does this is
here: http://perlmonks.org/?node_id=547218



use warnings;
use strict;
use Win32::GuiTest qw(FindWindowLike SetForegroundWindow SendKeys );

my $x = 0;

system (1, ruby c:/myscript.rb);
while (1) { #INFINITE LOOP
sleep 2; #CHECK FOR NEW WINDOW EVERY 2 SEC
my @windows = FindWindowLike(0, ^Logon Right Here);
for (@windows) {
SetForegroundWindow($_); #BRING THE RIGHT WINDOW IN FOCUS JUST IN CASE
SendKeys(user);
SendKeys({TAB});
SendKeys(password);
SendKeys({ENTER});
$x = 1;
}
exit if $x == 1;
}
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] New Watir User Guide (beta)

2007-05-18 Thread Chris McMahon
 My experience is that the include Watir line is never understood and
 in fact people end up thinking that it is some kind of magic. That, to
 me, is a reason to avoid it.

Eh.  I had the opposite experience.  It made me go read about what a Module is.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] New Watir User Guide (beta)

2007-05-18 Thread Chris McMahon
I meant to the new user, all of this looks like magic, so we might as
well break down the Watir setup commands in as granular a fashion as
possible

On 5/18/07, Bret Pettichord [EMAIL PROTECTED] wrote:
 Chris McMahon wrote:
  Eh. I had the opposite experience. It made me go read about what a
  Module is.
 They why did you say it's magic anyway?
 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] New Watir User Guide (beta)

2007-05-18 Thread Chris McMahon
I just think
ie = IE.new

is nicer than

ie = Watir::IE.new



On 5/18/07, Željko Filipin [EMAIL PROTECTED] wrote:
 On 5/18/07, Chris McMahon [EMAIL PROTECTED] wrote:
  I meant to the new user, all of this looks like magic, so we might as
  well break down the Watir setup commands in as granular a fashion as
  possible

 I did not think to learn them Ruby. There are good books about it. When they
 see how easy it is to use Watir, they can learn Ruby if they want. If not,
 they can think it is magic, as far as I am concerned.

 Zeljko

 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] New Watir User Guide (beta)

2007-05-18 Thread Chris McMahon
 From my perspective, I always start out by requiring and including watir,
 because I'd rather paste it into the top of a script once than have to type
 Watir:: several times below.

 I was planning to say that I'd love to have watir automatically included
 whenever I require it...but that might have resulted in unneccessary
 confusion when I first started requiring (and wishing to include) other ruby
 modules. So in the end I think my vote is to teach include from the
 beginning, but not to have require automagically include as well...since
 that's not true for other ruby modules.

+1, well put.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] exists? method not working inside my assert - can someone explain?

2007-05-17 Thread Chris McMahon
 ...or was my question so simple nobody felt like addressing it?? I would 
 really appreciate some guidance. I have a script with 66 test cases that I 
 was wanting to test this way...but it's apparently not giving me the correct 
 test results??

 Again, if you have any ideas...please reply.

I did a little spike.  I'm going to guess that something funky is
going on with the exists? method, but I don't know what.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] New Watir User Guide (beta)

2007-05-17 Thread Chris McMahon
On 5/17/07, Željko Filipin [EMAIL PROTECTED] wrote:
 Can you tell that it is past 1 am here? I forgot the link. Here it is.

 http://wiki.openqa.org/display/WTR/New+Watir+User+Guide+%28beta%29

Clearly this is going to be iterative :)

If it were me, I would have done

require 'watir'
include Watir  (it's magic anyway, it won't hurt)
ie = IE.new (let people see a blank browser)
ie.goto(http://www.google.com;)
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] how to manipulate this?

2007-05-16 Thread Chris McMahon
BODY\r\n
DIV class=wikiReplace this text with your own. BR/DIV
/BODY

I have a DIV whose class is wiki.   (It's in an iframe, but that
doesn't matter.)
I would like to manipulate the contents of this tag.  I know it can be
done with raw javascript, but I haven't been able to figure out how to
do it with Watir.  Any suggestions would be welcome.

The full html of the iframe is below:

irb(main):007:0 ie.frame(:id, st-page-editing-wysiwyg).html
= HTMLHEAD\r\nMETA content=\MSHTML 6.00.2900.3059\ name=GENERATORLINK
 media=screen href=\/static/2.11.5.2/css/st/screen.css\ type=text/css rel=STYL
ESHEETLINK media=screen href=\/static/2.11.5.2/css/st/ie.css\ type=text/css
rel=STYLESHEETLINK media=screen href=\/static/2.11.5.2/css/st/wikiwyg.css\ t
ype=text/css rel=STYLESHEET/HEAD\r\nBODY\r\nDIV class=wikiReplace this te
xt with your own. BR/DIV/BODY/HTML
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] how to manipulate this?

2007-05-16 Thread Chris McMahon
On 5/16/07, Bret Pettichord [EMAIL PROTECTED] wrote:
 Paul Rogers wrote:
  ie.div(:class , 'wiki').ole_object.invoke('innerText' , hi Chris)
 
 
 My guess would be

 ie.div(:class , 'wiki').ole_object.innerText = hi Chris

Interesting, I've never hit this part of Watir before.  Any chance of
doing this in FireWatir?
-C
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] fireWatir guess. Re: how to manipulate this?

2007-05-16 Thread Chris McMahon
  ie.div(:class , 'wiki').ole_object.innerText = hi Chris

 Interesting, I've never hit this part of Watir before.  Any chance of
 doing this in FireWatir?

Answering my own question, I'll bet that s/innerText/textContent/
would work.   (Thanks Selenium reference page!)  But I haven't tried
it yet.

There's another good candidate for refactoring.
-C
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] fireWatir guess. Re: how to manipulate this?

2007-05-16 Thread Chris McMahon
 Could you say more words about what you are suggesting.

Quoting from the Selenium reference:

storeText ( locator, variableName )
Gets the text of an element. This works for any element that
contains text. This command uses either the textContent (Mozilla-like
browsers) or the innerText (IE-like browsers) of the element, which is
the rendered text shown to the user.

So I'm guessing that since we can manipulate innerText with
IE/Watir, I'll be we can manipulate textContent with fireWatir.

So it might make sense to abstract both commands into a
munge_text_directly method.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] fireWatir guess. Re: how to manipulate this?

2007-05-16 Thread Chris McMahon
 Neither Watir nor Selenium nor FireWatir currently provides commands for
 munging text directly. To me this sounds like something that is outside
 the scope of a testing tool. Can you elaborate on the scenario that
 makes you want to do this? Is it testing related?

Yes, it's testing.  My particular application has a wysiwyg
page-editing feature that I would like to manipulate for testing
purposes.   The mechanism by which the page is edited is direct
manipulation of innerText.  The Google Blogspot wysiwyg editor works
the same way, I'm pretty sure, and I'll bet other wikiesque wysiwyg
editors do, also.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] ole_object syntax?

2007-05-16 Thread Chris McMahon
Paul, Bret, I tried both syntax examples and got errors on both.  Do
you see anything wrong with
ie.frame(:index,1).div(:class, 'wiki').ole_object.innerText = McChris
was here or
ie.frame(:index,1).div(:class,
'wiki').ole_object.invoke(innerText,McChris was here)

I'm using the latest Watir development gem here.

irb(main):005:0 ie.frame(:index,1).html
= HTMLHEAD\r\nMETA content=\MSHTML 6.00.2900.3059\ name=GENERATORLINK
 media=screen href=\/static/2.11.5.2/css/st/screen.css\ type=text/css rel=STYL
ESHEETLINK media=screen href=\/static/2.11.5.2/css/st/ie.css\ type=text/css
rel=STYLESHEETLINK media=screen href=\/static/2.11.5.2/css/st/wikiwyg.css\ t
ype=text/css rel=STYLESHEET/HEAD\r\nBODY\r\nDIV class=wikiReplace this te
xt with your own. BR/DIV/BODY/HTML
irb(main):006:0 ie.frame(:index,1).div(:class, 'wiki').ole_object.innerText = 
McChris was here
NoMethodError: undefined method `innerText=' for nil:NilClass
from (irb):6
from :0
irb(main):007:0 ie.frame(:index,1).div(:class, 'wiki').ole_object.invoke(inner
Text,McChris was here)
NoMethodError: undefined method `invoke' for nil:NilClass
from (irb):7
from :0
irb(main):008:0
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Controlling IE popups with stock Watir: simplest way?

2007-05-16 Thread Chris McMahon
 And here's the watcher script:

def initialize(title)
  @autoit = Watir.autoit
  @title = title
end

I don't know how interested you'd be, but if you'd like to try to
build a watcher with a Ruby GuiTest instead of autoIt, I'd be
interested in what happens:  http://rubyforge.org/projects/guitest/
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Controlling IE popups with stock Watir: simplest way?

2007-05-16 Thread Chris McMahon
 I have been looking at the win32utils set of gems on rubyforge lately.
 The win32-process gem includes a windows implementation of fork that may
 be promising.

I looked at this some time ago, but it turned out be really stupid.
Sorry, I don't remember the details, but it quickly becomes clear that
it doesn't do what you think.Windows just does not fork(), and
there isn't any way around it.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] WATIR on Windows Vista 64?

2007-05-15 Thread Chris McMahon
 Has anyone got any ideas?  Has anyone else gotten WATIR running on Windows 
 Vista in 64-bit mode?

I'm interested in an academic sort of way.
Does Ruby itself run?  Does IRB run?  What are your error messages?
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] The Plan for Watir

2007-05-10 Thread Chris McMahon
On 5/10/07, Walter Kruse [EMAIL PROTECTED] wrote:
 I am very keen to have this done, but leeching isn't nice and I can't
 write C. If there is forward movement on win32guitest, I volunteer to do
 a document for it, either a user guide, or something in the style of
 this: http://www.piotrkaluski.com/files/winguitest/docs/winguitest.html

As the Official Cheerleader for GuiTest in Ruby:  go for it.

I think that there is useful stuff there, but Wayne Vucenic and I both
lost interest not long after Wayne wrote the code, and I'm not exactly
sure how far he got.   Someday I'll get back to it, but not anytime
soon.  I don't remember that there is a lot of C involved.  I think
it's mostly negotiating the Win32 interfaces.

Let me know if you need any privileged access.  I'm pretty sure I'm
still set up to make that happen.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] Watir/FireWatir merge/refactoring suggestion: down_load_time

2007-05-10 Thread Chris McMahon
I had occasion today to measure page load times in anger using
FireWatir.  I don't have a regular Watir installation handy, but I
know Watir tracks the latest page load times in a variable called
down_load_time or download_time or something similar.

FireWatir doesn't have this feature.  I used the venerable
wrap-a-timer-around-the-click technique stolen from Mike Kelly, which
is pretty painless, but it made me think.

I'd like to make two suggestions: first, that the value be renamed
page_load_time instead of down_load_time, because page loads and
downloads are different things.

Second, that this value be added to FireWatir at the same time that
it's refactored in Watir.

And, it would be really nifty if Watir and FireWatir could actually
share the same physical code files, such that a change to the function
of page_load_time would be instantly available to both platforms.

It seems to me that this would be a good spike to explore merging the
shared code between the two platforms.

I could, of course, be wrong, but I thought making the suggestion was
worthwhile.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] OT: find min/max values in an array of floats

2007-05-09 Thread Chris McMahon
Neat.  I guess I should have just written the code and tried it out.

On 5/8/07, Bret Pettichord [EMAIL PROTECTED] wrote:
 Chris McMahon wrote:
  I can think of a couple of ways to do this, but they're all painful in
  one way or another.  Ruby being Ruby, I wonder if there's some nifty
  shortcut.  Given
 
  floats = []
  floats  3.456
  floats  1.53
  floats  5.123
 
  show that the least element of the array is 1.53 and the greatest
  element of the array is 5.123, where the array floats can have an
  arbitrarily large number of elements, of which all are (of course)
  numbers with decimal values
 irb(main):001:0 floats = []
 = []
 irb(main):002:0 floats  3.456
 = [3.456]
 irb(main):003:0 floats  1.53
 = [3.456, 1.53]
 irb(main):004:0 floats  5.123
 = [3.456, 1.53, 5.123]
 irb(main):005:0 floats.min
 = 1.53
 irb(main):006:0 floats.max
 = 5.123

 These methods aren't simply part of the Array class. Rather they come
 from the Enumerable module (which Array uses). You can mix this module
 into any of your classes that implements two methods: each and the
 comparison operator (aka spaceship) that looks like this: = and
 thereby automatically get cool methods like this.

 You can also extend any objects that support these methods with the
 Enumerable method. I often do this with win32ole objects that implements
 the (COM) IEnumerable interface and therefore have an each method.

 Bret
 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] FireWater: click on link should launch new page/tab, but does not

2007-05-09 Thread Chris McMahon
Close enough.  It seems like when you do Apple-R in TextMate, TextMate
doesn't capture stderr, only stdout.  When I ran the script from IRB,
I got

irb(main):020:0 ff.link(:src, /help/index.cgi?socialtext_documentation).click
FireWatir::Exception::UnknownObjectException: Unable to locate object,
using src and /help/index.cgi?socialtext_documentation
from 
/usr/local/lib/ruby/gems/1.8/gems/firewatir-1.0.2/./MozillaBaseElement.rb:881:in
`assert_exists'
from 
/usr/local/lib/ruby/gems/1.8/gems/firewatir-1.0.2/./MozillaBaseElement.rb:1027:in
`click'
from (irb):20

However, I was able to click the link and get the new page with

ff.link(:text, Help).click

So that's FireWater 1, Selenium 0.  :)

On 5/8/07, Chris McMahon [EMAIL PROTECTED] wrote:
  I was able to click on the help link which opened in new window. Currently
  you can connect to only new window not new tab. Make sure you have allowed
  popups for that site. I got error that Firefox prevented from opening a pop
  up from the site. When I allowed pop ups I was able to click on the link
  which opened in new window.

 Strange.  I have Preferences/Tabs set so that New pages should be
 opened in a new window and Preferences/Content set to not block
 popups, but the script runs without error from either FireWatir or
 Firefox.

 Thanks for checking, it must be something in my environment preventing
 that new window.   I'll keep looking.

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] FireWatir: test/unit assertions can't be found?

2007-05-09 Thread Chris McMahon
This is odd:

require 'rubygems'
require 'firewatir'
require 'test/unit'
require 'firewatir/testUnitAddons'
include FireWatir

ff = FireWatir::Firefox.new()
ff.goto(http://www.socialtext.net/stoss/index.cgi?mcmahon_test;)
ff.link(:text, Help).click
sleep 5
ff.attach(:title, /Documentation/)
assert_match(Help Table of Contents,ff.text)

yields

test.rb:13: undefined method `assert_match' for main:Object (NoMethodError)

I've tried plain 'assert' also with the same result.

I've got Ruby 1.8.6 installed in /usr/local (OSX), and I've removed
the default ruby from my env.  Why would the assert methods from
'test/unit' not be findable?  The code exists in
/usr/local/lib/ruby/1.8/test/unit/assertions.rb

$ which ruby
/usr/local/bin/ruby
$ ruby -v
ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-darwin8.9.1]
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] FireWatir: test/unit assertions can't be found?

2007-05-09 Thread Chris McMahon
 include Test::Unit::Assertions # you need to mix in the assertion
 methods if you want to use them outside of a testcase.

Thanks, got it, I should have seen that.
-C
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Ataaching to windows on slow network connections

2007-05-09 Thread Chris McMahon
Untested, but this will try to attach every two seconds forever:


def get_popup

  begin
ie.attach(:title, My Window)
  rescue
sleep 2
get_popup
end

end
##


You could put your counter in there with an exit clause.


On 5/9/07, Dhrubojyoti Biswas [EMAIL PROTECTED] wrote:
 Time and again I have faced issues where the WATIR attach method, that
 returns a handle to a popup window, has misbehaved.

 Specifically I have noticed this on somewhat slow connections. In Cases
 where the pop up windows take some time to get rendered on the client
 machine, the attach method throws an exception saying that it coud not find
 the window.

 I have been using WATIR 1.4.x extensively for my projects.

 I came up with this small solution that would grab the window no matter how
 slow the connection is. Can someone think of a better way to do it, or does
 this solution look viable?

 def GTools.waitForPopUp(ie, title)
 iePopUp = ''
 popupGrabber = false
 popupGrabberCounter = 0
   #I'll wait for the popup to come up... I'll make some iterations and
 then I'll stop iterating
   #Ideally the number of iterations to be made should be made
 configurable (number 21)
 while(popupGrabber == false  popupGrabberCounter = 21)
   begin
 rxp = Regexp.new (title)
 iePopUp = Watir::IE.attach(:title, rxp)
 # I will reach this point only if attach does not throw an
 exception
 popupGrabber = true
   rescue Exception = ex
   # If the code reaches this block it means that the pop up window
 that
   # u were trying to grab using attach was not served up by the
 WebServer
   # set the Grabber flag to false and return back into the loop
 print Rescued Exception\n
 popupGrabber = false
   end
   popupGrabberCounter = popupGrabberCounter + 1
   if(popupGrabberCounter = 21)
 raise GUIException(PopUp Timeout No PopUp Window having
 title  + title +  was found)
   end
   return iePopUp
 end

 When I use this workaround method I have noticed that the code enters the
 rescue block quite anumber of times before it attaches successfully to the
 window.

 I am eager to know if there is a better way to do this?

 --
 Dhruv


 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Sample Training Presentation and Exercises posted on Wiki

2007-05-09 Thread Chris McMahon
On 5/9/07, Brown, David [EMAIL PROTECTED] wrote:
  In case anyone can re-use them, I've posted a basic Watir training
 presentation and some associated exercises that I've developed and used
 a few times to train individuals  groups in my company on the basics of
 Watir. Feel free to re-use, modify and enhance them :).
 http://wiki.openqa.org/display/WTR/Watir+Training+Presentation+and+Exerc
 ises


The Scripting101 course could use some enhancement.  I'm just sayin'...
http://rubyforge.org/frs/?group_id=104
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] The Plan for Watir

2007-05-09 Thread Chris McMahon
On 5/9/07, Bret Pettichord [EMAIL PROTECTED] wrote:
 Paul Rogers wrote:
  Id like the winclicker code to disappear and be replaced by a full windows 
  testing library ( How you getting along with that Chris ? ). Enough people 
  seem to want it.
 
 I think a lot of people would like to see that. I certainly would. But
 last i looked Chris's project hadn't seen a commit in 18 months.

There might still be enough there to work with.
This is a port of Perl Win32::GuiTest, btw.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] The Plan for Watir

2007-05-08 Thread Chris McMahon
 Since integration of the various watirs is also part of the roadmap, I
 expect that some of the better modal dialog support will also be
 migrated to the other watir flavors.   Perhaps I have the wrong impression?

I think it's a terminology problem:  modal dialog is an artifact of
IE only.  Javascript popup is common to all browsers.  There are
special problems with IE modal dialogs that are separate from the
problems of addressing javascript popups.

-C
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] FireWater: click on link should launch new page/tab, but does not

2007-05-08 Thread Chris McMahon
Run the script below.  The script runs without error.

But when you click the Help button manually, a new window or tab
(depending on FF settings) will open; but when clicking with
FireWatir, the new window does not open.

I would like to be able to click the link and then to attach to the
new window with FireWatir.


require 'rubygems'
require 'firewatir'
require 'test/unit'
require 'firewatir/testUnitAddons'
include FireWatir

ff = FireWatir::Firefox.new()
ff.goto(http://www.socialtext.net/stoss/index.cgi?mcmahon_test;)
ff.link(:src,/help/index.cgi?socialtext_documentation)
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] OT: find min/max values in an array of floats

2007-05-08 Thread Chris McMahon
I can think of a couple of ways to do this, but they're all painful in
one way or another.  Ruby being Ruby, I wonder if there's some nifty
shortcut.  Given

floats = []
floats  3.456
floats  1.53
floats  5.123

show that the least element of the array is 1.53 and the greatest
element of the array is 5.123, where the array floats can have an
arbitrarily large number of elements, of which all are (of course)
numbers with decimal values.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] FireWater: click on link should launch new page/tab, but does not

2007-05-08 Thread Chris McMahon
 I was able to click on the help link which opened in new window. Currently
 you can connect to only new window not new tab. Make sure you have allowed
 popups for that site. I got error that Firefox prevented from opening a pop
 up from the site. When I allowed pop ups I was able to click on the link
 which opened in new window.

Strange.  I have Preferences/Tabs set so that New pages should be
opened in a new window and Preferences/Content set to not block
popups, but the script runs without error from either FireWatir or
Firefox.

Thanks for checking, it must be something in my environment preventing
that new window.   I'll keep looking.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Community involvement with Watir

2007-05-07 Thread Chris McMahon
 Thanks!  How should we contribute to the User Guide?  It doesn't appear
 to be user editable:

I'd suggest either adding to this thread, or contacting Zeljko directly.

 Feel free to add my tutorial for installing FireWatir on Mac OS X
 (Intel)  (or let me know where I should add it):

 http://crasch.livejournal.com/550521.html#cutid1

I couldn't get the Linux jssh xpi to function with the lastest osx and
latest FF.  In another thread (and mentioned to Angrez) I found a
Darwin jssh that worked properly.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Community involvement with Watir

2007-05-05 Thread Chris McMahon
  Zeljko, how can we all help you?

 The usual.
 Suggestions. What to add, what to remove, what to change.
 Comments on my changes. They will be bold.
 Bacon. Those foxes demanded lots of bacon.

Chunky bacon!
One thing I would like to see featured prominently is a discussion not
only of how to run the unit tests, but also how to read the unit
tests.  Also, a discussion of how to surf watir.rb itself for
particular methods like show_whatever and even how goto() works would
be useful.  Both the unit tests and watir.rb are pretty literate, and
not too difficult to parse, even for less-experienced Rubyists.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] FireWatir not finding buttons by id

2007-05-04 Thread Chris McMahon
 Im going to guess that this is a bug in 1.5

Seems like this would be an opportunity to sync up FireWatir with
Watir.  I think Charley has been looking into some of that recently.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] how to include external script (.rb) in Watir?

2007-05-04 Thread Chris McMahon
On 5/4/07, Alien Ruby [EMAIL PROTECTED] wrote:
 How are you guys so helpful ?

That's actually a really good question.  The people who started Watir
had all participated in other Open Source projects, some successful,
some unsuccessful.   The early Watir community insisted that everyone,
particularly beginners, be treated with respect and courtesy.

Many, if not most, of the Watir community are not expert programmers.
If the project is going to continue, and continue to be successful,
two things have to happen:  beginners must continue to be treated with
respect and courtesy; and as people get more experience with Watir and
Ruby, they have to be encouraged in turn to help out where they can
contribute.

Mostly this means answering questions on the list:  if you see a
question you can answer, please do so.  It's OK if you're wrong-- as
long as you are not deliberately misleading, we will all learn
something.

In addition, if you can help with documentation or patches or
features, please contribute that work also.   Charley just asked today
for contributions to the user guide.  Maybe a reference to the copy of
Pickaxe included with the Ruby distro would be a good thing.

One very exciting project happening sort of under the radar is to make
Watir, FireWatir, SafariWatir, (and possibly Selenium RC) all have a
more consistent set of functionality and syntax.  I'm not a great
programmer, but I like to answer off-topic questions on the list, and
I've started to use the non-IE Watirs, and I contributed my first
inconsistency report yesterday.   The point being, that a few little
contributions here and there move the project along nicely, as long as
a large number of people are making the contributions.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] The Plan for Watir

2007-05-04 Thread Chris McMahon
Good information.  You and Charley and maybe some others should put
this in blogs so the wider world can find it.

On 5/4/07, Bret Pettichord [EMAIL PROTECTED] wrote:
 I've been doing a lot of thinking and planning for what we need to do
 with Watir. I've also been fairly quiet. I now have a new job and have
 been preoccupied by the change in jobs lately: with wrapping up
 affairs at my old job at DataCert, with a job search, and then with
 starting at Dovetail, where they had built up a bit of a backlog of
 work for me which I've finally dug out from.

 Dovetail has made a big commitment to Watir: to using it to test our
 software, to supporting enhancements that we will be using, and even
 to giving me time to attend to the necessary affairs in running an
 open-source project. In fact, Dovetail intends to ship our testing
 framework and our tests themselves to our customers. This means that
 our tests will need to be good: be easy to understand, extend, run and
 interpret. I am very excited by the opportunity.

 Watir 1.5 is getting very close to being done. As soon as it looks
 like we've fixed all the serious compatability bugs with Watir 1.4, we
 will be posting the 1.5 gem to Rubyforge. This means that it will
 become the default gem that will be installed when you do a gem
 install watir. Originally I wanted to wait until we got the
 documentation for 1.5 updated, but now now i think that can wait for a
 later point release (say 1.5.3). Charley tells me that many of the
 questions on the wtr-general list regard problems that would be solved
 by moving to 1.5, so it really will help to move there.

 By the way, Charley has also been rather busy lately, partly because
 people keep hiring his Watir testers away from him. So if you are one
 of these people, stop it. It only hurts Watir, in the end, by forcing
 him to spend all his time on his day job.

 Jeff Fry is threatening to help out with the Rdoc and Zeljko has
 agreed to take the lead with updating the users guide. Please
 cooperate with any requests that they make.

 Many of you have noticed that FireWatir is looking very good.
 SafariWatir is also looking good. The number one goal that I have for
 Watir is pull together these different forks of Watir. In my view they
 should all be part of one library, or perhaps each will be a plug in
 to a standard library, much as, say the Ruby DBI library supports plug
 ins for each of the different types of databases. In our case, we'd
 have separate plug ins for each browser. This means supporting
 multiple browsers and making Watir work on multiple platforms. The
 importance and complexity of this goal is part of what is urging me to
 wrap up Watir 1.5.

 We are targeting Watir 2.0 to include plugins for each of the main
 browsers. I also plan to continue working on a Selenium plugin to
 Watir. This would allow existing Watir tests to run tests using any
 browser when connecting to a Selenium-enabled server. This, like all
 the browsers, will be optional; so if Selenium scares you, you will be
 able to continue to use Watir the old-fashioned way.

 In preparation for this, Watir 1.6 will begin the restructuring of the
 existing code base to support plugins and remove the code duplication
 that currently exists in the different forks. This will require
 reorganizing the code files, and therefore we will want to merge all
 patches before this reorg starts. We will also be taking this
 occassion to make many changes to Watir that we've been considering
 for some time, but have put off because of concerns about backwards
 compatibility. We have attempted to make upgrading from 1.4 to 1.5
 extremely easy. Upgrading to 1.6 will be more difficult. In
 particular, we will be converting Watir to use zero-based indexing in
 1.6.

 Another key element to getting Watir 1.5 out is updating our
 website. We will be publishing a new, detailed, multi-page website aimed
 at our general user community. This website will be hosted at
 wtr.rubyforge.org and will include current information about the
 various releases and how to install them and where the mailing lists
 are. And we'll be keeping it up to date, as we move forward with this
 plan. We will continue to use the wiki at OpenQA for the active user
 community and there will be several links from the general website
 into the wiki. We have had a lot trouble keeping the various pages on
 the OpenQA website updated and accurate and will be replacing them
 with pointers either to the website or to the wiki. I realize that the
 current arrangement is very confusing and appreciate your patience.

 The Jira roadmap more or less lays out the next few steps in our
 plan. We will be updating it shortly to better match up to the plan I
 lay out here. If you have bugs you want fixed or features you want
 added, please make sure there is an open Jira ticket for them.

 Bret
 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org
 

Re: [Wtr-general] playing with FireWatir on OSX

2007-05-03 Thread Chris McMahon
On 5/3/07, Angrez Singh [EMAIL PROTECTED] wrote:
 Hi Chris,

 You might want to have a look at this for installing FireWatir or MAC OS X.
 http://crasch.livejournal.com/550521.html

 According to the troubleshooting section of this article, the error you are
 getting is because of incorrect xpi.

Ah, I didn't read that far, thanks.

I've tried both Darwin xpi files and the Linux xpi file from
http://people.mozilla.com/~davel/jssh/.  The earlier Darwin one fails
to open port 9997 at all; the later Darwin one opens port 9997, but
doesn't seem to communicate; the Linux one appears in the FF Tools
menu, but I can't seem to activate it-- it's UI won't let me click
OK, although it will let me click Cancel.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] playing with FireWatir on OSX

2007-05-03 Thread Chris McMahon
On 5/3/07, Angrez Singh [EMAIL PROTECTED] wrote:
 Hi Chris,

 Did you tried the XPI at
 http://alephzarro.com/blog/2007/03/12/jssh-for-firefox-on-linux-because-firewatir-loves-it
 Its an XPI for linux but seems to work on Mac OS also (according the link i
 sent you in last mail)

Yay!  That one works.  Interestingly, it has the same name as the one
from mozilla, but it behaves differently.
-Chris
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Finding the name of objects

2007-05-03 Thread Chris McMahon
The Developer Toolbar is great
http://www.microsoft.com/downloads/details.aspx?familyid=E59C3964-672D-4511-BB3E-2D5E1DB91038displaylang=en

Also, Watir has nice show_all_* methods we like to use from IRB.
Using the flash method from IRB is also recommended.

And eventually, you even get pretty good at reading the HTML.
-Chris

On 5/3/07, Ken [EMAIL PROTECTED] wrote:
 I just got started with this and am trying to write a simple script to get my 
 feet wet.  I was following the googlesearch.rb case that is provided.  My 
 question is how do you find the name of the object that you want to perform 
 an action with?  For example:

 ie.text_field(:name, q).set(pickaxe) # q is the name of the search field

 How do you know that q is the name of the search field?  I viewed the source 
 of the page and eventually found the field named q but it was not obvious or 
 easy.  It was so murky that if I didnt know already that the fields name was 
 q I never would have found it.  Is there a simple way to identify a list box, 
 text field, radio button...etc?

 Thanks.
 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] FireWatir not finding buttons by id

2007-05-03 Thread Chris McMahon
Hi...

Seems like this script should work, but I'm getting

FireWatir::Exception::UnknownObjectException: Unable to locate object,
using id and id value

for both the buttons.   I put the sleeps in in case it was a
page-rendering issue, but I don't think that it is.
(BTW, feel free to add yourself, log in and try the rest of the script
if you want.)

###

require 'rubygems'
require 'firewatir'
require 'test/unit'
require 'firewatir/testUnitAddons'
include FireWatir

ff = FireWatir::Firefox.new()
ff.goto(http://www.socialtext.net/stoss/index.cgi?mcmahon_test;)

sleep 2

#DOESN'T FIND THIS BUTTON
ff.button(:id,'st-login-to-edit-button-link')

ff.text_field(:id, 'username').set('[EMAIL PROTECTED]')
ff.text_field(:id, 'password').set('mypass')
ff.button(:value, 'Log in').click

sleep 2

#DOESN'T FIND THIS BUTTON EITHER
ff.button(:id,st-edit-button-link).click

ff.text_field(:id,'wikiwyg_wikitext_textarea').set('*test data*')
ff.button(:id,'st-save-button-link').click
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Do AutoIt3 scripts also work in Firewatir?

2007-05-01 Thread Chris McMahon
On 5/1/07, Bret Pettichord [EMAIL PROTECTED] wrote:
 Paul Rogers wrote:
  This may be a good thing to try and coordinate with Chris Macmahons 
  Win32guitest port.
 
 Where can i find out more about this?

http://rubyforge.org/projects/guitest/

I've mostly been a cheerleader, but there is working code there from
Wayne Vucenic, and a pretty good number of features.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Can Watir be paused resumed manuallywhenrunning test cases?

2007-05-01 Thread Chris McMahon
 The purpose of pausing the testing is to let people have time to check the
 status of GUI and device under test, after running some test cases or some
 steps of a test case.

There is a really simple way, if this helps:


puts type anything and hit return to resume the script
input = gets
puts finishing now
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] manipulating dos prompt with watir

2007-04-30 Thread Chris McMahon
Look up ruby system or exec commands.
Also consider connecting to the DB directly with ODBC or DBI.
-Chris

On 4/30/07, alan [EMAIL PROTECTED] wrote:
 In my watir script i would like to have it go to open a dos command window 
 and start sqlplus, then run a simple query to see if a member exists, the 
 flow would be something like:
 open cmd.exe
 log in as [EMAIL PROTECTED]
 pass the password somewhere around here
 do query select * from members where name = 'testername'
 if cmd contains(testername)
 puts 'yay'
 else
 puts 'drat'
 end

 is this easily done? so far after spending most of the day in google and 
 trying some different ideas I still have nothing. suggestions?
 i'm new to sql and watir, but since i did make watir send results to and 
 excel file I figure this must also be doable.
 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Fwd: + Hackety Hack +

2007-04-25 Thread Chris McMahon
t'd be nice to work on his basic conceptual view and present
 a basic programming using Ruby class, wearing bunny suits of course.

With ukuleles.  Propose it for Agile2008.  I am *so* there.
-Chris
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Watir T-shirt

2007-04-23 Thread Chris McMahon
On 4/23/07, Jason [EMAIL PROTECTED] wrote:
 I ran this by Bret and he suggested posting it on the Wtr-General to get some 
 feedback from others.  So please let me know what you think.


I'd wear it to next year's http://mtnwestruby.org, so no hurry.  :)
But I like the idea.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] [OT] - array nightmare

2007-04-17 Thread Chris McMahon
 I'm not comfortable with truncating the original file either. What I
 would like to do is get the latest data, see what's not in the main
 file, and append it.

I'm reading this sentence as a set of requirements.  Assuming that the
arrays are small enough to not blow out the RAM on the machine, I'd do
it like this:

##

main_file = ['a','b','c',' ']
latest_data = ['c','x']

not_in_main_file = latest_data - main_file
puts not in main file: 
puts not_in_main_file
puts 

new_log = main_file + not_in_main_file
puts new log contents after addition: 
puts new_log
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] How to verify the values in the tages

2007-04-17 Thread Chris McMahon
 error: first line\r\n\r\nsecond line expected but acutal was /fist 
 line\s+secondling/

Your application has badly misspelled the message to the user.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] How to verify the values in the tages

2007-04-16 Thread Chris McMahon
\s+ means match any white space characters, so the regex will
match any number of tabs, spaces, crs, and/or lfs.


On 4/16/07, vamsi [EMAIL PROTECTED] wrote:
 thanks for your help and it is working for single return... however i have 2 
 carriage returns after first line.

 ex: data=first line

 second line

 so it will appear as first line \r\n\r\r second line ...

 could you please help what need to be added for regular expression to solve 
 this issue.

 Thanks in Advance.

 Regards
 Vamsi
 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] selecting an item from a list using a regular expression

2007-04-13 Thread Chris McMahon
 How does one get the value of a variable into a regular expression?

require 'test/unit'

class TC_Spike  Test::Unit::TestCase
  def test_1950

var = 1950
data = xxx1950xxx

assert_match(/#{var}/,data)
end
end
___
Wtr-general mailing list
[EMAIL PROTECTED]
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] How to verify the values in the tages

2007-04-12 Thread Chris McMahon
 Watir Result is like this: Do you want to continue. \n Click on continue 
 Button. expected but was
 Do you want to continue. \r\n Click on continue Button?

So that \r\n means carriage return -- line feed, and it has a long
history.  http://en.wikipedia.org/wiki/Carriage_return

What's bad in your situation is that Ruby (and Perl and many other
languages) usually interprets \n to be the carriage-return-line-feed
on whatever platform Ruby is installed on.  But test/unit is not doing
that in your case.

If it were me, I would use assert_match and a regular expression, like this:

require 'test/unit'

class TC_Spike  Test::Unit::TestCase
  def test_crlf

data = first line
second line

assert_match(/first line\s+second line/,data)
end
end
###

change the regexp to see it fail

first line\nsecond line expected to be =~
/first line\w+second line/.
___
Wtr-general mailing list
[EMAIL PROTECTED]
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] OT: run Firefox inside Firefox

2007-04-12 Thread Chris McMahon
This makes my head hurt:
http://seejay.wordpress.com/2007/04/11/firefox-inside-firefox/
___
Wtr-general mailing list
[EMAIL PROTECTED]
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Selecting value from a List displayed through Autoextender

2007-04-11 Thread Chris McMahon
 -
 Unable to locate object, using index and 5--- This is the exception 
 thrown.

Do you get anything if you try smaller values of index, like 1 or 2?
It might choose the wrong one, but you would know if it's working at
all.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] OT: Ruby idioms

2007-04-11 Thread Chris McMahon
I ran across this, and it's worth sharing...
Dan Manges blogged about what he calls Ruby anti-patterns.  I might
argue with some of them, but he's got some great examples of efficient
ways to do some things that we all do every day:
http://www.dcmanges.com/blog/28
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] OT: selenium ajax testing tool released

2007-04-10 Thread Chris McMahon
On 4/10/07, Charley Baker [EMAIL PROTECTED] wrote:
 This is an offtopic post on Selenium and a recent release from TIBCO with an
 ajax testing framework:
 http://ddj.com/198702228;jsessionid=OP1CXLIHSLECCQSNDLPCKH0CJUNN2JVN
 ?
 Thoughts?

It's weird that it's from TIBCO, who sell EAI products and have very
little to do with GUIs.  At least it's open source.
-C
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Assert Dates?

2007-04-03 Thread Chris McMahon
On 4/3/07, Fletch [EMAIL PROTECTED] wrote:
 Thanks for your replies,
 The date guide was really good, but as it is only a String comparison, I did 
 not want to over complicate the code.
 I have also tried the other two suggestions, and have still not been able to 
 get the match to work.
 I think that I might have to use an escape. I have tried the CGI.escape which 
 works quite well, and picks up the / character by converting it to a %2F, but 
 to use this method is overkill really as it is designed for all HTML 
 characters, so I am thinking that I just need a simple line of code to 
 replace all instances of / with %2F


Now that's crazy talk.  :)  Seriously, look at this code:


arr_date = xxx01/01/07

if arr_date =~ /01\/01\/07/
  puts got a regex match
  end
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Using Until

2007-04-03 Thread Chris McMahon
 I'm trying to put a loop in a script where it checks for a link on a page, if 
 the link isn't there, it clicks on the next page button, looks for the link 
 again, and the process repeats until it finds the link, and then clicks on it.

It'd be easier to help if you would post a) the HTML involved and b)
the Watir code you've tried so far.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Using Until

2007-04-03 Thread Chris McMahon
Aha, so you want to click Google's Next button?  Take a look at
this, it might give you some ideas:
http://testingjeff.wordpress.com/2007/01/27/creating-methods-on-the-flyand-bugs-in-google-phonebook/

Also, if you are unsure how to address a particular page element, take
a look at the unittests folder in the watir directory.  It will be
in C:/ruby/lib/ruby... somewhere, depending on whether you did a gem
install or used the one-click installer.

On 4/3/07, Nicola Kennedy [EMAIL PROTECTED] wrote:
 Sorry, probably my fault for not being clear about how new I am to this.

 I want the code to do the following things:
 1. Check on page for a link.
 2. If link not there, press Next page
 3. If link there, click on it.
 4. When next page reached (if step 2 followed), repeat the action of looking 
 for link/clicking next.

 Am playing around with code, and have come up with following:

 link = ie.link(:url, http://www.freeuk.com;)
 until link.exists
 ie.goto(http://www.google.co.uk/search?q=freeukhl=enstart=10sa=N;)

 if link.exists = true
   ie.goto(link)
 end

 Am totally aware that this will not work, but it may give my helpers more 
 idea of the details I want!!

 Thankyou all in advance, and please help!
 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] OT: Thoughtworks planning to release a tool for application testers

2007-04-03 Thread Chris McMahon
TW is about to release this thing called Mingle to manage agile
projects.  Today they announced an upcoming tool for testers:
http://studios.thoughtworks.com/2007/4/2/how-our-testers-use-mingle
(see the last paragraph).
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Assert Dates?

2007-04-02 Thread Chris McMahon
 If I use a constant '01/01/07 - 01/01/08' there is no problem, but I need 
 some way to deal with the dates in the parameters.

escape the slashes:   /01\/01\/07/ - 01\/01\/08/

That said, anytime I deal with dates, I usually try to make them
actual date objects, then I can assert interesting things about when
stuff happens.  I made a demo, I hope this helps.

#
require 'parsedate'
require 'test/unit'

class TC_Date  Test::Unit::TestCase
def test_date

#TEST DATA
arr_date = 01/01/07
dep_date = 01/10/07

#DATA FOUND IN THE APP
found_arr_date = 01/01/07
#CHANGE YEAR TO 07 TO PASS TEST 2, CHANGE MONTH TO 10 TO PASS TEST 3
found_dep_date = 01/09/06

#GET THE RAW ELEMENTS OF THE DATE
arr = ParseDate.parsedate(arr_date)
dep = ParseDate.parsedate(dep_date)
found_arr = ParseDate.parsedate(found_arr_date)
found_dep = ParseDate.parsedate(found_dep_date)

#TURN THE RAW ELEMENTS INTO DATE OBJECTS FOR COMPARISON
arr_obj = Time.local(*arr)
dep_obj = Time.local(*dep)
found_arr_obj = Time.local(*found_arr)
found_dep_obj = Time.local(*found_dep)

#TEST 1:  JUST SHOWING WHAT A PASSING TEST LOOKS LIKE
assert_equal(arr_obj,found_arr_obj)

#TEST 2:  ASSERT THAT WE'RE LEAVING LATER THAN WE'RE ARRIVING
assert(found_dep_obj = found_arr_obj,leaving before we arrive!
#{found_dep_obj} is less than #{found_arr_obj})

#TEST 3:  ASSERT THAT OUR TEST DATE MATCHES THE DATE IN THE APP
assert_equal((dep_obj - arr_obj),(found_dep_obj - found_arr_obj))

end
end
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Can we use as many variable names without worrying about memory wastage

2007-03-28 Thread Chris McMahon
The number of variables is not going to be a problem.  But watch out
if you have for instance several arrays with 50,000 elements in each.
Those can eat up some memory.

Ruby has what's called a garbage collector that handles removing
things that the script is done with.
-Chris

On 3/28/07, vijay [EMAIL PROTECTED] wrote:
 Hello people,

 Can we use as many variable names as we want in a script without worrying 
 about the memory wastage?  Each variable is going to occupy some bytes in 
 memory and those bytes would remain occupied as long as the script is 
 running.  If so, then in order to avoid memory wastage, to the maximum 
 possible extent, we need to use as few variables as possible in the script.  
 Is this right?  Can I make Watir free the memory space occupied by a variable 
 once I find that the variable is not needed anymore?  Thinking on the lines 
 of not wasting memory, I am using same variables again and again in the 
 script.  If I could find out a way, through you people, to free the memory 
 space occupied by a variable, I would use several variables with appropriate 
 names in the script.

 Thanks for your time,
 Vijay.
 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] hi, Is there a GOTO function for watir

2007-03-27 Thread Chris McMahon
On 3/28/07, Maloy kanti debnath [EMAIL PROTECTED] wrote:
 hi,

 IS there any function which is simlar like VB 6.0 GOTO so 
 that we can say
 if condition
 goto line 8
 else
 goto line 20
 end

GOTO is not a very good way to do such things.  Try using methods:

###
conditional = yes

#def/end is one method
def method_eight
  puts this is not line 8
end

def method_twenty
  puts this is not line 20
end

if conditional == yes
  method_eight  #invoke method_eight above
  conditional = no
end

if conditional == no
  method_twenty
end
###
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Watir can't find IEnum interface

2007-03-26 Thread Chris McMahon
I run Brad's code with no problem (thanks for the example!).

Googling, I find that IEnum interface is an error coming from Ruby's
WIN32OLE library.  The root cause seems to be some kind of error in
the interface between Ruby and Windows on the particular machine.

One very suggestive issue is that Kevin Rutherford's error said
failed and not Failed, and this site
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/3213
suggests that Rutherford has a Ruby WIN32OLE library from 2004 or
earlier.

Based on what we've learned so far, I'll suggest that either the Ruby
installation is flawed, or Windows itself on these particular machines
has a flawed OLE of some sort.

Without more information, my best suggestion is to uninstall and
reinstall Ruby, then re-install Watir on top of the new Ruby.   Make
sure you're using the Ruby one-click installer.

On 3/26/07, Brad [EMAIL PROTECTED] wrote:
 I'm seeing the same error on my environment.  Here is the same code along 
 with the error.

 Code:

 require 'rubygems'
 require 'watir'
 include Watir
 #require 'watir_ext' # extension to watir for 'visible?'
 #include Watir
 require 'test/unit'
 require 'csv'


 puts Watir::IE::VERSION  # check for WATIR version

 class TC_recorded  Test::Unit::TestCase
 def test_recorded
 ie = IE.new
 ie.goto('http://wtr.rubyforge.org/watir_user_guide.html')
 ie.button(:name, 'clickme').click
 ie.goto('http://wtr.rubyforge.org/watir_user_guide.html')
 ie.text_field(:name, 'typeinme').set('Watir World')
 end
 end
 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Watir can't find IEnum interface

2007-03-26 Thread Chris McMahon
Sorry I can't help more.
I'm using ruby 1.8.5 (2006-08-25) and Watir 1.5.1.1158, WinXP.
You might try playing with OLE directly.   For instance, try to move
object from Paint to Word, or something.  See if you can get the same
error from pure MS applications.
-C


On 3/26/07, Brad [EMAIL PROTECTED] wrote:
 Thanks Chris,

 I just did the following and see the same error:

 * uninstalled Ruby 186-25
 * reboot PC
 * installed Ruby 186-25 using Windows installer
 * run latest Watir gem 1.5.1.1158

 This use to work on an earlier version Ruby (185-21) and Watir (1.5.1.1136) 
 but left this for a while (over a month) and when I came back I saw these 
 errors so I decided to update Ruby and Watir.  I wander if something broke 
 when IT ran Microsoft patches to our machines.

 Thanks,
 Brad
 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] watir execution from webserver

2007-03-26 Thread Chris McMahon
 In all it only took 5 rails controllers (less than 100 lines total) and 5 or 
 6 separate views.  (And I'm sure it could be compacted even more.)  I came 
 out of the experience pretty impressed with rails.  If there's interest I can 
 try to clean up the code and post it.

I'm interested as well.  I've barely touched Rails, and this would be
a great way to  learn more about it.
-Chris
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] How to access browser authentication pop-up

2007-03-22 Thread Chris McMahon
On 3/22/07, Oscar [EMAIL PROTECTED] wrote:
 Thanks, I'm looking into it now.

 Another thing I thought of with the help of someone at my work was to send 
 the http headers along with my request for the url. I fired up Ethereal to 
 capture the packets and found out some information about the http get I'm 
 doing when the username and password get sent.

 So if I can find a way to integrate this request into my initial ie open $url 
 then I think I can get past this with minimal hassles. But I haven't found a 
 way to send a custom http header with the url request.

I actually did this, but IE didn't behave properly.  On a normal
connection with Basic Auth, the browser will allow access to every
link and frame accessible once you've logged in one time.  However, if
you pass Basic Auth headers on the Watir goto() method, the browser
only allows you access to a single page, and the links and frames on
the page are still not accessible.

It's probably possible to hack Watir to pass Basic Auth credentials
for access to every element, but it would be a big job.

-Chris
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] How to access browser authentication pop-up

2007-03-22 Thread Chris McMahon
On 3/22/07, Charley Baker [EMAIL PROTECTED] wrote:
 Well, if you want to go down that roadyou could investigate using
 Navigate2 on the internal ie ole_object.

 ie = IE.new
 ie.ie.Navigate2('http://www.google.com',0,'','' )

Aha.  I might get around to trying this today, if I can find a site
that has Basic Authentication.
-C
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] idle question: @ie.refresh2(3)?

2007-03-18 Thread Chris McMahon
I have a long-running script that occasionally encounters a server
error.  I've been considering putting in some retry logic (there are
only 5 clicks in the script) that would just hit refresh if
something went haywire.

I didn't think Watir had a refresh method, but I went and looked,
and there it was, along with back and forward.

But just out of curiosity, why is it called refresh2 and why does it
take 3 as a argument?

-Chris
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] Fwd: idle question: @ie.refresh2(3)?

2007-03-18 Thread Chris McMahon
Thanks Paul, I figured you'd have it handy.
Interesting to see that there is not only a refresh() and refresh2().
there is also a Navigate() and Navigate2().


-- Forwarded message --
From: Paul Rogers [EMAIL PROTECTED]
Date: Mar 18, 2007 2:37 PM
Subject: Re: [Wtr-general] idle question: @ie.refresh2(3)?
To: wtr-general@rubyforge.org


http://msdn.microsoft.com/workshop/browser/webbrowser/reference/methods/refresh2.asp?frame=true


- Original Message -
From: Chris McMahon [EMAIL PROTECTED]
To: wtr-general@rubyforge.org
Sent: Sunday, March 18, 2007 11:48 AM
Subject: [Wtr-general] idle question: @ie.refresh2(3)?


I have a long-running script that occasionally encounters a server
 error.  I've been considering putting in some retry logic (there are
 only 5 clicks in the script) that would just hit refresh if
 something went haywire.

 I didn't think Watir had a refresh method, but I went and looked,
 and there it was, along with back and forward.

 But just out of curiosity, why is it called refresh2 and why does it
 take 3 as a argument?

 -Chris
 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general



___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Watir can't find IEnum interface

2007-03-15 Thread Chris McMahon
On 3/15/07, Kevin Rutherford [EMAIL PROTECTED] wrote:
 Hi,
 Does anyone have any idea what's broken in my environment please?
 Many thanks,
  Kevin

Different versions of Ruby maybe?
BTW, there is detailed information about which tests didn't pass.  I
think it goes to STDERR, though, not STDOUT, so you might have sent it
somewhere you can't see it.
-C
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Watir can't find IEnum interface

2007-03-15 Thread Chris McMahon
 Nop,e checked that.  Besides, the irb session I pasted is verbatim.

Run the unit tests from the command line and check the output.  At the
*very end* of the entire run (that is, don't kill the process in the
middle), you should have some ... characters, some F characters,
followed by the pass/fail summary, followed by diagnostic information.

Post the diagnostic information here.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] How to call different test cases???

2007-03-14 Thread Chris McMahon
There is a good discussion of this on p. 159-160 of Programming
Ruby. (Second edition).  If you spend any significant time with Ruby,
having this book is really important.
-Chris

On 3/14/07, Jet Aquino [EMAIL PROTECTED] wrote:
 Hi,

 I was wondering if you guys can help me out. I'm kinda lost in Watir
 particularly in calling other test cases. Can somebody give me a sample on
 how this can be done in Watir???

 What I mean is i want to make a general or a main script that will call
 other scripts and execute them.

 Sample:

 Main.rb contains the codes that will call other scripts like login.rb,
 compute.rb, logout.rb.

 Can anybody give me a sample for this???

 I appreciate all your help guys.

 Thanks in advance.
 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Excel Interface Class

2007-03-02 Thread Chris McMahon
Bravo!
-C

On 3/2/07, Brown, David [EMAIL PROTECTED] wrote:
 I've posted an Excel Interface class which I've developed over the past
 few months on the Watir openqa.org site under contributions:
 http://wiki.openqa.org/display/WTR/Excel+interface+class

 This class provides simple methods for reading data records from Excel
 spreadsheets, hides the complexities of directly using ruby's win32ole
 library to interface with Excel, and makes it much easer to create
 data-driven Watir tests.

 I hope it will be as useful to others as it has been for me.

 -David Brown
 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] How to get the localhost IP in Warit/Ruby

2007-03-01 Thread Chris McMahon
On 3/1/07, Jason He [EMAIL PROTECTED] wrote:

 Hi all,

  Is there any available method to fetch the localhost's IP address?


irb(main):001:0 require 'socket'
= true
irb(main):002:0 ip_address = IPSocket.getaddress(Socket.gethostname)
= 192.168.2.106
irb(main):003:0
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Testing e-mail digest

2007-02-27 Thread Chris McMahon
 I could probably make the third option work in Ruby. I have not worked with 
 databases yet, but I hope it would not be too hard. I just wonder if there is 
 a more simple way

That sounds like a reasonable approach.  I wrote an article for this
month's Better Software with very simple exercises in using databases
with Ruby.  If you need a copy, contact me off the list, I think I
still have a proof PDF version.

-Chris
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Button identification

2007-02-26 Thread Chris McMahon
That's a frame.  You need to do something like

frame(:name, 'Quickwatch').show_all_objects

On 2/22/07, Simba [EMAIL PROTECTED] wrote:
 Thanks Bret , Toady i have seen that limitation in Watir site , i did not 
 knew this limitation in Watir  and also i am new to Watir , I have another 
 question for you

 For some page I used ie.show_all_objects in CMD , it has given ouput 
 something like this
 HTML Docuemnt name=Quickwatch id=quickwatch 
 src=http://10.20.1.214:80/mwp/servlet/workspace/quickwatch?action=loadRES=1024X768

 I am not able to see objects and its properties of this document, Can you 
 please tell how to resolve this problem.
 -
 Posted via Jive Forums
 http://forums.openqa.org/thread.jspa?threadID=6647messageID=19116#19116
 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Test Data Cleanup/Reset Database in a .bat between tests

2007-02-26 Thread Chris McMahon
 They work if these tests are run individually.  However, when I run the 
 class, they fail, since the TC#1 already created the user jdandy.

 So, how can I call this batch file in between each TC, with the batch file 
 completing before starting TC#2?

You might consider making a direct database connection via ODBC or DBI
in order to issue a DELETE 'jdandy' FROM users SQL command.  Also,
look into using setup() and teardown() methods in test/unit.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Watir.. close, but not close enough

2007-02-22 Thread Chris McMahon
On 2/22/07, Walter Kruse [EMAIL PROTECTED] wrote:
 Bret,
 I had a look long ago at Piotr Kaluski's very detailed docs for Perl's
 Win32GuiTest
 (http://www.piotrkaluski.com/files/winguitest/docs/winguitest.html).

 He even lists some C code examples. I'm afraid C is a little beyond
 me...

Wayne Vucenic got a good start on a Ruby Win32::Guitest.
http://rubyforge.org/projects/guitest/  There are actually enough
functions implemented that the code is probably even useful right not.
 I'm an administrator for the project, so if you'd like to jump in
anywhere, let me know.

-Chris
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Connecting to Oracle error - error: custom_require.rb:27:in `gem_original_require': no such file to load -- oci8 (LoadError).

2007-02-16 Thread Chris McMahon
 Thanks for taking the time to look at this. If you are referring to
 Ruby/OCI8 for Oracle, yes I already have that installed. Any other ideas as
 to how to get this fixed?

Clearly you *don't* have it installed, or else it's installed
improperly.   The message custom_require.rb:27:in
`gem_original_require': no such file to load -- oci8 (LoadError).
means that Ruby can't find your oci8 library.

You should probably find a list devoted to whatever OCI8 library you
attempted to install, instead of the Watir list.

-C
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] OT: algorithm help?

2007-02-16 Thread Chris McMahon
On 2/16/07, Bret Pettichord [EMAIL PROTECTED] wrote:
 Here is a clever and elegant solution:

 http://dannorth.net/2007/02/monkey-business-value

I read this yesterday, I was kind of surprised to find it coming from
a TW developer.  This is *so* not unit-testing!
-Chris
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] OT: algorithm help?

2007-02-13 Thread Chris McMahon
 def calc(weights)
r = weights.inject(0){|s,x|s+x} * rand
weights.inject(0) {|s,x| s+=x; return x if s=r;s}
weights[-1]
 end
 stat={}
 stat.default=0
 1_000_000.times { stat[ calc([0.2, 0.5, 0.1, 0.3]) ] += 1 }
 stat.each {|k,v| printf %4.2f %4.2f\n, k, v/1_000_000.0}

One major drawback for this is that it won't work out of the box for
values like calc([0.1,0.1,0.8])   That is, call def a 10% of the time,
def  b 10% of the time, def c 80% of the time.  It seems input values
have to be unique.

-C
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] OT: algorithm help?

2007-02-13 Thread Chris McMahon
 One major drawback for this is that it won't work out of the box for
 values like calc([0.1,0.1,0.8])   That is, call def a 10% of the time,
 def  b 10% of the time, def c 80% of the time.  It seems input values
 have to be unique.

Here's something that does the job, but I can't help thinking that if
I had more CS background, it could be a lot more elegant.  Seems like
a classic recursion problem:


a=20
b=20
c=10
d=0
e=40
f=10

a_range = [1..a]
b_range = [(a+1)..(b+a)]
c_range = [(a+b+1)..(a+b+c)]
d_range = [(a+b+c+1)..(a+b+c+d)]
e_range = [(a+b+c+d+1)..(a+b+c+d+e)]
f_range = [(a+b+c+d+e+1)..(a+b+c+d+e+f)]

puts a_range
puts b_range
puts c_range
puts d_range
puts e_range
puts f_range
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


  1   2   3   4   >