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] 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] 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] 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 div.

Thanks in advance.

table id=table1 style=BORDER-COLLAPSE: collapse borderColor=#819cb9
height=180 cellPadding=0 width=69 border=1
tr
td id=list1 style=CURSOR: pointer
onClick=changeBG('list1');changIframes(0); bgColor=#ceddf0 height=30
p style=TEXT-ALIGN: centerbTicketbr
Info/b/p
/td
/tr
...
tr
td id=list5 style=CURSOR: pointer
onClick=changeBG('list5');changIframes(4); bgColor=#ceddf0 height=30
p style=TEXT-ALIGN: centerbSVAs/b/p
/td
/tr
/table
___
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] 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] 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] 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:\PROVISGlobalAdminScript.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] 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] 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] 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  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] 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] 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] 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] 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] 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] 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] 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
#Watir::Table:0x2e0becc (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] 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.

?xml version=1.0 encoding=UTF-8?
projectDescription
   nameproject_name/name
   comment/comment
   projects
   /projects
   buildSpec
   buildCommand
   nameorg.rubypeople.rdt.core.rubybuilder/name
   arguments
   /arguments
   /buildCommand
   /buildSpec
   natures
   natureorg.rubypeople.rdt.core.rubynature/nature
   /natures
/projectDescription


-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] 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.comtest=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-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

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

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

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

___
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 Unknown
  No Description
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] 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] 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] 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] 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] 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] 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

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

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

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

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] 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 (iaObjects.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] 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] 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

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] 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] 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_accountlink=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] 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] 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: wtr-general@rubyforge.org
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

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] 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] 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
input type - text name='foo' maxLength=3

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: wtr-general@rubyforge.org
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] 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] '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] 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] 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-2d5e1db91038displaylang=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] 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:
input type=hidden name=1_1 id=1_1
smokeId=__msgs__trtdnbsp;/tdtd align=rightspan
class=login-input-labelUsername/span/tdtd align=leftinput
type=text name=1_2 id=1_2 smokeId=username label=Username value=
onChange=if (EventHandlers.valueChanged(this)==false) return false;
onKeyDown=DHTML.cancelBubbleIfNoAltKeyOrEnter(); contenteditable=true
delayOnChange=false class=txt style=text-align: left size=20
helpText=__UseTitle__ onfocus=EventHandlers.onFocus() onblur=
EventHandlers.onBlur()/td/tr
trtdnbsp;/tdtd align=rightspan
class=login-input-labelPassword/span/tdtd align=leftinput
value= type=password class=txt smokeId=password id=1_3
helpText=__UseTitle__ delayOnChange=false label=Password onfocus=
EventHandlers.onFocus() onChange=if (EventHandlers.valueChanged(this)==false)
return false; size=20 name=1_3 onblur=EventHandlers.onBlur
()/td/tr
trtd colspan=2nbsp;/tdtdbutton smokeId=submit onclick=
Events.invokeEvent('1_4_act', true) class=login-button onrecordclick=
Recorder.recordLogin() isDefault=trueLogin/button/td/tr
___
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

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML Transitional//ENMETA
http-equiv=Content-Type content=text/html; charset=utf-8

HTMLBODY leftMargin=0 topMargin=0 marginwidth=0 marginheight=0
SogouAutoLinkDocFORM name=mainForm action=
http://benicia.guidewire.com:10402/cc402/ClaimCenter.do;
method=postTABLE id=mainTable height=100% cellSpacing=0
cellPadding=0 width=100% border=0TBODYTRTD id=topDivision
vAlign=top width=100% height=100%DIV style=HEIGHT: 100%DIV
style=Z-INDEX: 10; LEFT: 0px; POSITION: absolute; TOP: 36pxTABLE
cellSpacing=0 cellPadding=0 width=100%TBODYTRTDTABLE
class=login-table cellSpacing=0 cellPadding=0 width=600
align=centerTBODYTRTD class=login-content-gray vAlign=top
align=left width=460 height=117TABLE cellSpacing=0 cellPadding=2
border=0TBODYTRTD

