Re: [Wtr-general] Query in windows-pr,win32-process and Rspec

2007-07-12 Thread Charley Baker

windows-pr - win32 constants used by win32-process.
win32-process - watir is now using Process.create in this library, see the
following JIRA ticket for more details:
http://jira.openqa.org/browse/WTR-150

Rspec - Behavior driven development framework, a quick google search on BDD
and Dave Astels should give you more information on BDD. Also obviously take
a look at the RSpec site.
http://rspec.rubyforge.org/documentation/index.html  A lot of people find
this a more natural way to write tests.

-Charley

On 7/12/07, SHALINI GUPTA <[EMAIL PROTECTED]> wrote:


Hi All,

Please tell me what are the advantages of
1-windows-pr
2-win32-process
3- Rspec

I have downloaded 'watir-1[1].5.1.1192.gem' ,'windows-pr-0.6.6.gem' and '
win32-process-0.5.2.gem'
and istalled as described in user guide.
But can some one plz tell me their advantages..
so that i can take more advantages of watir.

Regards
Shalini Gupta

___
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] `+': can't convert nil into String (TypeError)- how to solve this error

2007-07-12 Thread Charley Baker

Hi,

 In your login method in commonipe.rb on line 5, you're doing some sort of
concatenation of a nil to a string, likely something like this:
puts "my value is: " + foo

foo is nil while you're running your test for whatever reason. You need to
figure out why you're getting nil if you're not expecting it or account for
it if you are.
puts "my value is: " + foo unless foo.nil?

The stack trace is there to help you figure out what went wrong, work your
way back through it if you aren't expecting nil.

-Charley

On 7/12/07, murali <[EMAIL PROTECTED]> wrote:


hi

can any one solve this iam getting this error while running the script.

./lib/commonipe.rb:5:in `+': can't convert nil into String (TypeError)
from ./lib/commonipe.rb:5:in `login'
from D:/Documents and Settings/mmopur/Desktop/IPE
Aut/Category.rb:46
from D:/Documents and Settings/mmopur/Desktop/IPE
Aut/Category.rb:30:in
`each'
from D:/Documents and Settings/mmopur/Desktop/IPE
Aut/Category.rb:30



regards
murali
___
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 controls in a dialog box

2007-07-11 Thread Charley Baker

A quick check will tell you if it's a modal dialog. Open ie to the page that
launches the dialog. Open irb in a command window. In irb type:
require 'watir'
ie = Watir::IE.attach(:title, /some part of the ie title/)

Launch the dialog. Back in irb type:
puts ie.modal_dialog.title

If you get a title string then you've got an ie modal dialog which you can
interact with using ie.modal_dialog

The tricky thing with modal dialogs is getting the controls. You can dump
the html into a file, pop it open using ie and then use ie developer toolbar
on it.

-Charley

On 7/10/07, Bret Pettichord <[EMAIL PROTECTED]> wrote:


Paul Rogers wrote:
> have you looked at the modal_dialog stuff in watir? Ive never used it
> so cant help you much, but its there.
+1
___
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] need help on Data Driven

2007-07-10 Thread Charley Baker

The error pretty much tells you the story. You're taking an array: category=
worksheet.Range('a2:a4') ['Value']  and pushing it into a method that
accepts a string. If you want the whole array to be a string then convert it
to a string:
category=worksheet.Range('a2:a4') ['Value']

category.to_s

If that's not the intention, then grab whatever string you want and pass
that on - cycle through the array, whatever.

-Charley

On 7/9/07, murali <[EMAIL PROTECTED]> wrote:


Hi every one,

   iam facing problem with the data driven. have glance of my code
and let me know where i did mistake.

excel= WIN32OLE::new('excel.Application')
workbook=excel.Workbooks.Open('D:\Documents and
Settings\mmopur\Desktop\IPE Aut\test.xls')
worksheet=workbook.Worksheets(1)
worksheet.Select
excel ['Visible']
#worksheet.Range('a2') ['Value']
category=worksheet.Range('a2:a4') ['Value']
line = '1'
while worksheet.Range("a#{line}")['Value']
   line.succ!

ie.text_field(:name,"ctl00$ContentPlaceHolder1$txtCategory").set(category)


when i run the script iam getting the errors as belo mentioned

c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3431:in `+': can't convert Array
into S
ring (TypeError)
from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3431:in `doKeyPress'
from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3427:in `each'
from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3427:in `doKeyPress'
from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3393:in `set'
from D:/Documents and Settings/mmopur/Desktop/IPE
Aut/datadriven.rb:59


plz look into that and do needful

Regards
Murali
___
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] $ie.button replacing with $ie.b?

2007-07-07 Thread Charley Baker

I'm not quite sure why you'd want to do that, maybe you could explain it.
Here are a couple of random possibilities:

1. use the string and eval it, makes the code less readable but there are
some good uses for this:
b = "button"
eval("puts $ie.#{b}(:index, 1)")

2.wrap the code in a method, cleaner access and sets you up for methods on
your pages which you can roll into classes for your pages:

def my_form_button; $ie.button(:index, 1);end

puts my_form_button
my_form_button.click

It all depends on what the context of the question is and where you might
want to take it.

-Charley

On 7/7/07, mihai <[EMAIL PROTECTED]> wrote:


cand i do something like this, and how:

b="button"
puts $ie.b(:index,1)

instead of puts $ie.button(:index,1)
___
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] Having problems figuring out what to click

2007-07-07 Thread Charley Baker

Hi Matt,

 You need to access the cell, the onclick event is attached to the cell,
not the row. This should work:

$ie.table(:id,'table1')[1][1].fire_event('onClick')

table with id of table1, first row, first cell.

-Charley

On 7/6/07, Matt Berney <[EMAIL PROTECTED]> wrote:


I have been using Ruby and watir for a while now.  But, the set of web
pages has me stumped.  Any help you can provide is extremely appreciated.

In the source code below, there is a table of items that, when clicked,
fills in a frame.  I can get to the TableRow.  But, click on it or
fire_event('onClick') doesn't seem to do the trick. The flash method doesn't
light up.  However, flashing the entire table seems to work.  So apparently,
I am not selecting the item I want.

# this works
$ie.table(:id,'table1').flash

# this doesn't work
$ie.table(:id,'table1')[1].flash
$ie.table(:id,'table1')[1].click
$ie.table(:id,'table1')[1].fire_event('onClick')

How does one call the changlframes() javascript function?  I thought that
is what the fire_event() was for.  BTW, if it makes any difference, this
table is inside a .

Thanks in advance.




Ticket
Info


...


SVAs



___
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] Reporting suggestions?

2007-07-06 Thread Charley Baker

I'd suggest using ci-reporter -
http://rubyforge.org/projects/caldersphere/- for your main test
reporting, though honestly I've got little experience
with it and am still using it's predecessor test-unit report. For your puts
statements why not use ruby's logger or log4r instead? Dump your puts
statements and replace them with log calls to a file.

Log4R: http://log4r.sourceforge.net/
Logger is part of ruby, there are examples of subclassing and usage inside
Watir.rb

-Charley

On 7/6/07, Chong <[EMAIL PROTECTED]> wrote:


If you don't need the console output to be real-time, perhaps you could
use the following as a launcher script?

IO.sync = true
out_file = File.new('test_output.log', 'w')
ret = `ruby test_main.rb`
$stdout << ret
out_file << ret
out_file.close
___
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] Modal Dialog/Vista -- undefined method `hwnd'

2007-07-06 Thread Charley Baker

Modal dialogs aren't part of a frame, they're generated and owned by ie, so
this line:

  ie2.frame("ContentFrame").modal_dialog.text_field(:id,
'FileUploader').set('C:\Users\Public\Pictures\Sample Pictures\Dock.jpg')

should read:
  ie2.modal_dialog.text_field(:id,
'FileUploader').set('C:\Users\Public\Pictures\Sample Pictures\Dock.jpg')

-Charley

On 7/6/07, Michael Kernaghan <[EMAIL PROTECTED]> wrote:


 Bret Suggested:

>I think the error message may be misleading. I think the problem may

>actually be caused by the use of frames. Can you show us the code that

>is failing?



Certainly. Warts and all here it is:



require 'watir'

require 'win32ole'

include Watir

require 'test/unit'



$how_many = 3

$count = 0



class TC_article_example < Test::Unit::TestCase



def add_new

   #Open, login and navigate

   ie = IE.new

   ie.goto("http:// corporate secrets obscured ")

   ie.text_field(:name, "OrgNameTextbox").set("testing")

   ie.text_field(:name, "UserNameTextbox").set("testing")

   ie.text_field(:name, "PasswordTextbox").set("testing")

   ie.button(:name, "LoginButton").click

   assert(ie.contains_text("Please select a workspace"))



   ie.link( :url, "http:// corporate secrets obscured ").click

   ie.link( :text, "Enter Project").click

   ie.link( :text, "APPLICATIONS").click

   ie.link( :text, "Drawings").click



   #Launch and attach new document

   ie.button(:value, "New").click

   ie2 = Watir::IE.attach(:url, /Drawing/)



   #Populate fields

   ie2.frame("ContentFrame").text_field(:name,
/V:MainGeneral:SeriesIdentifier:SeriesIdentifierFieldRow:TheTextBox/).set(randomStr(10))

   ie2.frame("ContentFrame").text_field(:name,
/V:MainGeneral:DocTitle:DocTitleFieldRow:TheTextBox/).set(randomStr(10))



   ie2.frame("ContentFrame").button(:id,
"V_FileInformation_Attachments_SourceFileLink_MyUploadButton").click_no_wait



   #Error report cited line follows

   ie2.frame("ContentFrame").modal_dialog.text_field(:id,
'FileUploader').set('C:\Users\Public\Pictures\Sample Pictures\Dock.jpg')



   #Save and Iterate

   allFrames = ie2.getDocument().frames

   count = allFrames.length

   ie_docFrame = ie2.frame(:name, allFrames.item(count-1).name)



   ie_docFrame.button(:id, "V_DocTools_SaveButton_Button").focus

   ie_docFrame.button(:id, "V_DocTools_SaveButton_Button").click



   $count = $count+1



   ie.close

   ie2.close

end



def randomStr( len )

chars = ('a'..'z').to_a + ('A'..'Z').to_a + (0..9).to_a

len = rand(len) +1

return (1..len).collect { |i| chars[rand(chars.length),1] }.to_s

end



def test_add_new

while $count < $how_many #Error report cited line

add_new

puts $count

end

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] Embedded Browser and/or SmartCleint

2007-07-05 Thread Charley Baker

My guess is that you could attach to the embedded browser if you can get a
handle to the ie instance and then attach to the handle using
ie.attach(:hwnd, handle). You may be able to get a handle by navigating
through windows, simalarly to the way it's set up in Watir by using
Shell.Application, iterating through windows and finding a window that
matches either your title, url or class name. Check out each on class IE for
an example.

I haven't done this before but that would be the general tack I'd take.
There are likely better ways, but that'd be my first route. Otherwise you
could find the window with Winclicker based on the title and class and pump
that into ie.attach or find the child window that's serving the content and
use that. Not having done it this is where I'd start and poking around on
msdn, there are some good articles on hosting a browser control which might
prove useful. Codeproject also has some examples of that.

win32ole_pp has been of help to me here and there for getting better
insight into the ole objects and supported methods.

-Charley

On 7/5/07, Lonny Eachus <[EMAIL PROTECTED]> wrote:


I am trying again:

Does anybody know anything about getting the DOM or attaching with Watir
when the IE browser is embedded in an application, such as with
Microsoft smartclient?  When the application in question is running, it
is obviously just a wrapper around IE and it displays the same web pages
I find on the main site via my regular browser. But soon some of those
pages may be made inaccessible except through this "client" application.

I already have a lot of automation written for this site. It could be a
lifesaver if I could just find a way to attach to the embedded DOM.

This is important. I could really use any help or ideas that are out
there.

Lonny Eachus


___
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 detect installed version of Watir

2007-07-05 Thread Charley Baker

Open a command prompt, type:
ruby -e "require 'watir'; puts Watir::IE::VERSION;"

-Charley

On 7/5/07, Nadine Whitfield <[EMAIL PROTECTED]> wrote:


Hi-
there may already be a thread about this, but I could not find it.

I recently used the Windows .exe (rather than Gem) to install Watir on my
computer. I'm pretty sure it's +not+ the newest version available.

How do I find out which version I installed?

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

Re: [Wtr-general] ruby2exe and autoit

2007-07-05 Thread Charley Baker

You need to register AutoIt. In a command window, navigate to the directory
where you've put AutoIt and type:
regsvr32 AutoItX3.dll

-Charley

On 7/5/07, mihai <[EMAIL PROTECTED]> wrote:


i have a script in wich im using an autoit control:
$autoit= WIN32OLE.new("AutoItX3.Control")

i want to test my script on another PC; so im making an exe with ruby2exe
for my script and when im executing the .exe on another PC im getting this
error:


C:\DOCUME~1\QA_BLA~1\eee\eee.test.exe.2\app\test.rb:9:in `initia
lize': unknown OLE server: `AutoItX3.Control' (WIN32OLERuntimeError)
HRESULT error code:0x800401f3
  Invalid class string  from C:\DOCUME~1\QA_BLA~1\eee\eee.test.e
xe.2\app\test.rb:9:in `new'
from C:\DOCUME~1\A_BLA~1\eee\eee.test.exe.2\app\blazent_test.rb
:9
from C:\DOCUME~1\A_BLA~1\eee\eee.test.exe.2\bootstrap.rb:77:in
`load'
from C:\DOCUME~1\A_BLA~1\eee\eee.test.exe.2\bootstrap.rb:77

i have try to copy AutoItX3.dll in the directory where the .exe is or in
windows/system32 but the error still appears.

What can i do?
___
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] Receiving extensive warning messages while trying to run Watir Ruby scripts

