Re: [Wtr-general] need help on Data Driven

2007-07-10 Thread Walter Kruse
I suspect that your problem is in the path + filename definition. On
Windows I have always had to use / or \\ instead of the \ in defining
paths. I also advise not using directories with spaces in the names. You
may also under certain circumstances need to escape the . in .xls with a
\

HTH

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of murali
Sent: 10 July 2007 07:42 AM
To: wtr-general@rubyforge.org
Subject: [Wtr-general] need help on Data Driven

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(categor
y)


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
**
Everything in this e-mail and attachments relating to the official business of 
MultiChoice Africa is proprietary to 
the company. Any view or opinion expressed in this message may be the view of 
the individual and should not automatically 
be ascribed to the company.  If you are not the intended recipient, you may not 
peruse, use, disseminate, distribute or 
copy this message. If you have received this message in error, please notify 
the sender immediately by email, facsimile 
or telephone and destroy the original message.
**
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] hidden control..

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


Re: [Wtr-general] need help on Data Driven

2007-07-10 Thread Lavanya Lakshman
Try the following 

Category is holding an array and not just  a single variable. Thereby each 
value needs to be picked up and then assigned. 

category.each do |cat|
ie.text_field(:name,ctl00$ContentPlaceHolder1$txtCategory).set(cat.to_s)
___
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-10 Thread Lavanya Lakshman
Step 1:
Since it is a dialog box, Attach the focus to this page by using the following:
ie = Watir::IE.attach(:title, Web Page Dialog)

Step 2:
Do a puts ie.show_all_objects 
This will give the various objects and their identification attributes. 

Step 3:
Based on the above output, perform the regular text field entry and click 
button operation.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] How to pick the last word in the sentence (sapna)

2007-07-10 Thread Ajitesh Srinetra

Hi Sapna,

The HTML code was not there , But you can try this

string=ie.link(:id,'yourlink'sID').text
mytext=string.split('  ') #Separated by space
yourtext=mytext[mytext.length - 1]

For more help you can refer array class in ruby
Let me know if it is helpful

Ajitesh
___
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 murali
Thanks it is working fine.

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


[Wtr-general] How to count links of a table

2007-07-10 Thread SHALINI GUPTA

Hi all,

Please tell me how to count link from a table.

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

[Wtr-general] branches of Watir

2007-07-10 Thread aidy lewis
Hi,

Could anyone give or point me to branches of Watir?

I currently have:

1. FireWatir - runs tests within FireFox
2. Watij - Java API that is not bound to IE and can run on various
operating systems

Thanks

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


Re: [Wtr-general] branches of Watir

2007-07-10 Thread Željko Filipin

Hi Aidy,

There is a wiki page called Alternative Tools For Web Testing.
http://wiki.openqa.org/display/WTR/Alternative+Tools+For+Web+Testing

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

Re: [Wtr-general] How to count links of a table

2007-07-10 Thread sandeep
ie.links.length  # show how many links are on the 
page.

May be u can use this (or modify it to access table)method for links in table
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] How can I make a IE window active?

2007-07-10 Thread Claudiu Gorgan
Hi there,

Is there somebody hwo can tell me how can I make a IE window active in order to 
make some changes to its objects...So my script clicks on a button that opens a 
new IE window, more like a pop-up, and should fill some fields in this new 
window. I have tryied makeWindowActive() but no results :)

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


Re: [Wtr-general] How can I make a IE window active?

2007-07-10 Thread Željko Filipin

Hi Claudiu,

If pop up window is new Internet Explorer window, you can attach to it with
eiher of this.

ie = Watir::IE.attach(:title, title)
ie = Watir::IE.attach(:url, url)

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

Re: [Wtr-general] hidden control..

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

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

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


Re: [Wtr-general] How to pick the last word in the sentence