BUTTON class=login-button onclick=Events.invokeEvent('1_4_act', true)
smokeId=submit isDefault=true onrecordclick=Recorder.recordLogin
()Login/BUTTON


/TD/TR/TBODY/TABLE/TD/TR/TBODY/TABLE/TD/TR/TBODY/TABLE/DIV/DIV/TD/TR/TBODY/TABLE/FORM/BODY/HTML
___
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] 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.



div class=calendarStripContainer pane panebody id=calendarStripPane
style=left: 200px; top: 499px; height: 22px; width: 939px; -moz-user-focus:
ignore; -moz-user-select: none; display: block;
div class= id=calendarStripPaneButtons style=-moz-user-focus:
ignore; -moz-user-select: none; width: 62px;
/div
div class=textButtonSquareLeft textButtonSquareRight id=datePickerBtn
style=-moz-user-focus: ignore; -moz-user-select: none;
/div
div class=calendarStripPane dock id=calendarStripDock
style=-moz-user-focus: ignore; -moz-user-select: none;
div class=calendarStripPane dateLabel id=calendarStripDateLabelDock
style=-moz-user-focus: ignore; -moz-user-select: none;TUE, 4/24 - WED,
4/25/div
div class=calendarStripPane allDayEventDock
id=calendarStripAllDayEventsDock style=-moz-user-focus: ignore;
-moz-user-select: none;/
/div
div class=calendarStripPane viewPort id=calendarStripViewPort
style=width: 714px; -moz-user-focus: ignore; -moz-user-select: none;
/div
/div
___
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] 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

[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] 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] Calling Function Error - like No test were specified

2007-04-20 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] 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] OLE error code:80070005 in Unknown 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: wtr-general@rubyforge.org
Sent: Thursday, April 12, 2007 11:08 PM
Subject: Re: [Wtr-general] OLE error code:80070005 in Unknown 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 Unknown
   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] 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] '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

 snip

 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] '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
 
  snip
 
  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] 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

Re: [Wtr-general] How to run all the steps defined in a method even if any of step fails?

2007-04-11 Thread Charley Baker

 There's no flag in watir to swallow all exceptions, that's rather
dangerous behavior and not recommended. You could wrap methods with
begin/rescue blocks and print out the exceptions as they occur - follow
Zeljko's example above and the more specific the exceptions you catch the
better.

 I'd agree, it's not slick or pretty but it's the nature of the way test
unit is designed and my understanding of how these specific tests are coded
and the requirements. I reserve the right to be wrong on both accounts. :)
The way test unit and assertions work is more on a unit = single assertion
aspect vs grouping multiple assertion points(test cases) into one larger
grouping.

 For better or worse, I've ignored the issue to some extent as the
assertion points fold up into a larger test case, which I'm assuming passes
if all individual test points pass, and dump out of the test case with a
message on any individual assertion instead of bending it all around to a
functional pass through with multiple assertions that are all independent. I
added the ability track assertions in the test unit reports we're running
just to identify the running assertions. Otherwise, I'm basically using test
unit as is with it's limitations for true functional test scenarios.

-c

On 4/11/07, Vamsee Krishna M [EMAIL PROTECTED] wrote:


I think what he meant was he wants to execute each and every statement
without considering whether the previous statement was failed.

So the solution would be like putting try rescue catch block around around
each line and code won't look professional.