2007-07-05 Thread Charley Baker

It's likely that you have multiple Watir requires with different casing
somewhere in your files:

require 'watir'
and
require 'Watir'

That'd be my first guess. Check your scripts for requires.

-Charley

On 7/4/07, Lavanya Lakshman <[EMAIL PROTECTED]> wrote:


I have installed 1.8.5 version of ruby along with 1.4.1 version of Watir
before and didnt have any issues, until recently I was required to have a
completely new setup on a different machine.

Ruby I have installed from (http://rubyforge.org/frs/?group_i d=167)
1.8.25-21 version.

While running any of the Watir scripts, I am receiving the following
warning messages:

E:\PROVIS>GlobalAdminScript.rb
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1039: warning:
already ini
tialized constant REVISION
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1042: warning:
already ini
tialized constant VERSION
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1045: warning:
already ini
tialized constant READYSTATE_COMPLETE
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1048: warning:
already ini
tialized constant DEFAULT_TYPING_SPEED
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1051: warning:
already ini
tialized constant DEFAULT_SLEEP_TIME
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1054: warning:
already ini
tialized constant DEFAULT_HIGHLIGHT_COLOR
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1901: warning:
already ini
tialized constant TO_S_SIZE
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:2217: warning:
already ini
tialized constant TAG
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:2225: warning:
already ini
tialized constant TAG
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:2232: warning:
already ini
tialized constant TAG
___
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] CAN BE CLICK LINK ASSOCIATED WITH AN IMAGE

2007-07-02 Thread Charley Baker

Well, you learn something new every day. I haven't worked with labels, :for
is a supported how for labels. Teach me to answer a question without trying
it out. :)   The :after? tag doesn't appear to apply to input elements,
buttons, text_fields, frames. Add a JIRA ticket if you'd like to see it
fixed and ideally also a failing unit test.

-Charley

On 7/2/07, Jason <[EMAIL PROTECTED]> wrote:


> > ie.text_field(:after?, ie.label(:for, "confirmPassword")).flash
> What's :for? It's not part of Watir. Have you tried by :name and/or :id?

Fair point.

I originally tried it from this page:
http://wiki.openqa.org/display/WTR/Methods+supported+by+Element where it
states:

> label   tags (including "for" attribute)

Simply because it was the only available attribute for this field.  No ID,
no NAME, no CLASS.  Nothing.

And it appeared to work, on it's own:

   ie.label(:for, "confirmPassword").flash

certainly finds the label with this attribute.
___
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] Possible to run scripts when not "logged in"?

2007-06-29 Thread Charley Baker

CruiseControl is a good way to go if you're interested in setting up a
continuous integration server this is a good way to go. This is the ruby
version: http://rubyforge.org/projects/cruisecontrolrb/

-Charley

On 6/29/07, Justin <[EMAIL PROTECTED]> wrote:


I am considering using Watir to create a "build" test for a web
application. My concern is running those tests unattended and automatically.
Has anyone tried running Watir tests without being logged in to their
Windows desktop? That is, can the tests be run from a "cron" or "at"
environment?

Thanks for any help or pointers!

Justin
___
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] CAN BE CLICK LINK ASSOCIATED WITH AN IMAGE

2007-06-28 Thread Charley Baker

What's :for? It's not part of Watir. Have you tried by :name and/or :id?

On 6/28/07, Jason <[EMAIL PROTECTED]> wrote:


> ie.link(:after?, ie.image(:id, 'foo')).click

Does / can this apply to anything other than 'links' or 'images'?  i.e. I
attempted this:

   ie.text_field(:after?, ie.label(:for, "confirmPassword")).flash

Which didn't work.  Even though the individual ie.label(:for,
"confirmPassword") *does* work.

Asking too much here?  :)
___
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] ci_reporter usage of xml files

2007-06-27 Thread Charley Baker

I haven't had a chance to work with ci_reporter though I hope to if I ever
get some free time. My assumption is that they're junit style reports which
can be consumed by a dashboard. We're using CruiseControl now for continuous
builds and reporting results, there's a recent ruby port on rubyforge:
http://rubyforge.org/projects/cruisecontrolrb/

hth,

Charley

On 6/27/07, marekj <[EMAIL PROTECTED]> wrote:


At the top of my  test suite I have the following infrastructre code

require 'watir'
require 'ci/reporter/rake/test_unit_loader'
require 'test/unit/ui/console/testrunner'
include Test::Unit::UI::Console
require 'tc_x_series'
require 'tc_y_series'

and then I overwrite the default suite because I run my TestCases
sequentially
I maintain the order in the array
[TC_x1,TC_x2, TC_y1].each {|testcase| TestRunner.run(testcase)}

Each test produces an xml report, one file per TC_ in test/reports/
folder.

Questions:
How do you guys read the reports, do you have some custom formatters to
translate into HTML? I am new to ci_reporter and we don't run CI here. I
just want to hook up some presentation layer to reports generated by ci. Can
I specify some formatter options to ci_reporter at run time about where to
put the report files rather than the default place?
How do you consolidate the reports into one summary file?
Any ideas would be helpful .
Thanks.
marekj



___
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] return table element content type & value

2007-06-27 Thread Charley Baker

There is no type for an html element. They are all strings. You can
certainly add your own validations on the strings you get back, regexes may
help: http://www.rubycentral.com/book/tut_stdtypes.html

-Charley


On 6/27/07, Max Russell <[EMAIL PROTECTED]> wrote:


 Is there a way to return the content type and value ( in this case, from
an element of a table)?

Something along the lines of the ie.show_all_objects command , but
specifically applied to one object under scrutiny?



This is needed to inspect table element for returned types (strings etc.)





*Max Russell*
Test Analyst
*INPS*



___
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] iterate thru forum

2007-06-20 Thread Charley Baker

Hard to tell without seeing an html snippet of what you're trying to test.
Now that you have the table, I assume you want to iterate through rows.

table.rows.each do |row|
do something with the row
end

-Charley



On 6/18/07, B Smith <[EMAIL PROTECTED]> wrote:


I got this far on my own

   table = ie.table(:index,5)
v_3 = table[1][3].to_s
v_4 = table[1][4].to_s
v_5 = table[1][5].to_s
v_6 = table[1][6].to_s
variable = v_3 + "   " + v_4 + "   " + v_5 + "   " + v_6
   puts variable

This now returns the HEADER row from the correct table in the page. HOW DO
I set this to iterate thru all the threads??

I saw a forum posting for counting links :: ie.(:index,1).links.length,
but it isn't working for my variable.

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

Re: [Wtr-general] get all rows from table in webpage

2007-06-19 Thread Charley Baker

Try this:

t = ie.table(:index, 5)
t.each { |row| row.to_s }

Take a look at the user guide and unit tests for how to use Watir.

-c

On 6/19/07, B Smith <[EMAIL PROTECTED]> wrote:


this doesn't work

v_1 = Array.new
ie.table(:index,5).rows.each_with_index do |row, i|
  end
  v_1.each do |i|
 puts v_1

it throws this error:: .rb:44: undefined method `rows' for
# (NoMethodError)


What is so difficult about retrieving all the rows??? this should be easy

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



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

Re: [Wtr-general] Watir no longer always waits for all frames to load

2007-06-19 Thread Charley Baker

wait_until is a  cleaner method to invoke. sleeps are too error prone,
wait_until a specific control exists. I removed the http error checks around
that time and there have been some changes in the frames handling.

-c

On 6/19/07, Brown, David <[EMAIL PROTECTED]> wrote:


Gems prior to 1.5.1.1166 would either give me the access denied errors
as it tried to wait for the inner frames to load - or if those were
suppressed, I had to put in a manual wait whenever I navigated to a new
page:  "sleep 0.1 until some_element_on_inner_frame.exists?".  After
installing 1166 all of these delay problems were fixed... Until now.

Now that this issue has surfaced I'm forced to put the manual delays in
again. It is not a big deal to do this, but, it's always cleaner if
watir handles the delays properly.

-David


From: Bret Pettichord <[EMAIL PROTECTED]>
Brown, David wrote:
> I've been using the development gem 1.5.1.1166 which includes the
> re-written wait logic to test a complex SAP web application.  The main

> content that I am automating is nested 4 frames deep.  Up until this
> past Friday this version of watir seemed to handle waiting for all of
> the inner frames to load properly.  Now however this wait logic isn't
> always waiting until the pages load completely which causes my scripts

> to fail.  I don't think there have been any changes in the web app I'm

> testing which would cause this. I did happen to install the
> important/critical Microsoft security patches for June which could
> have effected watir?
>  http://www.microsoft.com/technet/security/bulletin/ms07-jun.mspx
>
> Has any one else experienced this problem with the new wait logic not
> waiting quite long enough when there are many nested frames?
>
What happens if you use an earlier Watir gem, before we rewrote the
frame wait logic?

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] Load Error

2007-06-19 Thread Charley Baker

require_gem 'watir'

or gem 'watir'

Try the same in irb. It may be due to the ruby update. I haven't tried it
due to my dependency on modal dialog support.

-c

On 6/19/07, Max Russell <[EMAIL PROTECTED]> wrote:


 My original question was:



On 6/15/07, Max Russell <[EMAIL PROTECTED]> wrote:

>

>  Hi there, I'm getting the following.

>

>

>

> `require': no such file to load -- watir (LoadError)

>

>

>

> I've checked the FAQs and downloaded the latest 1.5 version for my

> Ruby version 1.8.6.

>

> I've listed my local gems and I can see that water is installed, yet

> whenever I try and run my script, I still get the error?



My script was:



# Simple test harness







require 'watir'



require 'watir/testcase'



#require 'test/unit'







#$LOAD_PATH << '..' if $0 == __FILE__



$LOAD_PATH << './Tests'











class TestSuite < Watir::TestCase



File.open(ARGV[0]).each_line do |entry|



   code = lambda{load "#{entry.strip}.rb" }



   self.send(:define_method, entry.strip, code)#{load

"#{entry.strip}.rb" }#puts "#{entry.strip}"



#self.send(:public, entry.strip.to_sym )



end



end







if $0 == __FILE__



  require 'test/unit/ui/console/testrunner'



  Test::Unit::UI::Console::TestRunner.run(TestSuite)



End







Done, the only change I've made from the previously working version is

that this should take command line arguments.



I don't believe this has anything to do with my script at all, but

something to do with the environment it's running under.



Ruby 1.8.6 watir 1.5 - I did have all this working some time ago. The

only real updates have been the Ruby and WATiR versions.





*Max Russell*
Test Analyst
INPS**

___
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] frames and url()

2007-06-19 Thread Charley Baker

I just added url to frame, you might want to download the latest code. Check
the wiki faq for installing building the latest gem from source.

-c

On 6/19/07, Chong Jiang <[EMAIL PROTECTED]> wrote:


Hello all,

Sorry, I do not know how to append this message to my previous one in
threaded form.
The suggestion of using ie.frames(:index, 1).url does not seem to work, as
I get an "undefined method 'LocationURL' for nil:nilClass", even when
ie.frames(:index, 1) exists. I've managed to avoid this entire issue
altogether by navigating to each of the individual pages that comprise the
main, frame-using page.

Thanks anyways,
Chong

___
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] Our contribution to Watir

2007-06-16 Thread Charley Baker

It's great to have user contributions, I haven't had a chance to look at it
yet,  but will soon. Instead of adding it to a jira ticket, you should add
it to the user contribution area of the wiki on openqa.
http://wiki.openqa.org/display/WTR/Contributions

-Charley

On 6/17/07, Jeff Fry <[EMAIL PROTECTED]> wrote:


 aidy lewis wrote:

On 16/06/07, Bach Le <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> wrote:

 The details can be found at  
[http://jira.openqa.org/browse/WTR-162|http://jira.openqa.org/browse/WTR-162]

 There is no project on this URL.

   The url got doubled. If you take either side of the bar it works - and
looks interesting!

http://jira.openqa.org/browse/WTR-162

Thanks Bach &etc. for passing this on!

Jeff

___
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] OT: ruby/eclipse question

2007-06-13 Thread Charley Baker

Hey Jeff,

You can create a .project file at the root of your project directory and
put this in it - replace project_name with your project name.



   project_name
   
   
   
   
   
   org.rubypeople.rdt.core.rubybuilder
   
   
   
   
   
   org.rubypeople.rdt.core.rubynature
   



-Charley

On 6/13/07, Jason Darling <[EMAIL PROTECTED]> wrote:


 Hey Jeff,

Make sure when you create your project, that it's a Ruby Project.  You
check out it out from svn and then create your project/workspace as a Ruby
project.  There is a little "ruby" icon that shows up for .rb files if
this is done.  Are you seeing this?

Cheers,
Jason

-Original Message-
*From:* [EMAIL PROTECTED] [mailto:
[EMAIL PROTECTED] Behalf Of *Jeff Fry
*Sent:* Wednesday, June 13, 2007 8:19 PM
*To:* wtr-general@rubyforge.org
*Subject:* [Wtr-general] OT: ruby/eclipse question

Hey, I know a few of y'all use Eclipse so I figured its worth a shot to
ask this here.

The shop I'm working for has a bunch of (non-GUI) automation written in
Python, to which I'll be adding some GUI scripts written in Ruby/Watir.

There is an existing svn repository like 
https://OurSVNrepository.com/svn/mwtest/trunk/misc


I added a /mwtest/trunk/misc/watir folder to the project and tried to save
my .rb file there, but eclipse is complaining:
Save could not be completed.
Reason: The project trunk is supposed to have a ruby nature.

Googling: "The project trunk is supposed to have a" nature. gets me 0
results. Do I need to create a separate project for my ruby scripts? Can I
somehow give this project a 'dual nature'?

I should note that I have RDT 0.9.0 installed, and have a project for the
watir project here that works just fine (I can save to 
https://svn.openqa.org/svn/watir/trunk/watir
) so my eclipse setup in general shouldn't be the issue.

Thanks,
Jeff

--
http://testingjeff.wordpress.com


___
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] sintax error