2007-07-10 Thread Chong
str = tdWhat was your first pet's name?/tdtdAnother sentence here/td
sentences = str.scan(/td([^]*)/)
last_words_arr = []
for arr in sentences
  sentence = arr.first
  sentence.gsub!('?', '')
  sentence.gsub!('.', '')
  sentence.gsub!('!', '')
  last_word = sentence.split.last
  last_words_arr  last_word
end
p last_words_arr
___
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] How to pick the last word in the sentence

2007-07-10 Thread marekj

Hm...how about this:

sentences =eof
some words and more words then some more words and the last one word in a
sentence1.
Next sentence and more words and the last one word in a sentence2.
and here too
and then some more here
and last word of the last sentence.
eof
words = sentences.split # or add (' ') to make split on whitespace explicit.
last_word = words[-1] #last element in Array is your last word in a heredoc

take a look at String.split goodness.
http://www.ruby-doc.org/core/classes/String.html#M000818

marekj


On 7/9/07, sapna [EMAIL PROTECTED] wrote:


Hi All,

Pleas can you help me finding out the last word in the sentence displayed
on the web page. Have look at the HTML snippet.

Regards
Sapna
___
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-10 Thread Paul Rogers
have you looked at the modal_dialog stuff in watir? Ive never used it so cant 
help you much, but its there.

