[wtr-general] Re: FireWatir bug/anomaly

2009-04-12 Thread Alex Collins
I've just had a quick look, also on FF3/Mac. The issue is not that the select_list element is invisible - you can address it correctly as show by calling: @browser.select_lists or @browser.select_list(:id, 'cAbb') Calling the "methods" method on the element reveals that the "set" method you

[wtr-general] Re: the ie.goto() problem

2009-04-12 Thread Alex Collins
I believe that the issue is that you are passing in an Array into goto, when it expects a string: http://wtr.rubyforge.org/rdoc/ - look at the Watir::IE class' goto method. You create an array on the following line: thisLocation = folderLocation, i Explicitly stated, you can read this as: thi

[wtr-general] Re: FireWatir bug/anomaly

2009-04-13 Thread Alex Collins
On 13 Apr 2009, at 19:59, Bret Pettichord wrote: > I think there are 2 bugs here. > > 1. Firewatir does not issue an error when users use undefined methods. Agree with this. I had a quick look but my trivial catch-all patch breaks various tests. I'll have a look tomorrow at fitting this into

[wtr-general] Re: Test Results Report Methods

2009-04-18 Thread Alex Collins
Wesley, You need to tell Ruby to support the characters using the $KCODE global variable . The following works for me. $KCODE = 'utf-8' require 'watir' require 'fastercsv' FasterCSV.open("file.csv", "w") do |csv| csv << ["row", "of", "CSV", "data"] csv << ["你好吗?", "我很好"] end Best w

[wtr-general] Re: Test Results Report Methods

2009-04-19 Thread Alex Collins
e csv by fastercsv, I can get the > expected chinese characters. > > Thanks. > Wesley Chen. > > > 2009/4/18 Alex Collins > Wesley, > > You need to tell Ruby to support the characters using the $KCODE > global variable . The following works for me. > > $KCOD

[wtr-general] Re: jssh error - Watir::Exception::UnableToStartJSShException

2009-04-23 Thread Alex Collins
Emily, Are you running a 64 bit version of ubuntu? The JSSH plugins available are 32-bit only, I believe: http://code.google.com/p/firewatir/issues/detail?id=38 You can compile your own extension: http://blog.baroquebobcat.com/2009/01/06/jssh-firefox-ubuntu-64bit/ If you're not sure, could y

[wtr-general] Re: Rescue