2007-06-09 Thread Charley Baker

Change equal? to eql? or == and it 'll work. equal? compares object ids,
eql? and == compare values.

-Charley

On 6/9/07, mihai <[EMAIL PROTECTED]> wrote:


i search with a script all buttons on a page; if the name of a button is
btnG then it must puts OK else NO
the code is:
$ie.buttons.each do |bbtns|
  puts bbtns.name
  if bbtns.name.equal?('btnG')
then puts 'OK'
else puts 'NO'
  end
  puts bbtns.value
  puts
  $i=$i+1
end


but the output is:

btnG
NO
Google Search

btnI
NO
I'm Feeling Lucky


NO
Download Google Toolbar

what im doing wrong?
tnx
___
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] Best Combination of Ruby and Watir

2007-06-08 Thread Charley Baker

modal_dialog only works for 1.8.2 currently since that's the version of Ruby
that the win32ole.so library was compiled against. Bret added an error if
you try to use this feature in newer versions of Ruby. If you need
modal_dialog, you're limited to 1.8.2.

-c

On 6/8/07, Jeff Fry <[EMAIL PROTECTED]> wrote:




On 6/8/07, Bret Pettichord <[EMAIL PROTECTED]> wrote:
>
>
> The IE#modal_dialog command only works with Ruby 1.8.2. You can use the
> latest version of Watir 1.5.
>
> Oops. This may not be clear in the rdocs. To be clear, are you saying
that the IE#modal_dialog command works with ruby 1.8.2 but not with
earlier OR later versions?

Currently readme.rb says:
Best is to use Ruby 1.8.2-14 or later.

Should I change that?


--
http://testingjeff.wordpress.com
___
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] test

2007-06-08 Thread charley . baker
test

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


Re: [Wtr-general] NoMethodError :Undefined method "Process_id" for 1808:Fixnum

2007-06-08 Thread Charley Baker

You might try updating the win32-process gem. Latest version is 0.5.2. There
was a similar posting on the win32-process list on rubyforge. That may or
may not resolve the issue.

-Charley

On 6/8/07, Simba <[EMAIL PROTECTED]> wrote:


When i Run Below is code in IRB ,its throwinf error
require 'watir'
ie=Watir::IE.start("www.google.com")

Error :
NoMethodError :Undefined method "Process_id" for 1808:Fixnum

Please some body tell me why this error is coming?

Before Going into IRB , I had installed Win32-process 0.4.0 &
Watir-1.5.1.1158.gem

thanks
Vinod mp
___
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] Trouble selecting list box item - Any suggestions

2007-06-08 Thread Charley Baker

Sure it's pretty easy. The sizes all show up in divs with size swatch id
tags, you can see them all with the IE dev toolbar. Sold out sizes will have
a div class of soldOut, so look out for those. Watir 1.5 is coming out soon,
until then, you can install a prebuilt development gem :
http://wiki.openqa.org/display/WTR/Development+Builds
Or follow the FAQ for installing a gem from development source. What's your
last name?

-c

On 6/7/07, Norris <[EMAIL PROTECTED]> wrote:


Thanks Charley.  This worked.  In addition, do you know how I can select
the size of the waist and length?  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] Scheduler

2007-06-08 Thread Charley Baker

You might want to ask this on the Selenium forum.

On 6/8/07, Jet Liu <[EMAIL PROTECTED]> wrote:


Hi,
When I set up my schedule using something like

"C:\Program Files\Mozilla Firefox\firefox.exe" -chrome
"chrome://selenium-ide/content/selenium/TestRunner.html?baseURL=
http://www.xyz.com&test=file:///C:\Documents%20and%20Settings\Test%20User\Desktop\Selenium\us/testsuite.html";
-height 750 -width 1100

My question is, how do I actually make it start to run all the tests? That
is, is there a way to make it start running without someone having to
manually click the "Run All Tests" button in the TestRunner?

Any tips much appreciated.

Thanks.

Cheers,
Jet
___
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] Trouble selecting list box item - Any suggestions

2007-06-07 Thread Charley Baker

Norris,

 This will work with Watir 1.5:
ie.select_list(:id, 'qtyDropDown').option(:value, '5').select

Send me an email, I'm curious to hear what you guys are doing and glad to
see you coming out to mailing lists.

-Charley



On 6/7/07, Chris McMahon <[EMAIL PROTECTED]> wrote:


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=7389&pid=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

___
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 Charley Baker

No idea what's happening without the code, or some reference point. Please
post some snippet of code at least, only thing I can tell from this is that
there's some problem when you're calling ie.goto. If you haven't changed
anything then perhaps the network is wonky or the developers changed
something?

-Charley

On 5/31/07, Adam Reed <[EMAIL PROTECTED]> wrote:


This happens from time to time, but never lasted long enough for me to
post a topic about it.

I have a script that formats an XML file for easier parsing, and then
visits each URL listed in this file and ensures that the page is not
dead.  This scipt has remained unchanged for around two weeks, and has
completed successfully each time it has run.  Today, I come into the
office and attempt to run it, and am receiving an error about 5 seconds
after the script is launched (below).  I have not had any new Windows or
IE updates, nor have I upgraded Watir or Ruby.  I also have a compiled
.exe version of this script from ruby2exe that obviously cannot be any
different than it was yesterday, and it fails with the same errors.

I am running IE7 on Windows XP Pro, Watir 1.5.1.1192 (upgraded today
from 1145 to troubleshoot -- error occurs with both), and Ruby 1.8.6-25.

I don't believe the code I'm using matters, as the errors I'm getting
appear to come from watir itself, but I will post the code if you think
it would help.  Any ideas?

Thanks,
Adam Reed

  1) Error:
test_01_verify_urls(TC_CORE_Suite):
WIN32OLERuntimeError: navigate
OLE error code:80004005 in 
  
HRESULT error code:0x80020009
  Exception occurred.
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1145/./watir.rb:1699:in
`method_m
issing'
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1145/./watir.rb:1699:in
`goto'
C:/Documents and Settings/areed/Desktop/automated
tests/cort/verify_core_sit
emap.rb:24:in `verify'
C:/Documents and Settings/areed/Desktop/automated
tests/cort/verify_core_sit
emap.rb:58:in `test_01_verify_urls'
C:/Documents and Settings/areed/Desktop/automated
tests/cort/verify_core_sit
emap.rb:57:in `each'
C:/Documents and Settings/areed/Desktop/automated
tests/cort/verify_core_sit
emap.rb:57:in `test_01_verify_urls'

1 tests, 0 assertions, 0 failures, 1 errors

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Chris McMahon
Sent: Thursday, May 31, 2007 10:30 AM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] A query on Watir - Will watir/firewatir work
onLinux?

> 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
___
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] instantiate a class that inherits from Test::Unit

2007-05-30 Thread Charley Baker

Hi Aidy,

 You can mix in the assertions if that's all you're looking for:


On 5/30/07, aidy lewis <[EMAIL PROTECTED]> wrote:


#Hi
#Is it possible to instantiate a class that inherits from Test::Unit

require 'test\unit\assertions'
class Login  #< Test::Unit::TestCase




include Test::Unit::Assertions



  def username;$ie.text_field(:name, 'username');end
  def password;$ie.text_field(:name, 'password');end
  def sign_in;$ie.button(:alt, /Log in/);end

  def check_main_screen_objects
assert(self.username.exists?)
assert(self.password.exists?)
assert(self.sign_in.exists?)
  end

end

login = Login.new
login.check_main_screen_objects


#if not how can I get round this?

#Aidy
___
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] RDOC - Help determining what needs documentation

2007-05-25 Thread Charley Baker

I updated the :action and :method info. I'll take a look at the chart which
is rather interesting, useful and may point out some discrepancies.

-c

On 5/25/07, Bret Pettichord <[EMAIL PROTECTED]> wrote:


Jeff Fry wrote:
> Hey y'all, I'm resending these in the hopes of getting info from folks
> who know what watir actually does better than I do. If you are up for
> updating the wiki chart, great...but if you just want to email me some
> corrections, that'd be totally fine too. I'll happily update the chart.
If you want further review, i think someone will need to read through
the unit tests and compare what is in them with what is in your chart.
Thanks for putting this together. I think people will find it very useful.

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] Basic accessibility testing with Watir and RAAKT...

2007-05-25 Thread Charley Baker

It does look really cool. Unfortunately hpricot (a required dependency)
dumps out with a Segmentation fault with Ruby 1.8.2. Looks like it only
works with Ruby 1.8.5 and above. Bummer.

On 5/25/07, Chris McMahon <[EMAIL PROTECTED]> wrote:


> 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

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

Re: [Wtr-general] want to enter URL manualy

2007-05-24 Thread Charley Baker

Hi Shalini,

 There shouldn't be a need to use $ie.wait

$ie = IE.new   # creates a new browser window

Now you can enter your url manually if you want. How is this not working?

-Charley

On 5/24/07, SHALINI GUPTA <[EMAIL PROTECTED]> wrote:


Hi all,

I want to enter URL in address bar of my project manually.so i have tried
this
$ie=IE.new()
$ie.wait()

But previously it was working but now its not working.
i have changed my watir version from 1.5.1127 to 1.5.1166

is it the problem??

Please help
Thanks In advance!!

Regards
Shalini Gupta

___
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] Unable to a get a handle of secondary popup window

2007-05-23 Thread Charley Baker

There have been a lot of posts in the past day on the File Download dialog
using AutoIt, take a look at the archives:
http://www.mail-archive.com/wtr-general%40rubyforge.org/

As far as step 4, I'd suggest turning it off in IE. Internet Options >
Advanced > Notify when downloads complete. I haven't had the need to do file
downloads, so I haven't mucked around with it.

-Charley

On 5/23/07, Kevin Scott <[EMAIL PROTECTED]> wrote:


This is the scenario I am trying to use Watir for:

1. Click link within IE window
2. Standard Microsoft window opens - File Download (Window Title) - Click
Save
3. Standard Microsoft window opens - Save As (Window Title) - Click Save
4. Standard Microsoft window opens - Download Complete (Window Title) -
Click Close
5. Continue with script

I am to get through Steps 1 & 2 via the following code (this was available
within the forum):

ie.link(:id, "export_results_to_excel").click_no_wait()

hwnd = ie.enabled_popup(15)
if (hwnd)
  popup = WinClicker.new
  popup.makeWindowActive(hwnd_1)
  popup.clickWindowsButton("File Download", "Save", maxWaittime = 30)
end

It's moving through steps 3 & 4 where I'm struggling. On a side note, this
product rocks!
___
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] The test case should be failed, but it is not

2007-05-17 Thread Charley Baker

WinExists returns either a 1 or a 0, both are true in ruby. You can use
assert_equal instead:

assert_equal(1, autoit.WinExists("test.txt - Notepad"))

-Charley

On 5/15/07, Kui Zhang <[EMAIL PROTECTED]> wrote:


Hello,

I have a question for the test case below.  When the Notepad window is not
open, the test case run and complete without warning or error.  Looks like
autoit statements do not provide warning and assert is passed.

I thought if the Notepad is not open, autoit statements should provide
warning and assert should fail.

Can you please confirm?  If it should be failed, why it is not…

Thanks!
Kui


def test_file_Exists
goto_page
….

autoit = WIN32OLE.new('AutoItX3.Control')

autoit.WinWait("test.txt - Notepad", nil, 5)
autoit.WinActive("test.txt - Notepad")
assert(autoit.WinExists("test.txt - Notepad"))
puts ("Window exist")
autoit.WinKill("test.txt - Notepad")

  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] File problems

2007-05-15 Thread Charley Baker

I often feel like I spend more time on the simple problems than the larger
ones. My only guess is that you're not running the right files since your
print statements aren't showing up. Get a second pair of eyes to look at it
if you can, otherwise if anyone else on the list has suggestions? It's not
easy to troubleshoot remotely. :)

-c

On 5/15/07, Ken <[EMAIL PROTECTED]> wrote:


Yes I am running it through the command line
___
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] File problems

2007-05-15 Thread Charley Baker

Are you running through command line? Somewhere there's a disjoint, hard to
figure out where. Open up irb and try puts $:  and check your scripts for
how they're dealing with the path or modifying it.

-c

On 5/15/07, Ken <[EMAIL PROTECTED]> wrote:


It didnt even display the load path in x or in y.  It skipped right over
that command.  I have a puts right after the puts $: and that was
printed.  I know this has to be a simple problem but its becoming a Pain in
the...
___
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] File problems

2007-05-15 Thread Charley Baker

Make sure your load path is referring to the right place. You might want to
print out your load path in x or y.

puts $:

and check that you're not working with duplicate common files.

-c

On 5/15/07, Ken <[EMAIL PROTECTED]> wrote:


Yea, I did the maintenance in the file system.  I didnt make any changes
to x or y but I did add some code to my common file that I am referencing
the Login function code in.  I added the code and then copied x and created
y.  Is that the problem?  Since x still works fine that is why Im going
crazy.  I did notice though that the new code I added to my common file is
not being looked at.  I have a puts statement inside an if/else that should
work and that doesnt get printed when i run x.rb.  Is there any
documentation anywhere that describes file name and usage?  I couldnt find
anything.
___
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] File problems

2007-05-15 Thread Charley Baker

Hard to say, if you did a copy in the filesystem then everything should be
ok. The first is a warning from ruby, if you're not getting that in your run
with x.rb, then likely the file contents have changed - you've got a space
before a method call. Have the contents of the file changed? Is it in the
same directory? It sounds like a simple error but without more details, I
can't tell.

-Charley

On 5/15/07, Ken <[EMAIL PROTECTED]> wrote:


I have a file lets call it x.rb.  I included my common file with my login
function and it works fine.  I copied x.rb and renamed it y.rb.  I ran
y.rb and got these 2 errors:

warning: don't put space before argument parentheses

and

undefined local variable or method `sURL' for main:Object

I have sURL defined:

# set login variables
  sURL= "x"
  sUserName = "x"
  sPass = "x"

I call my Login function from x.rb and y.rb as follows:

Login (sURL, sUserName, sPass)

I dont understand why the script runs fine when i called it from x but
when I call it from y i get the above 2 errors.  Does anybody have any ideas
why I am having this problem?  I also tried renaming x and then running it
as the new name and I still got the errors.  The one with the space before
the parentheses is puzzling because it didnt have a problem with that when i
originally ran the script.
___
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] Where is reporter.rb

2007-05-15 Thread Charley Baker

test-reporter has been deleted from rubyforge, it's successor being
ci_reporter by Nick Sieger. Follow this thread for more information:
http://www.mail-archive.com/wtr-general@rubyforge.org/msg07217.html

-Charley

On 5/15/07, Russ DeWolfe <[EMAIL PROTECTED]> wrote:


 Where can I get reporter.rb, I don't see it in "test/unit/ui"

??

___
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] reading cell data into an array

2007-05-14 Thread Charley Baker

How about
pin_array = spreadsheetdata[:pinnumber].to_a

-Charley

On 5/14/07, Tunde Jinadu <[EMAIL PROTECTED]> wrote:


The series of digits is being read from a cell in excel using the
following,

spreadsheetdata[:pinnumber] = row.cells(4,13) ['text']

the cell will contain 5 digits, (pin number)
I need to place the digits into an array to be used later in the script
during pin number validation e.g 'what is the second and third digit of
your  five  digit  pin  number'


On 5/14/07, Charley Baker < [EMAIL PROTECTED]> wrote:
>
> Can you give us an example of some of the data in the cell you're trying
> to collect into an array? You should be able to do something like splitting
> it into different strings possibly, depends on what you're getting from your
> cell.
>
> -Charley
>
> On 5/12/07, Tunde Jinadu < [EMAIL PROTECTED]> wrote:
>
> > Hi,
> >
> > I'm looking to read the data from a spreadsheet cell into an array, a
> > series of five digits.
> > I need data in an array to enable me read the values according to a
> > random prompt for two of the five digits that will be in the array with
> > respect to their positions in the array.
> > The problem I have is the data/values captured from the cell are
> > indexed as one group, not distinct values... any help will do in achieving
> > indexing a number of digits from an individual spreadsheet cell into an
> > array and each digit referenced.
> > thanks.
> >
> > --
> > The second half of a man's life is made up of nothing but the habits
> > he has acquired during the first half.
> >   - Fyodor Dostoevsky
> > ___
> > 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
>



--
Why is it that our memory is good enough to retain the least triviality
that happens to us, and yet not good enough to recollect how often we have
told it to the same person?
  - Francois de La Rochefoucauld
___
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] Solution for FAQ "Using key/value pairs" not working

2007-05-14 Thread Charley Baker

Hey aidy,

 There aren't any attribute accessors for class variables. Why? You could I
suppose, but you'd want to keep them accessible only by methods in the
class. I think I'm starting to understand your general question or I could
be totally offbase.

 Say for instance to take a classic example you want to figure out how many
times your class is being used. This is a pretty trivial example but I hope
will illustrate the point.

class MyClass
 @@users = 0

 def initialize
   @@users +=1
   puts "This could do something more useful" if @@users > 1 # this could
exit refuse new instances, etc
 end

 def count
   puts @@users
 end
end


m1 = MyClass.new
m1.count
=> 1
m2 = MyClass.new
=> "This could do something more useful"

The class itself in this case is responsible for it's own information. What
if you were able to set it from some other code through accessors?
some code
MyClass.users += 1
...oops, my code died, i didn't have the chance to remove myself as a user
...worse yet, i maxed the connections to the MyClass and it's not creating
new instances from other people's code.

Hope that makes some sense.

-Charley



On 5/14/07, aidy lewis <[EMAIL PROTECTED]> wrote:


On 14/05/07, Charley Baker <[EMAIL PROTECTED]> wrote:
> class LoginInput
>   @@user_name = "Vipul.Goyal"
>
>   def LoginInput.user_name
> @@user_name
>   end
> end
>
> puts LoginInput.user_name
> => "Vipul.Goyal"
>
> # Now with instance:
> class LoginInput
>   @@user_name = "Vipul.Goyal"
>
>   def user_name
> @@user_name
>   end
> end
>
> l = LoginInput.new
> puts l.user_name
> => "Vipul.Goyal"

Hi Charley,

I looked at this http://www.rubycentral.com/book/tut_classes.html and
it seems to validate the structure of your code. My question then is;
does Ruby not allow short-cut accessor methods (attr_reader,
attr_writer, attr_accessor) for class variables? And if so, why are
they created and used only for instance variables?

cheers

aidy
___
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] reading cell data into an array

2007-05-14 Thread Charley Baker

Can you give us an example of some of the data in the cell you're trying to
collect into an array? You should be able to do something like splitting it
into different strings possibly, depends on what you're getting from your
cell.

-Charley

On 5/12/07, Tunde Jinadu <[EMAIL PROTECTED]> wrote:


Hi,

I'm looking to read the data from a spreadsheet cell into an array, a
series of five digits.
I need data in an array to enable me read the values according to a random
prompt for two of the five digits that will be in the array with respect to
their positions in the array.
The problem I have is the data/values captured from the cell are indexed
as one group, not distinct values... any help will do in achieving indexing
a number of digits from an individual spreadsheet cell into an array and
each digit referenced.
thanks.

--
The second half of a man's life is made up of nothing but the habits he
has acquired during the first half.
  - Fyodor Dostoevsky
___
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] length not recognized for array within a class

2007-05-14 Thread Charley Baker

Hi there,

In this case you've created @aObjects as a class instance variable, which
means it's not visible to instance methods. Add a constructor to set it up
instead:

class CLWindow

 def initialize
   @aObjects = Array.new
 end

 def add_object
puts @aObjects.length
 end

end

cl = CLWindow.new
cl.add_object
=> 0

Also watch out in your getObject method, it looks like you're using aObjects
- which will now be a local method variable - instead of @aObjects.

-Charley

On 5/14/07, reinier <[EMAIL PROTECTED]> wrote:


Hi all,

I receive an error stating that the method 'length' is not recognized. I
am using it at an array that exists within a class.
The error occurs at the line stating: nLength = @aObjects.length within
the method of addObject(object)

I think that it doesn't see @aObjects as an array, but I can't figure out
why.
Any help?

Code:
class CLWindow
@strWindowName
@aObjects = Array.new

def setWindowName(windowname)
@strWindowName = windowname
end
def getWindowName()
return @strWindowName
end
def addObject(object)
nLength = @aObjects.length
@aObjects.insert(nLength, object)
end
def getObject(strName, strType, strFysDes)
i = 0;
if (strName!='') then
while
(aObjects[i].getObjectName()!=strName)and(i<=aObjects.length)
i=i+1
end
else
if (strType!='') then
while
(aObjects[i].getObjectType()!=strType)and(i<=aObjects.length)
i=i+1
end
else
if (strFysDes!='') then
while
(aObjects[i].getFysicalDescription()!=strFysDes)and(i<=aObjects.length)
i=i+1
end
else
return -1
end
end
end
if (i>aObjects.length) then
return -1
else
return aObjects[i]
end
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] Solution for FAQ "Using key/value pairs" not working

2007-05-14 Thread Charley Baker

Ah,  you're using a class variable and you have no accessor methods so it's
only available to . You'll need to add a class accessor or an instance
method if you're creating object of type LoginInput to get at the value:

class LoginInput
 @@user_name = "Vipul.Goyal"

 def LoginInput.user_name
   @@user_name
 end
end

puts LoginInput.user_name
=> "Vipul.Goyal"

# Now with instance:
class LoginInput
 @@user_name = "Vipul.Goyal"

 def user_name
   @@user_name
 end
end

l = LoginInput.new
puts l.user_name
=> "Vipul.Goyal"



-Charley

On 5/14/07, aidy lewis <[EMAIL PROTECTED]> wrote:


>On 14/05/07, Vipul <[EMAIL PROTECTED]> wrote:

> class LoginInput
>@@userName = "Vipul.Goyal"
>  end


> $ie.text_field(:id,"txtLoginID").set(LoginInput.userName)


I think the OO idea is that the client should not be able to directly
access a variable outside a class.


class Login_Input
  attr_reader :user_name
  def initialize
@user_name = "Vipul.Goyal"
  end
end

login_input = Login_Input.new
p login_input.user_name


Though, I would be interested in other opinions on this.


aidy
___
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] Unable to load watir/contrib/enabled_popup

2007-05-11 Thread Charley Baker

Where are you running the last command from and where is your watir gem?

open up irb at the command line and type the following:
irb>require 'watir'
irb>puts Watir::IE::VERSION

My guess is it's still 1.4 something.  Exit irb and type this:
gem list --local watir

or check your path, at the command prompt type
set path

Perhaps you're refering to a different ruby install on your path?

These are my best guesstimates and troubleshooting guidelines.

-Charley

On 5/11/07, Kui Zhang <[EMAIL PROTECTED]> wrote:


Thanks charley!

Here is what I did:
1. Uninstall Watir 1.4
2. Uninstall Ruby
3. Restart machine
4. Install Ruby
5. gem install --local watir to install gem 1.5

After restart machine, I still see the same error.  Did I miss something?

Kui
___
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] Unable to load watir/contrib/enabled_popup

2007-05-11 Thread Charley Baker

looks like you didn't uninstall watir 1.4.1, the error is coming from
site_ruby where that's installed. Uninstall Watir 1.4.1 and try it again.

-c

On 5/11/07, Kui Zhang <[EMAIL PROTECTED]> wrote:


Hello,

After I installed watir-1.5.1.1164.gem, I still see this error
message:c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require': no such file to load -- enabled_popup (LoadError).

Need help.

Thanks!
Kui
___
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] Running test script once for each datarow in excel

2007-05-11 Thread Charley Baker

David Brown posted an interface to Excel on the Watir user contributions
area with an example usage case that steps through rows:
http://wiki.openqa.org/display/WTR/Excel+interface+class

-Charley

On 5/11/07, Vipul <[EMAIL PROTECTED]> wrote:


i am testing a site which has login page.

i want to automate login with different user credentials each time.

i want username and pwd values to come from excel sheet or input.rbwhichever 
possible.

Does anyone has the code or suggestion for implementing this.
___
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] Solution for FAQ "Using key/value pairs" not working

2007-05-11 Thread Charley Baker

Looks like user_Name is not defined for your LoginInput class. Check your
casing and make sure it exists there. Might be something like user_name, not
user_Name. Otherwise we'd have to have more information on your LoginInput
class.

-Charley

On 5/11/07, Vipul <[EMAIL PROTECTED]> wrote:


now i am getting following exception

'undefined method `user_Name' for LoginInput:Class (NoMethodError)'

in main source file contains the code

require 'Input.rb'
$ie = IE.new()
$ie.goto(test_site)
$ie.text_field(:id,"txtLoginID").set(LoginInput.user_Name)
___
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 Data types exported from excel

2007-05-09 Thread Charley Baker

You're converting it to an integer with to_i. Pull the string and do what
you want with it, integers don't have a leading 0, strings do. Unless anyone
has a better idea, you'd be better off working with the basic string
yourself and converting it.

-c

On 5/9/07, Tunde Jinadu <[EMAIL PROTECTED]> wrote:


I'm running a script to read data from a spreadsheet using the following
script

# open the spreadsheet and get the values
excel = WIN32OLE::new('excel.Application') # define the type of
application to connect too
workbook = excel.Workbooks.Open('d:\Smoke_Test2.xls') # spreadsheet
location
worksheet = workbook.Worksheets(1) #get hold of the second worksheet
worksheet.Select  #bring it to the front -need sometimes to run
macros, not for working with a worksheet from ruby
range=worksheet.range("a1", "bw50") # range of spreadsheet
#~ excel['Visible'] = false #make visible, set to false to make
invisible again. Don't need it to be visible for script to work


the value I am picking out of the spreadsheet is a number



using the following

ie.text_field
(:id,/AccountNumber/).set(spreadsheetdata[:'accountnumber'].to_i)

when the script enters data into the field it attempts to enter data as
follows .0 (decimal place materialises.)

I think ruby changes the format of the number 111 extracted from the
spreadsheet from an integer as specified using .to_i to another format
(hence the decimal place being displayed in the form field) How can I ensure
the format of the data extracted from excel stays as an integer or text,
allowing a leading zero as '0111' or ''








--
The second half of a man's life is made up of nothing but the habits he
has acquired during the first half.
  - Fyodor Dostoevsky
___
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] Community involvement with Watir

2007-05-09 Thread Charley Baker

I'm all for a Why style guide. His surreal style sucks more people in than
if it was a plain old manual. Maybe a donut eating platypus instead of
foxes. :)

-c

On 5/9/07, Bret Pettichord <[EMAIL PROTECTED]> wrote:


Željko Filipin wrote:
>
> Watir user guide can have "enterprise look", but I would also like to
> create one version with cartoon characters. I am sure there are lots
> of creative people here and I hope they will show their creativity. If
> you would not like to see cartoon characters in Watir user guide,
> please do let me know, I will not put it at Watir Wiki. (I will put it
> at my blog and smile to my jokes. Alone.)
>
Chunky Bacon!
___
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] Having trouble capturing text in java alert

2007-05-09 Thread Charley Baker

w = WinClicker.new
text =  w.get_static_text('Microsoft Internet Explorer') # returns an array
for each static control
text.each {|t| puts t}


-Charley

On 5/9/07, gary <[EMAIL PROTECTED]> wrote:


Hi everyone,

I'm having difficulty in capturing the text from a java alert, and would
appreciate anyones input.

