[wtr-general] After Updating ruby version from 1.8.4 to 1.8.6 and watir gem version 1.5.1.1192 to 1.5.1.1230 , am getting error with require command

2009-01-13 Thread Rahil
Hi Guys, Am using watir for quite some time with ruby version 1.8.4 and watir gem version 1.5.1.1192. Till now it was working fine for me with this version but just now i have upgraded my ruby to 1.8.6 and watir gem to 1.5.1.1230 which also supports firefox. Now am done with my installation but

[wtr-general] Re: firewatir - questions..

2009-01-13 Thread Paul Rogers
amazon doesnt give you the ability to have a gui, so its kind of difficult to use firefox there. Paul On Tue, Jan 13, 2009 at 8:23 AM, badoug...@gmail.com badoug...@gmail.com wrote: Hi. Basic questions, but I can't find the answers, and figured this is a good place to post. As I

[wtr-general] Re: Access an object

2009-01-13 Thread Richard Lawrence
This ought to do it: require 'watir' include Watir ie=IE.new ie.goto(file://c:/temp2.htm) ie.element_by_xpath(//*...@name='imp1']).click() Richard -- Richard Lawrence Certified Scrum Coach Founder and Principal Consultant, Humanizing Work, LLC 303-895-7688 rich...@humanizingwork.com

[wtr-general] Re: Access an object

2009-01-13 Thread Tiffany Fodor
Hi! The only way I know to do this would be to perform an exists? check on the various objects that this could be and click it if it exists. if ie.button(:name, 'imp1').exists? ie.button(:name, 'imp1').click elsif ie.link(:name, 'imp1').exists? ie.link(:name, 'imp1').click end Hope this

[wtr-general] Re: Access an object

2009-01-13 Thread TCBlues
Thanks for your answer. In the case the object is a textField or a listField I'm trying to set the control with: ie.element_by_xpath(//*...@name=imp1]).set(testing) but an error comes up: 13:in `method_missing': unknown property or method `set' (WIN32OLERuntimeError)

[wtr-general] Unable to click link that contains a BR tag between the text

2009-01-13 Thread Moochie
#This doesn't work to click the below link. $ie.link(:text,Total Cholesterol).click Any suggestions? A #text (Total) BR #Text (Cholesterol) I looked in to replacing BR tags with \/n\, using hpricot, but I couldn't figure it out.

[wtr-general] Re: Unable to click link that contains a BR tag between the text

2009-01-13 Thread Paul Rogers
can you use a reg exp on the link text ie.link(:text , /Cholestorol/).click Paul On Tue, Jan 13, 2009 at 10:16 AM, Moochie dduph...@redbrickhealth.com wrote: #This doesn't work to click the below link. $ie.link(:text,Total Cholesterol).click Any suggestions? A #text

[wtr-general] Re: Unable to click link that contains a BR tag between the text

2009-01-13 Thread Darin Duphorn
Yep, That worked, but is there a way to replace BR tags with carriage returns? Thanks, DD -Original Message- From: watir-general@googlegroups.com [mailto:watir-gene...@googlegroups.com] On Behalf Of Paul Rogers Sent: Tuesday, January 13, 2009 11:19 AM To:

[wtr-general] Re: Unable to click link that contains a BR tag between the text

2009-01-13 Thread Paul Rogers
I dont know. And I dont really know the best way of handling the line break in the link. And it may even be different in ie/ff Paul On Tue, Jan 13, 2009 at 10:33 AM, Darin Duphorn dduph...@redbrickhealth.com wrote: Yep, That worked, but is there a way to replace BR tags with carriage

[wtr-general] Re: Unable to click link that contains a BR tag between the text

2009-01-13 Thread Darin Duphorn
Also would that work if we had multiple links with the same name? (example) ie.link(:text=/Cholestorol/,:index=2).click Thanks, DD -Original Message- From: watir-general@googlegroups.com [mailto:watir-gene...@googlegroups.com] On Behalf Of Paul Rogers Sent: Tuesday, January 13, 2009

[wtr-general] Re: How to store data from a CSV file into an array

2009-01-13 Thread Margam
Hello everyone, Can anyone help with my previous question. So I am trying to get data starting from a particular row (instead of from the first row) of a CSV file and have not been very successful. Say I want to start getting data from Row 2 and as before Column 2 of my CSV file. I tried the

[wtr-general] Re: How to Verify Name in File download popup

2009-01-13 Thread Bill Agee
Looks like the problem is this line: $text=WinGetText(window_title, ) In this situation, ruby doesn't know where to find the definition for the 'WinGetText' method. So it is probably attempting to invoke the method on the special 'main' object, which fails, resulting in the NoMethodError

[wtr-general] Re: How to store data from a CSV file into an array

2009-01-13 Thread Bill Agee
Hey, One way to do this is to use a counter while iterating over the rows: require 'csv' array = [] row_count = 0 CSV::Reader.parse(File.open('foo.csv')) do |row| row_count += 1 # Don't save the value on the first row next if (row_count == 1) array row[1] end That code will increment

[wtr-general] Re: Best Way for Checking Name Fields?

2009-01-13 Thread rob
Thanks for your suggestion. I work in a Mac environment and the script worked. However, I solved my problem using the .scan method, regex, and an assert. If anyone is curious how I did it, just ask. On Jan 12, 4:59 pm, gem dandy d-l-br...@roadrunner.com wrote: Here ya go rob,

[wtr-general] Re: How to store data from a CSV file into an array

2009-01-13 Thread Karthikeyan Margam
Hello, Thanks for the snippet. IT works. But I guess I should have posed my question differently. The new snippet and the first snippet works great to get every value (from second column) from every row of the CSV file and inserting into an Array. PLease see the attached CSV file. My problem is:

[wtr-general] Re: Please help - getting error 'Unable to locate element'

2009-01-13 Thread H2006
Great !!! It works now..!! Thanks to everyone who helped me. Really appreciate your help. On Jan 13, 5:36 am, gem dandy d-l-br...@roadrunner.com wrote: Here a sample of a working script - Watir 1.6.2 This sample is a quick test to see if the word in the text box has a trailing space (it

[wtr-general] How to create a Hash Table using CSV or FaterCSV

2009-01-13 Thread Margam
Hello All, I have been recently learning to use both the CSV module and the FasterCSV gem to create an array from a CSV file. Say my CSV file(file.csv) looks like this (first row is the header, not used in script): Parameter,Value URL,http://gamil.com Login,mylogin Password,mypassword My script

[wtr-general] Re: Access an object

2009-01-13 Thread wesley chen
We can't use set, exists? and many other methods after comment :element_by_xpath Thanks. Wesley Chen. On Wed, Jan 14, 2009 at 12:46 AM, TCBlues tcbl...@gmail.com wrote: Thanks for your answer. In the case the object is a textField or a listField I'm trying to set the control with:

[wtr-general] Re: How to create a Hash Table using CSV or FaterCSV

2009-01-13 Thread Margam
Follow Up Hello All, After googling for some time, I found an easy way to get the data into an Hash. Thanks to One Mr.Ryan. - hash = {} CSV.foreach('test.csv') do |row| hash[row[0]] = row[1] end - But I have some questions regarding accessing the values

[wtr-general] Re: How to create a Hash Table using CSV or FaterCSV

2009-01-13 Thread Margam
Sorry for asking Ruby questions in Watir group. But figured, somebody would be able to help me. Thanks once again On Jan 13, 5:19 pm, Margam nk.mar...@gmail.com wrote: Follow Up Hello All, After googling for some time, I found an easy way to get the data into an Hash. Thanks to One Mr.Ryan.

[wtr-general] Re: FIrewatir Popup

2009-01-13 Thread Wilson Xu
Hi all, $ff.button(:id, confirm).click this is example code, you need to change the correct id or name value in actual html page, and Sur, you can use same code to work very well in the IE. Wilson Xu On Mon, Jan 12, 2009 at 3:24 PM, Sur surbhi.bh...@tcs.com wrote: Were you able to see my last

[wtr-general] Re: Access an object

2009-01-13 Thread Richard Lawrence
You don't get back the specific object type from element_by_xpath, so some methods don't work. But this works: b = Watir::IE.new b.goto 'http://www.google.com/' txt = b.element_by_xpath(//*...@name='q']) txt.value = 'Richard Lawrence' btn = b.element_by_xpath(//*...@name='btnG']) btn.click So

[wtr-general] Re: How to create a Hash Table using CSV or FaterCSV

2009-01-13 Thread Alex Collins
Margam, This is all to do with the basics of Ruby. It would be well worth working through some of the ruby tutorials. In this case; hash[] On 14 Jan 2009, at 01:19, Margam nk.mar...@gmail.com wrote: Follow Up Hello All, After googling for some time, I found an easy way to get the data

[wtr-general] Re: How to create a Hash Table using CSV or FaterCSV

2009-01-13 Thread Alex Collins
My apologies - knocked send whilst getting onto the train. In this case, you are using the CSV modules to load strings as key/ value pairs into a hash. The important bit being that both the key, and the value when retrieved from the hash will be strings. Let us examines few snippets of your