Is there any flag in watir that can be used to suppress all the exceptions
?
___
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] unknown property or method `readyState' (WIN32OLERuntimeError)

2007-04-11 Thread Charley Baker

It's likely your frames are throwing errors with cross site scripting
issues. You might try updating to the latest version of watir 1.5.1.1165 in
svn. Installation instructions are included on the FAQ site. I may end up
making a gem from the current source today. It's been a while and there have
been a couple of changes, notably this workaround that might make it
worthwhile.

-c

On 4/11/07, Parv [EMAIL PROTECTED] wrote:


Some more info.  The application i'm testing uses a lot of frames.
___
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] screen_capture filename

2007-04-11 Thread Charley Baker

This is probably some code that needs to be yanked out and put in contrib. I
haven't used it and have yet to hear anyone else using it although I'm sure
there are some. You might take a look at Aslak Hellesoy's screenshot
library.
http://blog.aslakhellesoy.com/2006/12/2/getting-screenshots-from-watir
which might make sense to include in Watir vs the screen_capture library
since his implementation has unit tests. You can enter a ticket for that in
Jira if you'd like. As far as the current function, taking a brief look at
it, you've not included curly brackets for evaluation on the
time.jpgvariable, you might try the following:

screen_capture(
C:[EMAIL PROTECTED]C:[EMAIL PROTECTED]
, true, false)

or this:

screen_capture(
C:/InstantRails/rails_apps/watir_tests/public/images/[EMAIL PROTECTED]C:[EMAIL 
PROTECTED]
, true, false)

which should get converted into the same thing.


-Charley

On 4/11/07, Matt Makins [EMAIL PROTECTED] wrote:


 i am using the screen_capture function which i have working correctly.



How do i specify the path where i want to save the image file?



screen_capture(
C:[EMAIL PROTECTED]C:[EMAIL PROTECTED]
, true, false)



this doesn't work, anybody tried this??



Cheers,

Matt

___
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 run all the steps defined in a method even if any of step fails?

2007-04-10 Thread Charley Baker

You can also pull the assertions file and use it with Watir 1.4.1.
https://svn.openqa.org/svn/watir/trunk/watir/watir/assertions.rb  Download
this file, put it in your watir/watir directory and use it the same way I
mentioned in my previous mail.

-Charley


On 4/10/07, Paul Carvalho [EMAIL PROTECTED] wrote:


I suppose you could always wrap a rescue true around each of your
assertions.  There are different ways of doing this.  This is just off the
top of my head but I'm pretty sure it works because I've done something
similar in the past.

One way would be:

def assertButton
   assert($ie.button(:caption, Click Me).enabled?)  rescue true
end


If you have other commands that are likely to fail (e.g. a navigate link
command when the link isn't there), then you could wrap the rescue for the
whole method like this:

def assertButton
   assert($ie.button(:caption, Click Me).enabled?)
rescue
   true
end

Where the rescue and true are the last lines before the end of the
method.  This will exit the method nicely and allow you to go to the next
method.  There are a lot of neat things you can do with a container like
this at the end of a test method.  If you want more information about
recovering from methods like this you should check out the Programming
Ruby book, second edition.

Hope this helps.  Paul C.


On 10/04/07, watir-user wrote:


 Hi Charley,

 Can you tell me how to overcome the same in Watir 1.4.1. Its not only
 related to assertions, the problem i am facing is if the method which i am
 calling if does not execute for some reason the  next step of the code does
 not executes in the called method. So, is there any other way to over come
 this problem in Watir 1.4.1?

 Any suggestions  most welcome

 Thanks,



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

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

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

2007-04-10 Thread Charley Baker

This is an offtopic post on Selenium and a recent release from TIBCO with an
ajax testing framework:
http://ddj.com/198702228;jsessionid=OP1CXLIHSLECCQSNDLPCKH0CJUNN2JVN?
Thoughts?


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

Re: [Wtr-general] How to Read the values from the Table

2007-04-09 Thread Charley Baker

Hi Vamsi,

 It would help if you included some html code for what you're looking to
find. The basic syntax is this:
value = ie.table(:name, 'mytable')[1][3].text

That is, get the text that stored in the first row, 3rd column of a table
with a name attribute of mytable and assign it to a variable, in this case
value. There are more examples in the unit tests, table_test.rb.

-Charley

On 4/9/07, vamsi [EMAIL PROTECTED] wrote:


Could anyone please explain how to get the values from the Table.

and please mention the name spaces and classes required for table too.

Thanks in Advance

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] 1 Questions for Watir's creators

2007-04-08 Thread Charley Baker

Hi Fred,

  It's standard ruby coding conventions, this style of naming is used in
ruby not camel cased as is prevalent in Java and c/c++. Take a look at the
Ruby coding conventions doc:

http://pub.cozmixng.org/~the-rwiki/rw-cgi.rb?cmd=view;name=RubyCodingConvention

The naming conventions lists naming conventions for classes/modules and
methods, variables, constants.  Class names are constants in Ruby internally
and must begin with an upper case letter.

Try the following:

class dog
 def bark
   puts 'woof'
 end
end

d = dog.new
d.bark

You'll get a compilation error that class/module name must be a CONSTANT -
must begin with an upper case letter. Method names therefore begin with a
lower case letter to differentiate and use underscores to separate words not
camel case. This matches variable names which in some cases - attributes
notably - are basically interchangeable.

-Charley

On 4/7/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:


 I guess the question is for Bret

[1] What are the pros and cons of naming a method bring_to_front rather
than BringToFront.

Thanks.

Fred.



___
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 make IE as active windows and capture it?

2007-04-06 Thread Charley Baker

The bring to front method acts on the window title. If there's no window
title (you haven't navigated anywhere yet) then it won't bring the window to
the front.

-Charley

On 4/6/07, Jason He [EMAIL PROTECTED] wrote:


 Yes, thank you for your help.



I find if ie.bring_to_front is before ie.goto(), then the window console
will be brought in front.

And if it is after ie.goto() just as you write, then the ie window will be
brought in the front.



Can anyone explain what the difference between those two is?



Regards,

Jason


 --

*From:* [EMAIL PROTECTED] [mailto:
[EMAIL PROTECTED] *On Behalf Of *Charley Baker
*Sent:* 2007年4月5日 1:35
*To:* wtr-general@rubyforge.org
*Subject:* Re: [Wtr-general] How to make IE as active windows and capture
it?



ie = IE.new
ie.goto('http://www.google.com' http://www.google.com%27)
ie.bring_to_front

-Charley

On 4/4/07, *Jason He* [EMAIL PROTECTED] wrote:

Dear all,



I use a batch script in Windows command prompt (console) to start ruby
scripts, when capture the active window using screen_capture(test.jpg,
true), it will capture the console window rather than the Internet Explorer,
how to make IE as active window and bring it forward by watir/ruby script?



Regards,

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] .getElementsByTagName

2007-04-05 Thread Charley Baker

In Watir 1.5 there is support for adding elements fairly easily so that you
shouldn't have to call getElementsByTagName directly. We haven't added
headings yet, but most other common elements are supported and easily
extended, you could put the following in a file and include it in your
scripts:

module Watir

 class H2NonControlElement
   TAG = 'H2'
 end

 class H2s   ElementCollections
   include Watir::CommonCollection
   def element_class; H2; end
 end

module Container

   def h2(how, what)
 return H2.new(self, how, what)
   end

   def h2s
 return H2s.new(self)
   end
end
end

ie.h2s.show

-Charley


On 4/5/07, aidy lewis [EMAIL PROTECTED] wrote:


Are we all using the DOM method .getElementsByTagName to get for example,
a level 2 heading?

return document.getElementsByTagName('h2')

Should we refactor these methods to make a more abstract method

show_labels
show_spans
show_pres
etc?

Thanks

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] Can we use as many variable names without worrying about memory wastage

2007-04-03 Thread Charley Baker

You shouldn't have to invoke the garbage collector manually as it runs
automatically, most often when ruby is allocating memory and it's internal
memory tracker says there isn't any available or if allocating memory fails.


-Charley

On 4/3/07, vijay [EMAIL PROTECTED] wrote:


Thanks for all your answers.  They were really helpful to me.  One small
question, do we need to invoke Garbage Collector explictly and if so, how?

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

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

Re: [Wtr-general] Need help figuring out the element

2007-03-29 Thread Charley Baker

ie.button(:src, /btn_submitorder/).click

There are a few ways to do it, this is one.

hth,

Charley

On 3/29/07, Ruben [EMAIL PROTECTED] wrote:


div id=wrap_free
   div class=signup_block
 div class=signup_verisign
div class=signup_left/div
div class=signup_righta href=http://www.guba.com/home_all;img
src=/art/btn_keepshopping.gif border=0 //a input type=image
src=/art/btn_submitorder.gif width=90 height=19 alt=Submit
Order//div
  /div
   /div
/form
   !--Begin - Google Analytics code --
script src=https://ssl.google-analytics.com/urchin.js;
type=text/javascript /script
script type=text/javascript _uacct = UA-886951-1; urchinTracker();
/script
!--End - Google Analytics code --

script type=text/javascript src=/js/imgRoll.js/script
/body
/html

I need to click on btn_submitorder.gif.

Thanks, I'll know to do this in the future :)
___
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] IDEs for Watir

2007-03-29 Thread Charley Baker

I use eclipse with the ruby plugin. Curious to find out the reasons why
Eclipse isn't working for you, my quick guess would be the load path? If
that's the case, then just use the workspace but don't create projects for
each directory, just import the file directories directly so you can run it
from Eclipse and command line without mucking around with the load path.

I'm also using Cruise Control for the CI runs of our tests and  haven't had
to add anything specific. Otherwise, you could use scite. There's also
arachno, freeride and komodo's activestate. I haven't really played around
with the other ides, but there are some comparisons on the web. Scite i use
occasionally to edit files since it's included in the Ruby one click
installer.

hth,
Charley

On 3/29/07, Jason [EMAIL PROTECTED] wrote:


I'd like to get people's opinion/thoughts on what is the best IDE for
Watir.  What do you use for writing you Watir tests?  I've looked a t a few,
but none of them stand out as a clear winner.  It doesn't have to be
open-source, if a commercial tool is a good and viable solution.

Some history:  I am currently using Eclipse, but am looking for another
solution as the workspace component in Eclipse is proving not to work for
our project. We use Cruise for our CI and using Eclipse requires me to write
code for Eclipse's workspace on top of our MS Solution.  Discussing this
with my developers, we've collectively decided that it introduces a smell to
our project.  (Unless there is a way to abolish the notion of
workspace?)  Also, we've looked at Steel and it shows promise, but the
current version is not fully baked.

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

Re: [Wtr-general] IDEs for Watir

2007-03-29 Thread Charley Baker

Steel actually looks rather interesting although their website could stand a
better designer. I'd take a look at it if I was using VS for other work,
instead the other code that I look at and tests that I write are in java, so
Eclipse is a more natural fit.

-c

On 3/29/07, John Lolis [EMAIL PROTECTED] wrote:


Jason,

I started off using Mondrian ( http://www.mondrian-ide.com/ ) and at first
really liked the structure if gave me. I came from Visual Studio .Net so I
was very used to the 'Heavy IDE' format.

The problem is I started to have growing pains with with it. I noticed
that it was slowing down my work, forcing artificial constraints on me and,
on very rare occasion crashing (unacceptable for an IDE in my opinion).

I switched to a very organized file structure, and scite. I run the
program using a batch file so i get the standard console window. The batch
file also includes a 'pause' command so that at the end of the program it
doesn't close the console.

I miss multi file find, search and replace - but i can just find a better
editor for that. I personally enjoy the freedom of no overhead, just me and
1 million scite windows open.

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

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

Re: [Wtr-general] How to get report message after running everytest case

2007-03-28 Thread Charley Baker

There might be a way to redirect both to console and file, search google for
redirect dos output. I know how to do it in unix, but not sure how to do it
in dos. You might also want to look at ci_reporter (available on rubyforge),
log4r or some other mechanism to log your test runs.

-Charley

On 3/27/07, Jason He [EMAIL PROTECTED] wrote:


 Thanks for your reply.



But there will no message output in the console.

Could it output to both console and file?



Regards,

Jason
 --

*From:* [EMAIL PROTECTED] [mailto:
[EMAIL PROTECTED] *On Behalf Of *Charley Baker
*Sent:* 2007年3月27日 22:50
*To:* wtr-general@rubyforge.org
*Subject:* Re: [Wtr-general] How to get report message after running
everytest case



You can redirect the output of your bat file to a file:
mybat.bat  results.txt

-Charley

On 3/27/07, *Jason He*  [EMAIL PROTECTED] wrote:

Dear all,



I write some the filename of test cases in a windows bat file, execute the
bat file, and then report messages for each test case will output in the
console.

Now, in order to make statistics for these messages, could they also
output to the log file by script?





The following is the report message after running one test case




Finished in 15.063 seconds.



  1) Failure:

test_b(TC_rt_r_login) [C:/watir1145/runtime/rt_r_login.rb:34]:

false is not true.



5 tests, 4 assertions, 1 failures, 0 errors






Regards,

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] Watir 1.5..1..1158 installation

2007-03-27 Thread Charley Baker

Possibly you have the Watir 1.4.1 gem in that folder? Try gem install
watir-1.5.1.1158.gem

-Charley

On 3/27/07, Angrez Singh [EMAIL PROTECTED] wrote:


Hi,

Why you have uninstalled Ruby? Any reasons.

Regards,
Angrez

On 3/27/07, Simba [EMAIL PROTECTED]  wrote:

 I have download Development version of Watir( Watir-bonus-1.5.1.1158 )
 But when i give gem install Watir in CMD prompt ,its Installing
 Watir.1.4.1 instead of watir 1.5.1.1158 [It says successfully installed
 watir 1.4.1].Any body knows reason for this.

 Procedure i have used for Installation
 1.Uninstall Ruby
 2. Uninsall Watir 1.4.1
 3.Install Ruby
 4.Went to the Downloaded Folder in CMD
 5.Typed Gem install Watir
 ___
 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] How to get report message after running every test case

2007-03-27 Thread Charley Baker

You can redirect the output of your bat file to a file:
mybat.bat  results.txt

-Charley

On 3/27/07, Jason He [EMAIL PROTECTED] wrote:


 Dear all,



I write some the filename of test cases in a windows bat file, execute the
bat file, and then report messages for each test case will output in the
console.

Now, in order to make statistics for these messages, could they also
output to the log file by script?





The following is the report message after running one test case




Finished in 15.063 seconds.



  1) Failure:

test_b(TC_rt_r_login) [C:/watir1145/runtime/rt_r_login.rb:34]:

false is not true.



5 tests, 4 assertions, 1 failures, 0 errors






Regards,

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] Reading from excel files (basic)

2007-03-26 Thread Charley Baker

Hi Nicola, you could try something like this:




excel = WIN32OLE::new('excel.Application')
   workbook = excel.Workbooks.Open('C:\Documents and
Settings\kennedyn\My Documents\WATIR_RUBY\excel


_testdata2.xls')
worksheet = workbook.Worksheets(1) #get hold of the first
worksheet
worksheet.Select
[EMAIL PROTECTED] = []
[EMAIL PROTECTED] = worksheet.Range('a1:z1').value # The data is in cell
a1.
#puts @mydata # to c wether the content is in the array.
excel['Visible'] = true # hide the spreadsheet from view



line = '1'
while val = worksheet.Range(a#{line})['Value']   #pull the value
stored in the cell while it's valid
  ie.goto(val)#use the value
  line.succ!  #update the line number
end

This will only loop through for the first column a(1-end of valid values).
You can expand it to pull an array if you want.

-Charley

   workbook.close

excel.Quit








On 3/26/07, Nicola Kennedy [EMAIL PROTECTED] wrote:


Hi,

I did this and the logs showed the websites as follows:

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

Re: [Wtr-general] Unable to select the button from button-menu

2007-03-23 Thread Charley Baker

It looks like a frame access error. There's a workaround in the latest code
in svn. Follow the instructions for Installing a gem from source on the FAQ
page and try it again.

http://wiki.openqa.org/display/WTR/FAQ#FAQ-devgem

-Charley

On 3/23/07, Mathew Jacob [EMAIL PROTECTED] wrote:


 Hi,



 I installed latest gem and run the script. But I am getting following
error in Run-time.





*** WARNING *** Windows users should check the Run process in terminal
check box in the Debugger Preferences

to see STDOUT and STDERR output in real time.



c:/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 Unknown

  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 `wait'

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 
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./MongoFnDef.rb:39:in
`login'

from C:/watir/MongoMain.rb:23





Thanks in advance,



Mathew





*From:* [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
*On Behalf Of *Angrez Singh
*Sent:* Friday, March 23, 2007 11:06 AM
*To:* wtr-general@rubyforge.org
*Subject:* Re: [Wtr-general] Unable to select the button from button-menu



Hi Mathew,

Just looked at the Yahoo mail app (not the beta one) and had a look at the
HTML. The options that you are trying to select like Mark as Read, Mark
as Unread are in li tags. So you need to access them using xpath and then
fire click event. Following code works for me for marking first message in
inbox are read.
require 'watir'

include Watir

ie = IE.new
ie.goto(http://mail.yahoo.com;)
ie.maximize()
ie.text_field(:name, login).set(username)
ie.text_field(:name, passwd).set(password)
ie.button(:value, Sign In).click()
ie.button(:id, checkmailbutton).click()
# select first message.
ie.radio(:id, folderviewmsg0checkbox).set()
# click on mark button so as options can be displayed
ie.button(:value, Mark).click()
# select li element that has text Mark as Read
element = ie.element_by_xpath(//li[contains(.,'Mark as Read')])
# Print properties of the element just to make sure you selected correct
element.
puts element.value
puts element.tagName
puts element.innerHTML
# fire click event.
element.click()

Let me know if this works.

Regards,
Angrez


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

Re: [Wtr-general] problem with text_field.set

2007-03-23 Thread Charley Baker

Try setting it directly:

$ie.text_field(:id, /grp_name_txtbox/i) = 12345

This won't cause any events to be fired on the control which might in this
case be what's tripping up the test.

-Charley



On 3/23/07, jhun [EMAIL PROTECTED] wrote:


My application is written on ajax and im having an error when im setting a
value on textfield. here's the details:

my code:

def addGroup
$ie.link(:id,button_addgroup).click
$ie.text_field(:id, /grp_name_txtbox/i).set(12345)

end

error:

  1) Error:
test_addbuddy(TC_AddBuddy):
WIN32OLERuntimeError: fireEvent
OLE error code:80004005 in htmlfile
  Unspecified error.
HRESULT error code:0x80020009
  Exception occurred.
c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3407:in `method_missing'
c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3407:in `fire_key_events'
c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3432:in `doKeyPress'
c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3427:in `each'
c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3427:in `doKeyPress'
c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3393:in `set'
C:/Program Files/Watir/examples/chikka/final/addbuddy.rb:25:in
`addGroup'
C:/Program Files/Watir/examples/chikka/final/addbuddy.rb:18:in
`test_addbudd
y'
___
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] clicking image (button?)

2007-03-23 Thread Charley Baker

Good question. Go to the JIRA page for this issue:
http://jira.openqa.org/browse/WTR-74

On the left hand side in a frame you should see a link called Vote for It.
Click on that and you've voted for it. :)

This is actually a good thing for everyone to know. The higher the votes for
issues in JIRA, the more likely they will get fixed.

Thanks,

Charley

On 3/23/07, Parv [EMAIL PROTECTED] wrote:


How do i vote?
___
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 faqs

2007-03-22 Thread Charley Baker

The openqa site is the main site right now. We're keeping the RubyForge site
up as well since that's often the first site that people hit when searching
for Watir, and connects us to the ruby community to some extent. Otherwise,
as you can see, openqa is more current and where most of the information for
the project is stored.

-Charley

On 3/22/07, Lillis, Dara [EMAIL PROTECTED] wrote:


That's not my understanding. I thought http://www.openqa.org/watir/ was
now the main site for everything Watir-y.

I see two things that have not been migrated from
http://wtr.rubyforge.org/: the tutorial, and the sample test. If those
were moved, it would make sense to me that the old sites be deprecated
and the URL http://wtr.rubyforge.org/ forwarded to
http://www.openqa.org/watir/

Am I wrong?

-D

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: Wednesday, March 21, 2007 5:29 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] watir faqs





Hello,

My understanding is that Rubyforge site is not deprecated.  The site
wtr.rubyforge.org is the main release site for WATIR, which is the
current home to WATIR 1.4  When WATIR 1.5 goes live the release code
and supporting documentation will be placed here.

The openqa site is intended to be the development site.  This site
allows teams to use the latest WATIR methods, documentation, submit
defects, vote on features etc...; however, I believe at this point this
is not considered a stable release candidate.

I hope this helps.  If I am wrong I am sure Charlie and Bret will
quickly correct these statements.  :0)

Carl






 aidy lewis

 [EMAIL PROTECTED]

 email.com
To
 Sent by:  wtr-general@rubyforge.org

 wtr-general-bounc
cc
 [EMAIL PROTECTED]


Subject
   Re: [Wtr-general] watir faqs

 03/21/2007 04:18

 PM





 Please respond to

 [EMAIL PROTECTED]

 orge.org









 http://wiki.openqa.org/display/WTR/FAQ ?

Is this a deprecated site then

http://wtr.rubyforge.org/  ?

with a faq url of:

http://wtr.rubyforge.org/wiki/wiki.pl?

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
___
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 access browser authentication pop-up

2007-03-22 Thread Charley Baker

We use AutoIt to bypass proxy authentication dialogs, very similar to your
Apache basic authentication dialog. Take a look at WindowHelper.rb in the
installed watir files, there's a method called logon which should work for
you, or at least give you a general idea. Additionally, there's
documentation on AutoIt here:
http://www.autoitscript.com/autoit3/docs/functions.htm

The areas that might help if you need to roll your own are: WinActivate to
make sure your window is active, ControlSetText to populate
username/password and ControlClick to click the OK button.

You can also try WinClicker, but Ethan's right, seems to work better for
some than others.

-Charley

On 3/22/07, Oscar [EMAIL PROTECTED] wrote:


Thanks a lot! that is helpful but I was hoping not to have to do a lot of
hacking around to get it to work. I'm surprised there isn't a more
streamlined or integrated solution, given the ubiquity of this type of
login.

For my case I guess I can use the browser's autologin feature but if the
test I'm working on goes live i'll need to find another solution to fix
this. Something I've used before was sendkeys but I'm not sure if I could
apply its functionality to this problem.

thanks again, I'll post back later with my results.

O.
___
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] clicking image (button?)

2007-03-22 Thread Charley Baker

Hi Parv,

 You should be able to click on it with something like this:

$ie.button(:src, /\/images/prep/new/submit.jpg/).click


* $ie.image(:src, 'http://myDomain.com/images


/prep/new/submit.jpg').flash()



This control is a button in Watir not an image, the full url isn't listed in
the src attribute of the image, so it needs to refer to whatever is there in
the html.

* $ie.image(:src, /submit/).flash()


It's a button, this might work depending on what else is in your html if you
use $ie.button()

* $ie.button(:src = /submit./, :index = 2).click()


Aha, you've now caught the fact that input elements in the latest version of
Watir don't support multiple attributes. If you'd like you can vote for this
issue in Jira as there is a ticket: http://jira.openqa.org/browse/WTR-74

Hope that helps,

Charley



On 3/22/07, Parv [EMAIL PROTECTED] wrote:


Hi,
Please Help, as i'm trying to click on on image (button) that fires an
onClick() event.

Here's html:
input type=image src=/images/prep/new/submit.jpg onClick=sub()

I have tried the following, but none has worked so far:
* $ie.image(:src, 'http://myDomain.com/images/prep/new/submit.jpg').flash(
)
* $ie.image(:src, /submit/).flash()
* $ie.button(:src = /submit./, :index = 2).click()

Your help is highly appreciated. Thanks!!!

Parv
___
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 access browser authentication pop-up

2007-03-22 Thread Charley Baker

Well, if you want to go down that roadyou could investigate using
Navigate2 on the internal ie ole_object.

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

Navigate2 takes 4 possible parameters: url, a constant flag for options,
postdata, and headers.

The postdata and headers are just strings of standard http headers and
whatever form data you want to send.

There's information on the Navigate2 command on msdn:
http://msdn.microsoft.com/workshop/browser/webbrowser/reference/methods/navigate2.asp

Basic authentication through apache can be sent through the headers if I
remember correctly.

-Charley


On 3/22/07, Oscar [EMAIL PROTECTED] wrote:


Thanks, I'm looking into it now.

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

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

O.
___
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

  1   2   3   >