Using AutoIT, for the pop up window works a treat, allowing me to capture
the text, and then select the OK button to proceed with the script:

require 'watir'   # the controller
include Watir
require 'watir/WindowHelper'
require 'test/unit'
require 'test/unit/ui/console/testrunner'
require 'dl/win32'

class TC_recorded < Test::Unit::TestCase

def check_for_popups
autoit = WIN32OLE.new('AutoItX3.Control')
  loop do
  sleep(3)
  ret = autoit.WinWait('Security Information', '', 1)
  text = autoit.WinGetText('Security Information', '')
  if (ret==1)
  puts text
  else
  puts "where is it?"
  end
  if (ret==1) then autoit.Send('{Yes}') end
  sleep(2)
  end
end


  def test_1
  @IE0 = IE.new
  @IE0.set_fast_speed
  @IE0.goto("
http://hmvdigital.co.uk/HMV.Digital.OnlineStore.Portal/Pages/Home.aspx";)
  @IE0.link(:text, "Sign in").click

  @popup = Thread.new { check_for_popups }  # start popup handler
  @IE0.link(:href, "
https://hmvdigital.co.uk/HMV.Digital.OnlineStore.Portal/Pages/HelpPopup.aspx?category=Managing_your_account&link=AboutRememberMe
").click
  Thread.kill(@popup) # end popup handler

  @IE0.close
  end
end

Unfortunately I have been unable to use AutoIt in dealing with an alerts,
and have been using winClicker. I am able to select the OK button to
proceed, but unable to capture any text:

require 'watir'   # the controller
include Watir
require 'watir/WindowHelper'
require 'test/unit'
require 'test/unit/ui/console/testrunner'
require 'dl/win32'
require 'watir/winClicker'

class TC_recorded < Test::Unit::TestCase

  def startClicker( button , waitTime = 3)
  w = WinClicker.new
  longName = @IE0.dir.gsub("/" , "\\" )
  shortName = w.getShortFileName(longName)
  c = "start ruby #{shortName }\\watir\\clickJSDialog.rb #{button }
#{waitTime} "
  puts "Starting #{c}"
  w.winsystem(c)
  w=nil
  end

  def test_1
  @IE0 = IE.new
  @IE0.set_fast_speed
  @IE0.goto("www.hmv.co.uk")
  @IE0.link(:text, "Sign In").click
  startClicker("OK" , 3)
  @IE0.image(:alt, "continue").click
  @IE0.close
  end
end

As previously mentioned, any help would be greatly appreciated, many
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

Re: [Wtr-general] Wtr-general Digest, Vol 42, Issue 14

2007-05-08 Thread Charley Baker

Not to be too blunt, butinstall facets >= 1.8.54. gem install facets

-c

On 5/8/07, Russ DeWolfe <[EMAIL PROTECTED]> wrote:


Here is the message I get when I attempt to install this gem:

ERROR:  While executing gem ... (RuntimeError)
Error instaling unroller:
unroller requires facets >= 1.8.54

NOTE: I DID install the win32console gem


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

Re: [Wtr-general] Remote Watir

2007-05-08 Thread Charley Baker

Bill Agee uploaded a rails app to run tests remotely, it's in the user
contributions area on the wiki:

http://wiki.openqa.org/display/WTR/Rails+test+runner+example+app

-Charley

On 5/7/07, Paul Rogers <[EMAIL PROTECTED]> wrote:


drb might be what you want.
Also search the list here - someone posted a link to a library that might
be
more like what you want. I wish I could remember who/what/when to help
narrow your search

- Original Message -
From: "Aaron" <[EMAIL PROTECTED]>
To: 
Sent: Monday, May 07, 2007 2:20 PM
Subject: [Wtr-general] Remote Watir


>I am in the process of switching our test environment from Selenium to
>Watir.
> So, I am a newb with respect to Ruby and Watir.
>
> Is there any thing in Watir or inherent in Ruby that would mimic the
> capability of "Selenium Remote Control"?
>
> In particular, we have a room full of Windows boxes with various flavors
> of IE.
>>From one central Linux box, we want to execute tests on all of the
Windows
>>boxes concurrently.
> This was trivial to do with the Selenium Remote Control server but I
have
> found nothing similar for Ruby/Watir yet.
>
> Any ideas, or do I have to write my own proxy server in ruby to remotely
> execute scripts and return results?
>
> 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

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

[Wtr-general] Community involvement with Watir

2007-05-04 Thread Charley Baker

Hi all,

I'd like to send out another annoucement asking for people to contribute to
the Watir user guide and volunteer. I've started poking around at the user
guide today and made a few changes, notably to update view source with the
ie developer toolbar. I'll make further changes if as I get time, but am
making the call for volunteers to add information and help out, much of
which is related to Watir 1.5. Let me know if you're interested in helping
out.

 I'll also suggest helping out on the lists or whereever you think you
might be useful. If you've worked with  Ruby or Watir for more than a couple
of days, you're a couple of days ahead of the next person and can provide
some knowledge, don't be afraid to be wrong, jump in. Additionally there is
a section on the wiki for user contributions as you write code that might be
useful to other people. This is an open source project that depends on
community involvement.

(Starting to sound like a pbs pledge drive).

Thanks,

Charley
___
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 Charley Baker

It's a curious bug, just saw the same thing. A bug/feature, works more than
it should. :) Chris is right we should definitely spend more time with
Angrez, Prema and the Firewatir community. I'm getting slammed by requests
for multiple browser tests and starting to abstract layers so that it's
easier.

-c

On 5/4/07, Chris McMahon <[EMAIL PROTECTED]> wrote:


> 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

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

Re: [Wtr-general] Setting focus in a frame in IE7

2007-05-04 Thread Charley Baker

I just ran the same code with IE7 and it appeared to work fine. Just out of
curiosity why use send_keys instead of setting the text field?

ie.text_field(:index, 1).set('foo')

-Charley

On 5/4/07, Paul Rogers <[EMAIL PROTECTED]> wrote:


Assuming your html uses regular type html


and you only want to test that the text field only allows 3 chars, why not
use
ie.text_field(:index,1).maxLength


I guess if the maximum length is imposed by a javascript method on the
onKeyPress event, then this wouldnt work.

As to why your code no longer works, I have no clue ;-)

- Original Message -
From: "Trevor Mason" <[EMAIL PROTECTED]>
To: 
Sent: Friday, May 04, 2007 9:48 AM
Subject: [Wtr-general] Setting focus in a frame in IE7


>I have a test that used to work on IE6(WIN2k), but does not with
IE7(WINXP)
> I am using send_keys to send 4 chars to a text field that has a maximum
> length of 3, then checking there are only 3 chars
>
> In IE7, the focus does not move from the IE address bar, and I get 
> placed here.
> If I use IRB and manually click somewhere within the frame before
running
> these commands, it works!
>
> $ie.frame("mainFrame").frame("centralFrame").text_field(:name,
> 'privateDataDescriptor').focus
> $ie.send_keys("")
>
> Does anyone have any ideas?
>
> Trevor
> ___
> 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 + Autoit + Save As

2007-05-04 Thread Charley Baker

It looks fine, you might however have to use ControlFocus to make sure the
control has focus before attempting to click on it.

autoit.ControlFocus("Enregistrer sous", "", "&Enregistrer")
autoit.ControlClick("Enregistrer sous", "Enregistrer &dans :",
"&Enregistrer")

-Charley

On 5/4/07, Maisonnette <[EMAIL PROTECTED]> wrote:


Hi everyone,

Do you know how can i use watir to 'pilot' a 'save as' internet explorer
form ?
I already found this code :
-

*autoit = WIN32OLE.new("AutoItX3.Control")*
*autoit.WinWait("Téléchargement de fichier", "Voulez-vous ouvrir ou
enregistrer ce fichier ?", 15)*
*autoit.ControlClick("Téléchargement de fichier", "", "Button2")*
*autoit.WinWait("Enregistrer sous", "Enregistrer sous", 15)*
*autoit.ControlSetText("Enregistrer sous", "Enregistrer &dans :",
"Edit1", "c:\test.zip")*
*autoit.ControlClick("Enregistrer sous", "Enregistrer &dans :",
"&Enregistrer")*

-

The line number 1 : Return 1
The line number 1 : Return 1
The line number 1 : Return 1
The last one return 0

And with this code i got the focus on the 'save as'(Enregistrer sous)
button ... I really don't understand why i can't click on it because the
'ControlClick' function is build to do that !

:-) Any help will be highly appreciated ! :-)

Some complementary informations :
-

+http://rubyforge.org/tracker/index.php?func=detail&aid=2467&group_id=104&atid=490+
+http://www.autoitscript.com/autoit3/docs/functions.htm+
+WinXp Sp2 (French)+
+ruby 1.8.5 (2006-08-25) [i386-mswin32]+
+watir-1[1].5.1.1145 (gem)+
___
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] can you help why ODBC connection failure worked one time and not working no

2007-05-04 Thread Charley Baker

What's the warning message?

On 5/4/07, Venkata <[EMAIL PROTECTED]> wrote:


Thanks chareley,

  i keep getting warning message in the log end of te script execution.

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

Re: [Wtr-general] can you help why ODBC connection failure worked one time and not working no

2007-05-03 Thread Charley Baker

i'm not sure why you'd worry about garbage collection. if you want to,
there's a ruby gc library where you can explicity clean it up.

-c

On 5/3/07, Venkata <[EMAIL PROTECTED]> wrote:


Thanks and it worked. i did not notice that i put caps.

thansk for answering all these issues. How to clean the Garbage collection
through our script.


Thanks you very much.
___
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] can you help why ODBC connection failure worked one time and not working no

2007-05-03 Thread Charley Baker

I'm not familiar with any ODBC library. You should use DBI if you want to go
this route which in turn has an ODBC driver.

http://www.kitebird.com/articles/ruby-dbi.html

-Charley

On 5/3/07, Venkata <[EMAIL PROTECTED]> wrote:


helo all,

   I am trying to connect to SQL server through ODBC.

Steps
1) I alreday have ODBC available.
2) Created a DSN and tested with Test connection there.
3) verified C:\IRBmain> Require 'ODBC' > true.

4) I created a scripts according to the examples.


require 'watir'
require 'ODBC'
include 'watir'
require 'Driver'

#~ # Connect to the Databse
conn = ODBC::connect('Myvalue','user','password')

#~ # get the from the table
h = conn.run("SELECT * FROM tableName where ssn = 'ssn'")


#~ # get the ecah field value and prints to the log.
h.each do |row|
puts row
end


it worked and retrieved the values one time.

Now it is not idetifying the ODBC anymore. i am getting Load error.

ruby DBconnect.rb
c:/ruby/lib/ruby/site_ruby/1.8/i386-msvcrt/ODBC.so: 127: The specified
procedure could not be found.
- Init_ODBC (LoadError)
c:/ruby/lib/ruby/site_ruby/1.8/i386-msvcrt/ODBC.so  from
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
from DBconnect.rb:2




Please can you help me.

do i have to disconnect? if it is please tell me how May be

ODBC::disconnect ?

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

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

2007-05-03 Thread Charley Baker

I'm starting to sound like a broken record and was just thinking about
updating the user guide for this. Use the ie developer toolbar to find
controls and identify them, while being familiar with the html source and
some basic knowledge around the dom is important, this will also help:

http://www.microsoft.com/downloads/details.aspx?familyid=E59C3964-672D-4511-BB3E-2D5E1DB91038&displaylang=en

-Charley

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

Re: [Wtr-general] How do I connect to MS SQL 2005 using Ruby?

2007-05-03 Thread Charley Baker

This is straight ruby and dbi, take a look at this link:
http://www.kitebird.com/articles/ruby-dbi.html

-c

On 5/3/07, Venkata <[EMAIL PROTECTED]> wrote:


Charley,

   Do you have an example Test script executing SQL from water - ruby.
please can you attach that.

I need as soon as possible.

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

Re: [Wtr-general] 'Unable to locate object' problem

2007-05-03 Thread Charley Baker

Hi,

 Please edit responses to refer to the original header and not the digest
header. I missed the fact that the src attribute is pointing to textarea,
it's not a text control. Try using IE developer toolbar to find the control
and some sort of identifiable attribute - name, id, index. Then use that to
set it in Watir.

http://www.microsoft.com/downloads/details.aspx?FamilyID=E59C3964-672D-4511-BB3E-2D5E1DB91038

-Charley

On 5/3/07, Imran Hussain <[EMAIL PROTECTED]> wrote:


Hi Charley,

Thanks for the info but it still doesn't work, I now get the following
error:

c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3388:in `method_missing': focus
(WIN32OL
ERuntimeError)
OLE error code:800A083E in htmlfile
  Can't move focus to the control because it is invisible, not
enabled, or o
f a type that does not accept the focus.
HRESULT error code:0x80020009
  Exception occurred.   from
c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:338
8:in `set'


Thanks,
Imran


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

Re: [Wtr-general] 'Unable to locate object' problem

2007-05-02 Thread Charley Baker

You're trying to write to what appears to be a frame not the textarea.

ie.text_field(:name, 'SN_NOTESSText').set('this should work')



-Charley


On 5/2/07, Imran Hussain <[EMAIL PROTECTED]> wrote:


Hi,

'Unable to locate object' problem

When running the following show_all_objects command, I get;

rb(main):016:0> ie.show_all_objects
---Objects in  page -
HTML Document name=   id=SN_NOTESSFrame   src=
textarea  name=SN_NOTESSText  id= value=

How do I write to this object? do I use this:

ie.text_field(:id ,"SN_NOTESSFrame").set("TESTING 1234")

Is this within a frame??
This doesn't seem to be working  can someone help?

Thanks,
Imran



___
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] Error when loading iframe

2007-05-02 Thread Charley Baker