2009-04-26 Thread Alex Collins
John, Asking the obvious, if you don't want the code to run, why not remove it or comment it out? I'm not entirely sure what you are after, so a general response which I hope may still be useful. Firstly, the protected code block has the structure: begin expr.. [re

[wtr-general] Re: Saving xml contents of a page shown on screen

2009-05-18 Thread Alex Collins
Natasha, This is where you need to use a little natural Ruby. For example: filename = 'output.xml' File.open(filename, 'w').write browser.html Another useful style is: File.open(filename, 'w') do |output| output.puts "Whatever I want to put in the file." end Hope this helps. Alex On

[wtr-general] Re: no such file to load -- firewatir

2009-05-18 Thread Alex Collins
Are you sure that the gem is installed correctly? Can you check that firewatir is listed when you run "gem list". If firewatir is not shown, you may have installed it as a particular user and not system-wide. Try "sudo gem install firewatir" to fix this. Alex On 18 May 2009, at 20:25, Josh w

[wtr-general] Re: html method on watir don't return the real html

2009-05-20 Thread Alex Collins
Perhaps you should try using AutoIt (several examples in this groups recent history) to: send Ctrl-S to save the file set the filename in the text box press the save button Inelegant, but should work. There is a useful tool in the full AutoIt installer that helps you identify the windows an

[wtr-general] Re: Trying to override :waitTime in Firewatir via .yml config file

2009-05-20 Thread Alex Collins
Alan, I've just had a very quick poke around and although I think that the code ought to allow you to do this in the manner you are doing, I don't think it is implemented for Firefox. I think there should be an options() method on the Firefox class / instance (didn't pay much attention) to

[wtr-general] Re: Watir - some VERY slow functions

2009-05-21 Thread Alex Collins
Paul, I just put a quick performance page with 200 radio elements on. Using Watir 1.6.2 in a Windows XP Virtual Machine it took me just under 5 seconds to iterate over all of them and print the values. I agree that it did seem to run more slowly per element by the end. Could you possibly cr

[wtr-general] Re: Weirdness when working with multiple Firefox windows - using Watir::Browser

2009-05-21 Thread Alex Collins
Alan, I've tried this on my multiple browser branch (the post you linked to below) and can confirm that the code works correctly. Best wishes, Alex On 21 May 2009, at 22:04, Alan Ark wrote: > Thank Bill. > > I found more info here: > > http://rubyforge.org/pipermail/wtr-development/2009-May

[wtr-general] Re: How to execute the single comment?

2009-05-25 Thread Alex Collins
Wesley, Replace exec() with eval() - this will run (evaluate) the Ruby code you provide as an argument to it, in the current context. Best wishes, Alex Collins On 25 May 2009, at 11:56, Wesley Chen wrote: > Hi, guys, > I have the requirement like: > require 'watir'

[wtr-general] Re: Install/Uninstall

2009-05-27 Thread Alex Collins
Hudson is also worth a look - very easy to set up and use. Alex Collins On 27 May 2009, at 18:43, orde wrote: > > Sounds like you are describing a continuous integration testing > model. I believe that some contributors to this group have endorsed > cruisecontrolrb previou

[wtr-general] Re: Noob problem

2009-05-28 Thread Alex Collins
You may need to add require 'rubygems' to the top of your script, depending upon how ruby has been installed for you. Alex Collins On 28 May 2009, at 00:31, James wrote: > > I finally got watir and ruby installed I believe. I am now trying to > do the google seach exam

[wtr-general] Re: override js confirm FireWatir

2009-06-02 Thread Alex Collins
Aidy, I'm guessing and not strong on Javascript, but might it be the lack of a semi-colon after 'return true'? Best wishes, Alex Collins On 2 Jun 2009, at 17:03, aidy lewis wrote: > > Hi, > > I am trying to override a js confirm in FireWatir: > > $jssh_soc

[wtr-general] Re: Need help on jssh installation for firefox

2009-06-03 Thread Alex Collins
Chethan, Could you try the version of the JSSH plug-in available here, please? You'll need to download this as a file. http://github.com/ajcollins/JSSH-XPIs/raw/7dd112a4defb3a61d1f94d9f95a9d4ecaaedb5f7/plugins/jssh-20090517-WINNT.xpi Also, are you running Firefox with multiple profiles? If so,

[wtr-general] Re: How to check an image source and then click a link when looping though all cells of a table

2008-10-22 Thread Alex Collins
As a cell is a container, you can use: cell.image(:index, 1) To access the first image within the cell. You should be able to use any of the other recognition methods, as usual. Hope this helps, Alex On 22 Oct 2008, at 22:33, niartseoj <[EMAIL PROTECTED]> wrote: > > Hello, > > I am using t

[wtr-general] Re: Trouble getting at Unordered lists (Rad Control)

2008-11-03 Thread Alex Collins
I would suggest reading the tutorial on the watir website / wiki to give you a good basic feel for how to use watir. You can recognize the link directly, rather than needing to use the li tag. You will want something like: browser.link(:id, 'ctl000...').click The quick reference page of wat

[wtr-general] Re: Need help on installing Rails

2008-11-11 Thread Alex Collins
For the rails aspect, you should probably search / ask a rails group. However, you should be able to install two versions of ruby - and use a custom PATH variable for the command window you start watir in to point to the older version on ruby. You will obviously need to ensure that you Use t

[wtr-general] Re: Watir & Ruby in Steel

2008-12-01 Thread Alex Collins
Try putting bracket around the *args. You could read the *args as being "any number of arguments to the method". On 1 Dec 2008, at 19:09, Chuck vdL <[EMAIL PROTECTED]> wrote: > > OK so I went and looked.. it's not javascript > > -=-=- snip-=-= > class Radio < RadioCheckCommon > def initiali

[wtr-general] Re: Unable to find the value "blah..." within a listbox. Value is retrieved from excel cell

2008-12-01 Thread Alex Collins
This is because in Excel you likely have the ellipsis character (...) as a single character not three separate period chracters (.). Ruby (and therefor Watir) doesn't support character sets / unicode as one might expect. Therefore you receive the á character instead. Try pasting the value in

[wtr-general] Re: Capturing data within an xml

2008-12-04 Thread Alex Collins
A useful general principle if you are wondering if something will work is to try it. In Ruby, start IRB (type irb at the command line) then type your ruby code. Irb will show you the results after each line. You do not need $ signs (ruby global variable) but you must certainly quote your s

[wtr-general] Re: Know how to make a screencast?

2008-12-08 Thread Alex Collins
Pete, I have been considering doing just this for a short while. I am awaiting the return of my laptop but once this is back intend to try my hand at a screencast. For the moment, I was thinking a basic introduction to WATIR and it's capabilities, with specific details being addresses in la

[wtr-general] Re: Problem installing safariwatir on OS X version 10.5.5

2008-12-19 Thread Alex Collins
Have you installed the developer tools? These are available on the OS X install CD or you can download them from ADC. Alex On 19 Dec 2008, at 19:38, Margam wrote: > > Hello all, > I am trying to install safarwatir on a Mac machine with OS X ver > 10.5.5. But have been unsuccessful for the pa

[wtr-general] Re: Pulling hair out on screen scraping

2009-01-03 Thread Alex Collins
Michael, A fairly rapid reply, so my apologies if it sounds a little terse. A clearer, succinct email would be helpful, rather than unduly elaborating on your difficulties finding things. My immediate thought is that you are trying to run before you have learnt to walk. I would: - Learn th

[wtr-general] Re: Does Watir support

2009-01-04 Thread Alex Collins
On 4 Jan 2009, at 07:13, Chuck vdL wrote: > >>> 5.Can be used for Load Testing? > Following from Chuck's points which are all valid, I have had success in using WATIR to write the script for a load test. Having written the script doing what you would like, play this into jmeter using the p

[wtr-general] Screencast: an introduction to WATIR

2009-01-04 Thread Alex Collins
After an exquisite amount of procrastination, alteration and working around defects, I’ve completed my first screencast. I've aimed to provide a reasonable first-glance coverage of WATIR including the ubiquitous Google-search example which I have also separated out as a short. I've posted

[wtr-general] Re: Does Watir support

2009-01-05 Thread Alex Collins
s you could do via simple http capture and playback are not > normally the things that cause load issues.. so it's good for really > basic tests, but again not terribly useful for most serious > loadtests. > > > On Jan 4, 3:35 am, Alex Collins wrote: >> On 4 Jan 200

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

2009-01-12 Thread Alex Collins
That means that your $ie variable is nil. Which in turn means that you haven't successfully started a browser. You should have a line like: $ie = Watir::Browser.new This line starts the browser and connects it to $ie variable for you to use. The open() method may be used instead, I believe.

[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 wrote: > > Follow Up > Hello All, > After googling for some time, I found an easy way to get the data into > an Hash.

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

[wtr-general] Re: count the number of elements (without divs.find_all)

2009-02-10 Thread Alex Collins
Michael, The scan method is part of the String class. If you look at the rdoc for the classes you can find some very useful methods. The pickaxe book and other ruby tutorials are also helpful. Alex On 10 Feb 2009, at 16:14, Michael Hwee wrote: > > > Very cool, Jarmo. > If you don't mind, c

[wtr-general] Re: Advice on finding/clicking an image element

2009-02-10 Thread Alex Collins
Several options, the simplest of which is to use the image method. web_browser.image( :src, /plus.gif/ ).click You may need to use xpath or multiple attributes to get the second or third image. Hope this helps. Alex On 10 Feb 2009, at 23:44, rollo wrote: > > Hello, Watir Folks. I've been

[wtr-general] Re: using data from a csv file

2009-02-11 Thread Alex Collins
Do a quick search on Google for CSV::Loader - this will allow you to load a csv easily. You can then substitute values into your query as desired. On 12 Feb 2009, at 00:53, jtk wrote: > > Hello, > > Can anyone help me pull data out of a csv file and insert it into a > SQL query? > > I am tr

[wtr-general] Re: "On Error Resume Next" - Equal statement in Ruby

2009-02-12 Thread Alex Collins
I do not believe Ruby has a direct equivalent. I think that is a good thing. By using such statements you are avoiding and concealing errors. You are not handling them. I'm unsure why you want this? Perhaps you could describe the problem you're facing rather than the solution you use in VB?

[wtr-general] Re: using data from a csv file

2009-02-12 Thread Alex Collins
tion by > simply Googling CSV::Loader > > On Feb 12, 12:43 am, Alex Collins wrote: >> Do a quick search on Google for CSV::Loader - this will allow you to >> load a csv easily. You can then substitute values into your query as >> desired. >> >> On 12 Feb 2009,

[wtr-general] Re: Drop down Contents

2009-02-12 Thread Alex Collins
You can compare arrays very easily in ruby use the == method. I think order matters so you might wish to sort (.sort) your array. There is a method on a select box to get all of the options ( .options() ). This returns an array. You can then store your expected results in an array and compare

[wtr-general] Re: Drop down Contents

2009-02-12 Thread Alex Collins
Interesting. I found the options() method from the rdoc. However, I do not get the behaviour I expect. Use getAllContents() instead; this does return an array, as expected. Alex On 12 Feb 2009, at 19:15, Jason Shelton wrote: > I tried the following code, and I am getting the undefined metho

[wtr-general] Re: Package creation

2009-03-13 Thread Alex Collins
Vikas, Ruby probably isn't what you're looking for in that case. Although I have previously seen some options for creating executables from Ruby code. I don't have any links or information on them. Alex On 13 Mar 2009, at 04:05, Vikas Tulashyam wrote: > > Hi Tiffany, > > Thanks for the tim