- Original Message -
From: Matt Berney [EMAIL PROTECTED]
Date: Tuesday, July 10, 2007 12:10 pm
Subject: Re: [Wtr-general] Selecting controls in a dialog box
To: wtr-general@rubyforge.org

 The default Watir::IE.attach method doesn't seem to work because 
 this is a dialog.  I can use the autoit.WinWait() method to 
 get the window handle.  But, access the controls on the 
 dialog seems elusive.  Any help is greatly appreciated.
 
 irb(main):005:0 d = Watir::IE.attach(:title,/Web Page Dialog/)
 Watir::Exception::NoMatchingWindowFoundException: Unable to 
 locate a window with
  title of (?-mix:Web Page Dialog)
     from 
 d:/tools/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1192/./watir.rb:16
 42:in `attach_browser_window'
     from 
 d:/tools/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1192/./watir.rb:15
 19:in `_attach_init'
     from 
 d:/tools/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1192/./watir.rb:15
 13:in `attach'
     from (irb):5
 
 irb(main):018:0 autoit = WIN32OLE.new('AutoItX3.Control')
 = #WIN32OLE:0x9f0cb30
 irb(main):019:0 autoit.WinWait Web Page Dialog, , 1
 = 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] Selecting controls in a dialog box

2007-07-10 Thread Bret Pettichord
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] How to access the window.status pane

2007-07-10 Thread marty
We have some code that on a MouseOver sets the window.status field. Is there a 
way to access this in Watir?

HTML Code:

td class='fnt' valign=bottom
a href=javascript:show_calendar('frmDateRange.txtbegin_date'); 
onmouseover=window.status='Date Picker';return true; 
onmouseout=window.status='';return true;img 
src=%=baseurl%images/calendar.gif width=34 height=21 border=0/a
/td
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] How to access the window.status pane

2007-07-10 Thread Paul Rogers
ie.status



- Original Message -
From: marty [EMAIL PROTECTED]
Date: Tuesday, July 10, 2007 2:08 pm
Subject: [Wtr-general] How to access the window.status pane
To: wtr-general@rubyforge.org

 We have some code that on a MouseOver sets the window.status 
 field. Is there a way to access this in Watir?
 
 HTML Code:
 
 td class='fnt' valign=bottom
 img src=%=baseurl%images/calendar.gif width=34 
 height=21 border=0
 /td
 ___
 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 the window.status pane

2007-07-10 Thread marty
I apologize. I found it about 5 minutes after posting. This will teach me to go 
through ALL of my resources before bothering the group. Thanks for your support.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] Path error or what? (2)

2007-07-10 Thread Lonny Eachus





I did recently install Visual Studio, so I could track down some issues
with an MS application. I wonder if some of the environment variables
it set could be interfering?

Pardon my inclusion of previous quotes last time. That was accidental.

Here is my environment:

ALLUSERSPROFILE=C:\Documents and Settings\All Users
APPDATA=C:\Documents and Settings\This User\Application Data
CLASSPATH=.;C:\Program Files\QuickTime\QTSystem\QTJava.zip
CommonProgramFiles=C:\Program Files\Common Files
ComSpec=C:\WINDOWS\system32\cmd.exe
FP_NO_HOST_CHECK=NO
HOME=C:\Documents and Settings\This User
HOMEDRIVE=C:
HOMEPATH=\Documents and Settings\This User
INCLUDE=C:\Program Files\Microsoft Visual Studio .NET
2003\SDK\v1.1\include\
LIB=C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Lib\
LOGONSERVER=\\MOBILEUSER
NUMBER_OF_PROCESSORS=1
OS=Windows_NT
Path=c:\ruby\bin;c:\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;
C:\Program Files\ATI Control Panel;"C:\Program
Files\ZoneAlarm\MailFrontier";C:\
Program Files\QuickTime\QTSystem\;;C:\Program Files\Common Files\Ulead
Systems\M
PEG;C:\Program Files\Microsoft SQL Server\80\Tools\BINN;C:\Program
Files\MySQL\M
ySQL Server 5.0\bin
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.RB;.RBW
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_IDENTIFIER=x86 Family 15 Model 2 Stepping 7, GenuineIntel
PROCESSOR_LEVEL=15
PROCESSOR_REVISION=0207
ProgramFiles=C:\Program Files
PROMPT=$P$G
QTJAVA=C:\Program Files\QuickTime\QTSystem\QTJava.zip
RUBYOPT=-rubygems
SESSIONNAME=Console
SystemDrive=C:
SystemRoot=C:\WINDOWS
TEMP=C:\DOCUME~1\THISUS~1\LOCALS~1\Temp
TMP=C:\DOCUME~1\THISUS~1\LOCALS~1\Temp
tvdumpflags=8
USERDOMAIN=MOBILEUSER
USERNAME=This User
USERPROFILE=C:\Documents and Settings\This User
VS71COMNTOOLS=C:\Program Files\Microsoft Visual Studio .NET
2003\Common7\Tools\
windir=C:\WINDOWS

Lonny Eachus
===



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

Re: [Wtr-general] Recommended version of Ruby

2007-07-10 Thread Derek Wong
Hi Bret,

here's my 2 New Zealand cents worth on the issue tempered somewhat by 
experiences I've had over the past week or so.

Our situation:
1. Our web application uses Javascript dialogs, modal dialogs and occasionally 
raises extra browser windows.
2. In order to aid the continuous testing of scripts against our web 
application I've used CruiseControlRB.

What version of Ruby and WATIR do I use?
0. I use WATIR 1.5.1.1192.
1. Based on your (and other developer's) advice I use 1.8.2-14 because I *NEED* 
modal dialog support.
2. On our continuous integration machine I actually use 1.8.2-14 *AND* 1.8.5-24 
(because CruiseControlRB only works on 1.8.4 and above).  I specifically invoke 
the 1.8.2-14 version of the Ruby interpreter from our rake script to ensure 
that our test script framework can still test our web application (and its 
modal dialogs).

I agree with you in principle that everyone should be using the latest versions 
of Ruby but because of our current test requirements we'll continue to use 
1.8.2-14.

I remember in an earlier discussion thread that there was something about 
re-compiling some library to support modal dialogs on different versions of 
Ruby (correct me if I've misunderstood).  Is there a better more maintainable 
way to do this without coupling WATIR to a particular version of Ruby to 
support modal dialogs?

Hey, don't get me wrong.  I think what you guys have done is great so far (and 
getting better all the time) but I'd guess a few of us out here require modal 
dialog support.

Thanks.

Regards,
Derek Wong.


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