Try running the latest code from svn, there've been some changes around
dealing with frame access errors. Follow this link for the instructions:
http://wiki.openqa.org/display/WTR/FAQ#FAQ-devgem

-Charley

On 5/2/07, John <[EMAIL PROTECTED]> wrote:


Hi,

When you click on a link in my website an iframe is loaded in the middle
of the page. It seems watir has trouble with it, because it gives an error
(see below). I use this to click on the link: $ie.link(:url,
/club_philips_streamium_management/).click
It then returns this error:

irb(main):011:0> ie.link(:url, /club_philips_streamium_management/).click
WIN32OLERuntimeError: document
OLE error code:80070005 in 
  Access is denied.

HRESULT error code:0x80020009
  Exception occurred.
from C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:1830:in
`method_missing'
from C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:1830:in
`wait'
from C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:1829:in
`times'
from C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:1829:in
`wait'
from C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:2577:in
`click'
from (irb):11
___
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] Can Watir be paused & resumed manually when running test cases?

2007-05-01 Thread Charley Baker

 I'd highly second that. It's small simple and breaks you out where you
want to be to inspect your current state through irb. It's been dropped and
ruby-debugger is the newer project, but since I haven't had a need for much
else, I haven't looked at ruby-debugger yet. The ruby eclipse plugin also
has debugging facilities, but since I don't run through Eclipse but by
command line, I can't say too much about it, other than it's your basic ide
debugger.

-Charley

On 5/1/07, Bret Pettichord <[EMAIL PROTECTED]> wrote:


Željko Filipin wrote:
> For more functionality, see ruby-breakpoint
> (http://rubyforge.org/projects/ruby-breakpoint/
> ) or ruby-debug
> (http://rubyforge.org/projects/ruby-debug/). I have not used them, but
> I have read at this list that ruby-breakpoint can pause and then
> resume ruby script.
I use ruby-breakpoint all the time. I strongly recommend that all Watir
users take a look at this. It is a great tool for debugging scripts. In
my view it is actually what people want when they say they want a
debugger.

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] Unable to locate object

2007-04-30 Thread Charley Baker

Yep, we still include autoit.

-c

On 4/30/07, Kui Zhang <[EMAIL PROTECTED]> wrote:


Hi Charley,

Follow your instruction, installed the latest Watir gem.  It works now!

One question, if I installed the Watir gem, does this include autoit which
I need to use in the testing?  Or how to check if the autoit is installed
with Watir?

Thanks so much for your help.

Kui
___
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] Unable to locate object

2007-04-30 Thread Charley Baker

Install the latest gem for Watir 1.5.1 and try it again if you can . Here's
a link for how to do just that:
http://wiki.openqa.org/display/WTR/Development+Builds

Follow the instructions on the right pane To Install.

-Charley

On 4/30/07, Kui Zhang <[EMAIL PROTECTED]> wrote:


Thanks Charley for the quick response!
I tried with your suggestion (ie.button(:text, �Login�).click) and still
received the same error message.

Here is DOM for the login button.  I also tried with the ie.form(:name,
�mainForm�).button(:text, �Login�).click.  Not working.  Anything I can try?

Really appreciate your help!
Kui



http://benicia.guidewire.com:10402/cc402/ClaimCenter.do";
method="post">

Login



___
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 unzip the zip file using watir/ruby script

2007-04-30 Thread Charley Baker

There's rubyzip library on sourceforge.net which you might look into:
http://sourceforge.net/projects/rubyzip

-Charley

On 4/28/07, jhe <[EMAIL PROTECTED]> wrote:


 Dear all,



I want to extract the content from the winzip file by water/ruby script,
which of the following command could achieve the goal,

exec,  syscall, system, or anything else?



Thanks in advance.

Jason



___
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] Unable to locate object

2007-04-30 Thread Charley Baker

smokeid means nothing in standard dom. You can use :text to identify the
control. Watir works off of standard html attributes and the DOM, this is
some sort of custom attribute. This should work.

ie.button(:text, 'Login').click

-Charley

On 4/30/07, Kui Zhang <[EMAIL PROTECTED]> wrote:


Hello,

I just started to write a test script below.  When run the script, I
always received  error message:
C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1928:in `assert_exists': Unable to
locate object.  HTML source is attached.

What did I missing here?  Should I be able to use smokeId to identify the
elements?  Please help.

Thanks!
Kui

require 'watir'

test_site = 'http://x'

ie = Watir::IE.new

ie.goto(test_site)

sleep(5)

ie.text_field(:label, "Username").set("aa")
ie.text_field(:text, "Password").set("bb")

ie.button(:smokeId, "submit").click


Source:
 Username
 Password
 Login
___
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 - Scrpting issues with Dynamic HTML

2007-04-30 Thread Charley Baker

This is the id I got off of that control in your menus using ie developer
toolbar:

http://www.microsoft.com/downloads/details.aspx?familyid=e59c3964-672d-4511-bb3e-2d5e1db91038&displaylang=en

Watir works off of how and what. How would you like to access a dom element?
What can you use to identify it?

ie.div(:how, 'what').click

In this case the how is :id and the what is the string. Clicked on the menu
and refreshed the toolbar, find element by click and clicked on the open
menu item.

We should probably add examples like this to the User Guide.

-Charley

On 4/30/07, annapurna <[EMAIL PROTECTED]> wrote:


Charley,

where did you captured this info. 'STM0_0__5___

can you explain to how to do it.

thanks,
anna
___
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 - Scrpting issues with Dynamic HTML

2007-04-30 Thread Charley Baker

The main dhtml menu is pretty straighforward using Watir 1.5.1:

require 'watir'
include Watir

ie = IE.start('http://www.ceridian.com/')
ie.table(:id, 'STM0_0__5___').fire_event('onmouseover')
ie.cell(:id, 'STM0_5__1___MTD').click

-Charley

On 4/30/07, Paul Rogers <[EMAIL PROTECTED]> wrote:


not really,

I dont want to have to go through all the stuff on your web site.

I'm happy to try and help, but I need to see the HTML you are trying to
access, the code you are using, and any exceptions that occur

Paul

- Original Message -
From: Anna <[EMAIL PROTECTED]>
Date: Monday, April 30, 2007 11:18 am
Subject: Re: [Wtr-general] Watir - Scrpting issues with Dynamic HTML

> paul,
>
> Example website is --> www.ceridian.com
> >From there we have DHTML menus available. you can pick any menu
> items. i hope this helps to direct me.
>
> Thanks,
>
> Anna
> ___
> 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] Cannot run example test case

2007-04-30 Thread Charley Baker

Are you getting anything if you run through irb?

Open a command prompt type
irb

in irb type

require 'watir'
include Watir

ie = IE.new


Anything happen?

-Charley

On 4/27/07, Kui Zhang <[EMAIL PROTECTED]> wrote:


Hello,

I just installed ruby 186-35 and Watir 1.4.1 on windows Xp.  Following the
instruction to run example test case from the command line, IE browser is
not open, the cursor just blinking with nothing displayed in the command
window.

Please help!
Kui
___
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] HELP----Re: how to click on a image with this HTML code

2007-04-30 Thread Charley Baker

Try clicking on the div instead which is where the onclick event lives:

ie.div(:id, 'Research').fire_event('onclick')

-Charley

On 4/29/07, SHALINI GUPTA <[EMAIL PROTECTED]> wrote:


HELLO TO ALL,

PLEASE HELP ITS VERY URGENT..

REGARDS
SHALINI GUPTA

On 4/30/07, SHALINI GUPTA < [EMAIL PROTECTED]> wrote:
>
> Hi all,
>
> I have a problem in my project to click on a  image.
> which has this HTML Code:-
>
> 
>  
>
> i have tried to click this as:-
> $ie.image(:src,"../Images/nav_research.png").click
> and
> $ie.image(:id,"research").click
>
> but both of this generate this error:-
>
> 1) Error:
> test_WEBV2_RR(TC_WEBV2_RR):
> Watir::Exception::UnknownObjectException: Unable to locate object, using
> src and ../Images/nav_research.png
> c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1928:in `assert_exists'
> c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2009:in `click'
> r_n_d.rb:44:in `assert1'
> r_n_d.rb:31:in `start'
> r_n_d.rb:34:in `test_WEBV2_RR'
>
> please help me..
>
> how can i click this..
> its urgent
>
> thanks in advance
>
> Regards
> Shalini Gupta
>


___
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] Does watir support file download?

2007-04-26 Thread Charley Baker

You might check into the image download in Watir 1.5.1: Image::save and
Image::fill_save_image_dialog

I've not had to do this but it shouldn't be too challenging through either
AutoIt or winclicker.

-c

On 4/25/07, jhe <[EMAIL PROTECTED]> wrote:


 Dear all,



Is there a way to download file and save it to hard disk?



Thanks in advance.

Jason



___
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] Can Watir do - verify the file opened in PDF or Excelfrom?

2007-04-26 Thread Charley Baker

 Since you're already familiar with Java and using that for your Selenium
RC tests, I'd recommend you stick to that route. There are some java
libraries for reading pdfs as well as likely excel and word files, search on
google, I'd recommend the same for interacting with the Windows dialog which
must be possible in Java, there's also a java to com bridge library called
Jacob which you might look into: http://danadler.com/jacob/

My take is to stay with your current structure unless there's sufficient
reason to introduce Watir.

-Charley


On 4/26/07, Paul Rogers <[EMAIL PROTECTED]> wrote:


if you have the professional version of acrobat, not the downloadable
reader, you can use ole to access it

http://www.adobe.com/devnet/acrobat/pdfs/iac_developer_guide.pdf

I havent read through to see if its possible to extract the text though

- Original Message -
From: "Paul Rogers" <[EMAIL PROTECTED]>
To: 
Sent: Thursday, April 26, 2007 2:43 PM
Subject: Re: [Wtr-general] Can Watir do - verify the file opened in PDF or
Excelfrom?


> excel and word should be easy enough - watir doesnt do it directly, but
> there are plenty of posts out there to guide you through using the ole
> interface into word/excel from Ruby
>
> I dont know how you would do it for pdf though
>
> Paul
>
> - Original Message -
> From: "Kui Zhang" <[EMAIL PROTECTED]>
> To: 
> Sent: Thursday, April 26, 2007 2:25 PM
> Subject: [Wtr-general] Can Watir do - verify the file opened in PDF or
> Excelfrom?
>
>
>> Hello Watir exporters,
>>
>> I am using selenium RC testing tool writing in JAVA to automate the
test
>> cases. I can automate everything in web browser. But the web
application
>> does file download or open file in Acrobat Reader, Word or Excel.  Once
>> the no web Download file window is open, or view file open in
Word/Excel,
>> I could not using selenium to do anything with the files or windows. I
>> need to do the followings with these windows:
>>
>> Enter the file name to download and click OK
>>
>> Make sure the PDF window is open, verify text in the PDF file, and
close
>> the file
>>
>> Make sure the Excel window is open, verify data in the worksheet, and
>> close the file
>>
>> Can Watir handle these cases?
>>
>> Thank you for your help!
>> Kui
>> ___
>> 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

___
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 Charley Baker

Why's Poignant Guide is excellent. It takes learning to program to a new and
otherwise other worldly angle. I've been recommending it, you'll either love
it or hate it. It'd be nice to work on his basic conceptual view and present
a basic programming using Ruby class, wearing bunny suits of course.

-c

On 4/25/07, Bret Pettichord <[EMAIL PROTECTED]> wrote:


Here is what looks like a very useful tool for learning Ruby. This is from
the author of Why's Poignant Guide to Ruby.

http://hacketyhack.net/
http://code.whytheluckystiff.net/hacketyhack/wiki/GetHacketyHack

Bret

-- Forwarded message --
From: why the lucky stiff <[EMAIL PROTECTED]>
Date: Apr 25, 2007 3:38 PM
Subject: + Hackety Hack +
To: [EMAIL PROTECTED], [EMAIL PROTECTED]

Friends of the (Poignant) Guide,

Any of you remember that /SECRET PROJECT/ from the beginning of March?
I needed some folks using Windows to shell out some precious time to
see if I could help them learn Ruby.

The secret project is: Hackety Hack.  It's a Windows program for
learning Ruby with lots of fun examples: downloading mp3s, writing
blogs, chatware, and so on.

AND, WELL, >>MOTHER CAREY'S CHICKENS<< IT WORKED!!

I ended up with 50 participants, about half stuck with it and we saw
some amazing progress.  I've asked the participants to blog about
their experiences, here are the first few:

* http://www.greaterbostonrubyandrails.com/HacketyHackBlog.html
* http://ostracons.com/entry/272/programmed
* http://willscott.name/2007/04/23/HacketyHack

Thankyou to the fine, fine people who applied themselves to make
this happen.  It was one of those beautiful, unforgettable times
that really changed my life!!  Truly adventure-sized!!

_why
___
poignant-stiffs mailing list
[EMAIL PROTECTED]
http://rubyforge.org/mailman/listinfo/poignant-stiffs

___
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] canoo2watir

2007-04-25 Thread Charley Baker

i think you're right about a recorder. it's been a while, but that sounds
awfully familiar.

On 4/25/07, Paul Rogers <[EMAIL PROTECTED]> wrote:


 my thinking was that people who have canoo tests can now ( ok soon )  run
those same tests on a real browser.
I also thought there was a recorder for canoo, that records from a proxy,
but I seem to be mistaken.

I'll get the code a bit better then do a proper announcement

Paul

- Original Message -
*From:* Charley Baker <[EMAIL PROTECTED]>
*To:* wtr-general@rubyforge.org
*Sent:* Wednesday, April 25, 2007 3:02 PM
*Subject:* Re: [Wtr-general] canoo2watir

Could be interesting, I'd looked at webtest when evaluating tools a while
back. And as Elizabeth Hendrickson often says...'Show me the code'. It's
always helpful and demonstrates the point pretty well and if people want to
learn or add on then it gives them a good base. Perhaps it's one other tool
than can be run under the Watir api, the others being watir:ie, firefox,
safari, selenium.

-c

On 4/25/07, Paul Rogers <[EMAIL PROTECTED]> wrote:
>
>
>
> This is something Ive been thinking about for a while.
>
> Canoo ( http://webtest.canoo.com/ ) is a layer above htmlUnit that takes
> an xml file and runs it against a web site, clicking buttons, doing
> assertions etc.
> Ive written some code that takes this xml format and converts it to a
> watir script ( well, almost )
>
> Is this likely to be of use to more than just Lisa Crispin?
>
> Paul
>
> ___
> 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

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

Re: [Wtr-general] canoo2watir

2007-04-25 Thread Charley Baker

Could be interesting, I'd looked at webtest when evaluating tools a while
back. And as Elizabeth Hendrickson often says...'Show me the code'. It's
always helpful and demonstrates the point pretty well and if people want to
learn or add on then it gives them a good base. Perhaps it's one other tool
than can be run under the Watir api, the others being watir:ie, firefox,
safari, selenium.

-c

On 4/25/07, Paul Rogers <[EMAIL PROTECTED]> wrote:




This is something Ive been thinking about for a while.

Canoo ( http://webtest.canoo.com/ ) is a layer above htmlUnit that takes
an xml file and runs it against a web site, clicking buttons, doing
assertions etc.
Ive written some code that takes this xml format and converts it to a
watir script ( well, almost )

Is this likely to be of use to more than just Lisa Crispin?

Paul

___
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 move the mouse to point to an object?

2007-04-25 Thread Charley Baker

Hmm, good question, I don't seem to be able to access it either. Thanks for
the public example, I'll look at it some more and see if I can't trigger it.


-c

On 4/25/07, joe fu <[EMAIL PROTECTED]> wrote:


i've tried to do  ie.div(:id,
"calendarStripDateLabelDock").fire_event("onmouseover")but doesn't work
for me.
you can also try it with the steps below:
goto mail.yahoo.com
enter user: f323_cal1 password: testing
mouse over the Today's date on the Calendar Strip at the bottom.









TUE, 4/24 - WED,
4/25





___
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] Get a class value

2007-04-25 Thread Charley Baker

With Watir 1.5

ie.cell(:id, 'tab.policies.WINDOWS').attribute_value('classname')

-Charley

On 4/25/07, Russ DeWolfe <[EMAIL PROTECTED]> wrote:


 I want to get the value in the class parameter of a TD tag or better yet
build an array with a bunch of them in it, but just getting this one will be
a start:

 
 Windows


___
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] Cannot get Autoit to create a simple control instance

2007-04-24 Thread Charley Baker

Try running the command regsvr32 AutoItX3.dll at the command line where the
autoit dll lives. Also make sure you have administrator rights on your
machine, otherwise it won't work correctly.

-Charley

On 4/24/07, Russ DeWolfe <[EMAIL PROTECTED]> wrote:


 I have installed AutoIT, including the dll and the autoitx active x
control and here is what I get:

irb(main):001:0> require 'win32ole'
=> true
irb(main):002:0> autoit = WIN32OLE.new('AutoItX3.Control')
WIN32OLERuntimeError: unknown OLE server: `AutoItX3.Control'
HRESULT error code:0x800401f3
  Invalid class string
