[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

[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_socket.send(window.confirm=function

[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 example, but when I run

[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' $ie=Watir::IE.new str1

[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

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

2009-05-19 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

[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: 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..

[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

[wtr-general] Re: Test Results Report Methods

2009-04-19 Thread Alex Collins
the expected chinese characters. Thanks. Wesley Chen. 2009/4/18 Alex Collins a.j.collins...@gmail.com 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

[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: 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 are

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

[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 vtulash...@gmail.com wrote: Hi Tiffany,

[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

[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

[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 jeff.kr...@gmail.com wrote: Hello, Can anyone help me pull data out of a csv file and insert it into a SQL

[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

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

[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

[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

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