from (irb):2:in `initialize'
from (irb):2:in `new'
from (irb):2

Thanks for the help

Russ

___
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: New version of RDT plugin for Eclipse

2007-04-24 Thread Charley Baker

For all of you who are working with Eclipse and the rdt plugin, there's a
new version finally. They haven't updated their main site, but have a news
announcement on their base sourceforge project page:
Most notably are the inclusion of refactorings, mark occurrences support,
improved code completion, better integration with the ruby interpreters,
ruby-debug support, go to declaration, and under-the-hood type inferrencing.

I've only used it for the past day, but it's a bit nicer than the previous
version. Also spending some time monkeying around with NetBeans and it's
coming Ruby support which I like for formatting and a couple of other
things.

Note: This version of rdt requires jre 1.5 or above to run.

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

Re: [Wtr-general] Watir and smartclient

2007-04-24 Thread Charley Baker

This is the source code, what you really want to look at is the rendered
DOM. Take a look at the controls with Microsoft Internet Explorer Developer
toolbar:
http://www.microsoft.com/downloads/details.aspx?familyid=e59c3964-672d-4511-bb3e-2d5e1db91038

This will show you the controls and any associated id, name, etc attributes
which you can then use with Watir.

-Charley

On 4/23/07, Sadeesh Vinoth <[EMAIL PROTECTED]> wrote:


Hi Angrez,

Please find the source of web page developed using smartlcient,
Please let me know weather watir can be used for this.

Source.





SmartClient SDK - Component Data Binding example
window.isomorphicDir='../../isomorphic/';
isc._lastModule='Core';
isc._lastModule='Foundation';
isc._lastModule='Containers';
isc._lastModule='Grids';

isc._lastModule='Forms';
isc._lastModule='DataBinding';





// load datasources
isc.DataSource.create({
serverType:"sql",
fields:{
itemID:{primaryKey:true, hidden:true, type:"sequence",
name:"itemID"},
itemName:{
title:"Item",
required:true,
type:"text",
length:128,
name:"itemName"
},
SKU:{
title:"SKU",
required:true,
type:"text",
length:10,
name:"SKU"
},
description:{
title:"Description",
type:"text",
length:2000,
name:"description"
},
category:{
title:"Category",
required:true,
type:"text",
length:128,
foreignKey:"supplyCategory.itemName",
name:"category"
},
units:{
title:"Units",
valueMap:["Roll", "Ea", "Pkt", "Set", "Tube", "Pad", "Ream",
"Tin", "Bag", "Ctn", "Box"],
type:"enum",
length:5,
name:"units"
},
unitCost:{
title:"Unit Cost",
required:true,
type:"float",
validators:[
{
type:"floatRange",
min:0,
errorMessage:"Please enter a valid (positive) cost"
},
{
type:"floatPrecision",
errorMessage:"The maximum allowed precision is 2",
precision:2
}
],
name:"unitCost"
},
inStock:{title:"In Stock", type:"boolean", name:"inStock"},
nextShipment:{title:"Next Shipment", type:"date",
name:"nextShipment"}
},
tableName:"supplyItem",
testFileName:"supplyItem.data.xml",
ID:"supplyItem"
})

isc.DataSource.create({
serverType:"sql",
fields:{
Name:{
title:"Name",
type:"text",
length:128,
name:"Name"
},
EmployeeId:{title:"Employee ID", primaryKey:true, required:true,
type:"integer",
name:"EmployeeId"},
ReportsTo:{title:"Manager", required:true, type:"integer",
rootValue:"1",
   foreignKey:"employees.EmployeeId",name:"ReportsTo"},
Job:{
title:"Title",
type:"text",
length:128,
name:"Job"
},
Email:{
title:"Email",
type:"text",
length:128,
name:"Email"
},
EmployeeType:{
title:"Employee Type",
type:"text",
length:40,
name:"EmployeeType"
},
EmployeeStatus:{
title:"Status",
type:"text",
length:40,
name:"EmployeeStatus"
},
Salary:{title:"Salary", type:"float", name:"Salary"},
OrgUnit:{
title:"Org Unit",
type:"text",
length:128,
name:"OrgUnit"
},
Gender:{
title:"Gender",
valueMap:["male", "female"],
type:"text",
length:7,
name:"Gender"
},
MaritalStatus:{
title:"Marital Status",
valueMap:["married", "single"],
type:"text",
length:10,
name:"MaritalStatus"
}
},
tableName:"employeeTable",
testFileName:"employees.data.xml",
ID:"employees"
})

isc.DataSource.create({
serverType:"sql",
fields:{
commonName:{title:"Animal", type:"text", name:"commonName"},
scientificName:{title:"Scientific Name", primaryKey:true,
required:true, type:"text",
name:"scientificName"},
lifeSpan:{title:"Life Span", type:"text", name:"lifeSpan"},
status:{title:"Endangered Status", type:"text", name:"status"},
diet:{title:"Diet", type:"text", name:"diet"},
information:{
title:"Interesting Facts",
type:"text",
length:1000,
name:"information"
}
},
tableNam

Re: [Wtr-general] NoMethodError: undefined method `assert_equal'

2007-04-24 Thread Charley Baker

You can get the text of the window using AutoIt, in javascript popups the
text is usually in the first or second static text control:
   oPopup  = Watir::autoit
   # Change into the WinTitleMatchMode that supports classnames and
handles
   oPopup.AutoItSetOption("WinTitleMatchMode", 4)
   0.upto(timeout) { |i|
   ret = oPopup.WinWait("Window Title","",1)
   win_text = oPopup.WinGetText("Window Title")
   if 1 == ret && !(win_text == '') then
   bPopupFound = true
   oPopup.WinActivate("Window Title",'')
   win_text  = oPopup.ControlGetText(what, '',
'Static2').strip
   if '' == win_text then win_text  =
oPopup.ControlGetText(what,
'', 'Static1').strip end
   break
   end

Change Window Title to match what you're looking for, js popups can be found
by classname as well: 'classname=#32770' instead of title.

-Charley


On 4/23/07, SHALINI GUPTA <[EMAIL PROTECTED]> wrote:


Hi Ajitesh,

I am Shalini gupta.Hope u'll be fine.I am also working on watir.I  have
problem with java popups.i am able to handle that.but how to get text on
popup i dont know.please help me regarding this.Thanks in Advance.

Regards and Thanks
Shalini Gupta

On 4/23/07, Ajitesh Srinetra <[EMAIL PROTECTED] > wrote:
>
> Adding
>
> require 'test/unit/assertions'
> include Test::Unit::Assertions
>
> will help.A lot of examples for assertions is provided in unit tests
> examples .Please follow them in your testcases
>
> Ajitesh
>
>
>
> ___
> 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 T-shirt

2007-04-23 Thread Charley Baker

Good idea, I'd buy one and agreed the code should actually work. :) It's
only dev code that doesn't work. :P

-c

On 4/23/07, Paul Rogers <[EMAIL PROTECTED]> wrote:



I hope you try the code before making the t-shirts ;-)
- Original Message -
From: Jason <[EMAIL PROTECTED]>
Date: Monday, April 23, 2007 4:48 pm
Subject: [Wtr-general] Watir T-shirt

> 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 would like to have a Watir t-shirt to spread the word about
> Watir.  We can put these up on the website for people to purchase
> them.  Here is what I envision- You will have a choice of either a
> black or white t-shirt (both short-sleeve and long-sleeve).  On
> the front we can have the Watir logo on the left breast area, and
> on the back a block of code.  I created this class below as a
> possible example.
>
> require Watir
>
> class TC_future_of_automated_test_testing
>
>def test_Watir_is_the_test_tool_of_the_future
> ie.goto(@start_page)
> assert_equal('Watir- The Future of Automated Testing',
> ie.title)end
>
>def setup
> @start_page= 'http://wtr.rubyforge.com'
>end
>
> end
>
> Please remember that this is a t-shirt and aimed and increasing
> Watir usage/awareness to others.  Let me know what you think and
> if you'd be interested in one.
>
> Cheers,
> Jason
> ___
> 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] command to get a future date

2007-04-23 Thread Charley Baker

Use ruby's date class.

d = Date.today
d = d + 7
puts d.day()

-Charley

On 4/23/07, Maloy kanti debnath <[EMAIL PROTECTED]> wrote:


hi people,
  In my application i have a calander and i need to select a
that is 7 days from today (ie 30th April) . Now the question is . Is
there any command by which i can directly get this future date ? .. if
there is no direct command, then i will have to try writing a piece of code,
which might be quite tediou, for this.

thanks in advance,
Maloy
___
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] I am having doubts in Selenium and ajax.

2007-04-22 Thread Charley Baker

If you're using Watir 1.5.1, you can call wait_until for a control to exist.
Take a look at this, your needs might be different but it may give you some
direction:
http://wiki.openqa.org/display/WTR/Simple+Ajax+examples

I'll add more examples at some point but the basic concept holds.

-Charley

On 4/15/07, Neel <[EMAIL PROTECTED]> wrote:


When i click a link ,an ajax
form opens there it self. Using selenium i can get the form but am not
able to enter the values. Its throwing me an error Element not found,
But i used the correct element only. I tried
using wait_for_page_to_load() also. then its throwing me Time out
error. So wat should i do to over come this problem??
___
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] Calling Function Error - like No test were specified

2007-04-19 Thread Charley Baker

Hmmm, there's quite a lot going on here. Where to begin.

Classnames must be capitalized:

class MainTestManage
 not
class mainTestManage

I'm not sure why you've defined a module nor why you're explicitly naming
your class names in your module with the as class methods.

You maintestManage class is inheriting from TestCase but has no tests
defined since test methods called by TestCase need to be defined by using
test at the beginning of the method name.

Here's a quick hack to your example though I may be missing the actual jist
of what you're attempting to do.

require 'watir'
include Watir
require 'test/unit'
require 'test/unit/ui/console/testrunner'
#require 'win32ole'  #already loaded by watir
class MaintestManage  < Test::Unit::TestCase
   def setup
 $ie = IE.start('www.xxx.com)# moving this into the setup
method
   end
   def test_manage   # removed main from the beginning so
it's a test case
  mt = MainTestAPI::MainTest.new
   mt.test1()
   mt.test2() # this test does nothing
   mt.test3()
   end
   def teardown# adding ie.close to the teardown, since
you're calling all your tests in the main test anyhow
  $ie.close
  sleep 1
   end
end
module MaintestAPI   # module names like class names begin with
a capital letter
 class MainTest# classes begin with capital letter,
removed previous class name from your method definitions, not necessary
   def test1()
 $ie.text_field(:id, 'UserID').set('ABCD1234')
 $ie.text_field(:id, PWD).set('123456')
 $ie.button(:id, 'Login').click
   end
   def test2()

   end
   def test3()
 $ie.link(:url, 'Logout.aspx').click
   end
 end
end


Hopefully this help explain some things, or if not maybe explain your
reasoning behind your particular version.

-Charley


On 4/19/07, vamsi <[EMAIL PROTECTED]> wrote:


Hi,

Getting an Calling fuction error  Please find the script and error
message below.

require 'watir'
include Watir
require 'test/unit'
require 'test/unit/ui/console/testrunner'
require 'win32ole'
class maintestManage  < Test::Unit::TestCase
def maintestManage
maintest.test1()
maintest.test2()
maintest.test3()
end
end
module maintestAPI
   class maintest
def maintest.test1()
$ie = IE.new
$ie.goto('www.xxx.com)
$ie.text_field(:id, 'UserID').set('ABCD1234')
$ie.text_field(:id, PWD).set('123456')
$ie.button(:id, 'Login').click
end
def maintest.test2()

end
def maintest.test3()
$ie.link(:url, 'Logout.aspx').click
$ie.close
end
end
end


Error Message:  1) Failure:
default_test(maintestManage) [maintestmanagesignonAPI.rb:28]:
No tests were specified.


Kindly help me into this
Thansk 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] Verifying Values of Cookies

2007-04-18 Thread Charley Baker

Hi Gary,

 This will grab the cookies and put them into an array:

require 'watir'
include Watir

ie = IE.start('http://www.yahoo.com')
arr = ie.document.cookie.split(';')   # multiple cookies are separated by ;s
arr.each {|a| puts a.to_s}

-Charley



On 4/17/07, Gary <[EMAIL PROTECTED] > wrote:


I am somewhat new to watir, and I am trying to figure out how to read and
assert the value(s) of multiple cookies that are set by our software. Is
this even possible with watir? I have seen some references to cookie
manager, but it seems to be unsupported and generally unused. Some snippets
of code or examples would really come in handy.

Thanks in advance,
lokispeak
___
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] OLE error code:80070005 in Access is denied.

2007-04-17 Thread Charley Baker

Or you can use the latest version of Watir and it will also go away and give
you more functionality:
http://wiki.openqa.org/display/WTR/2007/04/12/Watir+Development+Gem+1.5.1.1165+Released
The workaround isn't ideal, but should solve this issue for the majority of
users.

-Charley

On 4/17/07, jim_matt <[EMAIL PROTECTED]> wrote:


Thanks Bret,

I dropped back to Watir version 1.5.1.1145 and the problem went away.

Jim

- Original Message -
From: "Bret Pettichord" <[EMAIL PROTECTED]>
To: 
Sent: Thursday, April 12, 2007 11:08 PM
Subject: Re: [Wtr-general] OLE error code:80070005 in  Access is
denied.


> jim_matt wrote:
>> Hi guys,
>>
>> I got the following error and am having trouble getting around it:
>>
>> d:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:1830:in
>> `method_missing': document (WIN32OLERuntimeError)
>> OLE error code:80070005 in 
>>   Access is denied.
> Use a previous gem. Or build from trunk.
>
> 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

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

Re: [Wtr-general] Will WATIR support MS SQL 2005, if so what are the connections to include.

2007-04-17 Thread Charley Baker

 As John's link points out, this is not a watir related question but one
covered by other libraries in Ruby, notably either dbi which is mentioned in
this posting and likely ActiveRecord.

 It's important to make the distinction and understand the difference
between Ruby as a programming languages and the libraries that are written
in Ruby, Watir being one of them, dbi is another, rubyforge has quite a few
more.

 If you understand this distinction then you can use google and rubyforge
to search for information that might be able to help out (i.e. 'ruby
database mssql' or something of the sort).

 This is more of a general message rather than entirely specific to your
posting. We certainly have off topic or tangentially related conversations
here and there which is great, but I find several people new to Ruby and
Watir who don't seem to understand the distinction between the two. Maybe
this needs to go into the FAQ?

-Charley

On 4/17/07, John Fitisoff <[EMAIL PROTECTED]> wrote:


http://www.ruby-forum.com/topic/64065

--- Madhu <[EMAIL PROTECTED]> wrote:

> Hi, help me out
>  Can WATIR support MS SQL 2005.
> Presently i'm using ruby SciTE.
> I'm unable to locate any doints or ideas as to how
> to connect my application with the MS sql 2005.
> If any of u have a solution share it with me :)
> ___
> Wtr-general mailing list
> Wtr-general@rubyforge.org
> http://rubyforge.org/mailman/listinfo/wtr-general
>


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
___
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] 'method_missing': document (WIN32OLERuntimeError)

2007-04-13 Thread Charley Baker

The gem pulls it's version number from watir.rb which gets updated when it
gets checked in. The last change was to winclicker which brings the
supporting files up to version 1165 though the gem says 1164.

-Charley

On 4/13/07, Manish Sapariya <[EMAIL PROTECTED]> wrote:


Hi,
Thanks it works. :-)
However I noted that even the site says ver 1.5.1.1165,
the actual gem file is 1164. Neverthless, it works as expected.
Thanks,
Manish

Charley Baker wrote:
> Hi Manish,
>
>   Try using the latest gem on the watir site, 1165. There's a bit of a
> work around for this issue in place until we get around to a longer
> term fix. It's the same cross site scripting frame issue which has
> been discussed on this list previously.
>
> -Charley
>
> On 4/13/07, *Manish Sapariya* <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>> wrote:
>
> Hi,
> I am facing same problem in 1.5, not sure if its the same. I had
> sent query regarding this on list, but had no replies. It happens
> always when I do
>
> goto ("www.hotmail.com <http://www.hotmail.com>")
>
> Is there any known bug in 1.5 latest gem?
> Any directions so that I can give more inputs to debug problem.
>
> Watir Version: watir-1.5.1.1158.
>
>
> Thanks and Regards,
> Manish
>
>
> Bret Pettichord wrote:
> > aidy lewis wrote:
> >
> >> I am getting this error:
> >>
> >> 'method_missing': document (WIN32OLERuntimeError)
> >>
> >> that lies @ie.document
> >>
> >> I am using 1.4.1.
> >>
> >> Here is my code
> >>
> >> 
> >>
> >> require 'watir'
> >> include Watir
> >> require 'test\unit'
> >>
> >> $ie = Watir:: IE.new
> >> def browser;$ie;end
> >>
> >> module Login
> >>   USERNAME = browser.text_field(:name, 'user_name')
> >>   PASSWORD = browser.text_field(:name, 'password')
> >>   REMEMBER_ME = browser.checkbox(:name, 'remember_me')
> >>   SIGN_IN = browser.button(:value, 'Sign in')
> >> end
> >>
> >> module Mission
> >>   LOG_OUT = browser.link (:text, /Log-out/)
> >> end
> >>
> >> class TC_Mission < Test::Unit::TestCase
> >>   include Login
> >>
> >>
> >>   def setup
> >> browser.goto(' www.something.com <http://www.something.com>')
> >>
> >>
> > Right here add:
> >   browser.wait
> >
> > This bug is fixed in 1.5.
> >
> >
> >> browser.bring_to_front
> >> browser.maximize
> >>   end
> >>
> >>
> >
> > ___
> > Wtr-general mailing list
> > [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> > http://rubyforge.org/mailman/listinfo/wtr-general
> >
> >
>
> ___
> Wtr-general mailing list
> [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> http://rubyforge.org/mailman/listinfo/wtr-general
>
>
>
> --
> This message has been scanned for viruses and
> dangerous content by *MailScanner* <http://www.mailscanner.info/>, and
is
> believed to be clean.
> 
>
> ___
> Wtr-general mailing list
> [EMAIL PROTECTED]
> http://rubyforge.org/mailman/listinfo/wtr-general

___
Wtr-general mailing list
[EMAIL PROTECTED]
http://rubyforge.org/mailman/listinfo/wtr-general

___
Wtr-general mailing list
[EMAIL PROTECTED]
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] 'method_missing': document (WIN32OLERuntimeError)

2007-04-13 Thread Charley Baker

Hi Manish,

 Try using the latest gem on the watir site, 1165. There's a bit of a work
around for this issue in place until we get around to a longer term fix.
It's the same cross site scripting frame issue which has been discussed on
this list previously.

-Charley

On 4/13/07, Manish Sapariya <[EMAIL PROTECTED]> wrote:


Hi,
I am facing same problem in 1.5, not sure if its the same. I had
sent query regarding this on list, but had no replies. It happens
always when I do

goto ("www.hotmail.com")

Is there any known bug in 1.5 latest gem?
Any directions so that I can give more inputs to debug problem.

Watir Version: watir-1.5.1.1158.


Thanks and Regards,
Manish


Bret Pettichord wrote:
> aidy lewis wrote:
>
>> I am getting this error:
>>
>> 'method_missing': document (WIN32OLERuntimeError)
>>
>> that lies @ie.document
>>
>> I am using 1.4.1.
>>
>> Here is my code
>>
>> 
>>
>> require 'watir'
>> include Watir
>> require 'test\unit'
>>
>> $ie = Watir::IE.new
>> def browser;$ie;end
>>
>> module Login
>>   USERNAME = browser.text_field(:name, 'user_name')
>>   PASSWORD = browser.text_field(:name, 'password')
>>   REMEMBER_ME = browser.checkbox(:name, 'remember_me')
>>   SIGN_IN = browser.button(:value, 'Sign in')
>> end
>>
>> module Mission
>>   LOG_OUT = browser.link(:text, /Log-out/)
>> end
>>
>> class TC_Mission < Test::Unit::TestCase
>>   include Login
>>
>>
>>   def setup
>> browser.goto('www.something.com')
>>
>>
> Right here add:
>   browser.wait
>
> This bug is fixed in 1.5.
>
>
>> browser.bring_to_front
>> browser.maximize
>>   end
>>
>>
>
> ___
> Wtr-general mailing list
> [EMAIL PROTECTED]
> http://rubyforge.org/mailman/listinfo/wtr-general
>
>

___
Wtr-general mailing list
[EMAIL PROTECTED]
http://rubyforge.org/mailman/listinfo/wtr-general

___
Wtr-general mailing list
[EMAIL PROTECTED]
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] Looping with excel worksheets

2007-04-13 Thread Charley Baker

Hi Nicola,

 Put it in a method and call the method from within a loop:

require 'watir'
include Watir

url = "http://www.zoomerang.com/recipient/survey.zgi?p=WEB225WDYJNVDT";
search_string = "questionnaire"

$ie = IE.new
$ie.goto(url)
$ie.bring_to_front
#ie.show_all_objects

require 'win32ole'

def fill_fields(worksheet_no)

 excel = WIN32OLE::new('excel.Application')
 workbook = excel.Workbooks.Open('C:\WATIR_RUBY\excel_testdata5.xls')

 worksheet = workbook.Worksheets(worksheet_no) #get hold of the first
worksheet
 worksheet.Select
 @mydata = []
 @mydata = worksheet.Range('a1:a6').value # The data is in cell a1 - a6
 excel['Visible'] = false # hide the spreadsheet from view
 workbook.close
 excel.Quit


 $ie.text_field(:name, 'u_answer_58').set(@mydata[0].to_s)
 $ie.text_field(:name, 'u_answer_59').set(@mydata[1].to_s)
 $ie.text_field(:name, 'u_answer_60').set(@mydata[2].to_s)
 $ie.text_field(:name, 'u_answer_61').set(@mydata[3].to_s)
 $ie.text_field(:name, 'u_answer_62').set(@mydata[4].to_s)
 $ie.text_field(:name, 'u_answer_63').set(@mydata[5].to_s)
end

# call the method:
for i in 1..5
 fill_fields(i)
end


Note that I've changed ie to $ie making it global so it's visible inside the
method.


-Charley

On 4/13/07, Nicola Kennedy <[EMAIL PROTECTED]> wrote:


Hi,

Have written following script (which works! I'm getting there!)
I now want to put a loop in so that when this is complete, it goes to the
second worksheet in my excel file, basically starting the process from the
beginning again and then inputs this information in the same fields.

Can anyone help?

TIA

require 'watir'
include Watir

url = "http://www.zoomerang.com/recipient/survey.zgi?p=WEB225WDYJNVDT";
search_string = "questionnaire"

ie = IE.new
ie.goto(url)
ie.bring_to_front
#ie.show_all_objects

require 'win32ole'

excel = WIN32OLE::new('excel.Application')
workbook = excel.Workbooks.Open
('C:\WATIR_RUBY\excel_testdata5.xls')


worksheet = workbook.Worksheets(1) #get hold of the first
worksheet
worksheet.Select
@mydata = []
@mydata = worksheet.Range('a1:a6').value # The data is in cell a1
- a6
excel['Visible'] = false # hide the spreadsheet from view
workbook.close
excel.Quit


ie.text_field(:name, 'u_answer_58').set(@mydata[0].to_s)
ie.text_field(:name, 'u_answer_59').set(@mydata[1].to_s)
ie.text_field(:name, 'u_answer_60').set(@mydata[2].to_s)
ie.text_field(:name, 'u_answer_61').set(@mydata[3].to_s)
ie.text_field(:name, 'u_answer_62').set(@mydata[4].to_s)
ie.text_field(:name, 'u_answer_63').set(@mydata[5].to_s)
___
Wtr-general mailing list
[EMAIL PROTECTED]
http://rubyforge.org/mailman/listinfo/wtr-general

___
Wtr-general mailing list
[EMAIL PROTECTED]
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] OT: run Firefox inside Firefox

2007-04-12 Thread Charley Baker

That's oddly disturbing. :)

-c

On 4/12/07, Chris McMahon <[EMAIL PROTECTED]> wrote:


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

___
Wtr-general mailing list
[EMAIL PROTECTED]
http://rubyforge.org/mailman/listinfo/wtr-general

  1   2   3   4   >