[wtr-general] Re: Getting the text inside the div

2010-01-13 Thread John Kolokotronis
Try ie.div(:class, testing_1).html instead... Regards, John On Jan 13, 10:20 am, Soori sure...@gmail.com wrote: All I am capturing the the text inside a div as mentioned below, divdiv class=testing_1 divtestdata1/div divtest data2/div divtest:data3/div/div ie.div(:class,

[wtr-general] Re: Getting the text inside the div

2010-01-13 Thread John Kolokotronis
. On Jan 13, 11:11 am, Soori sure...@gmail.com wrote: Hi John, .html will return the html with DIV,etc, I would like to get only the text inside the div . Thanks, Soori On Jan 13, 3:30 pm, John Kolokotronis johnj...@gmail.com wrote: Try  ie.div(:class, testing_1).html instead

[wtr-general] Re: Issue trying to click on a span element using safariwatir

2009-11-19 Thread John Kolokotronis
The dot character in a regex (.) is a wildcard so you need to escape it. Try this: browser.span(:text, /butterfly\.m4v/).click Regards, John On Nov 18, 3:35 pm, QAguy qablogm...@gmail.com wrote: I cannot add an id as I don't have control over code decisions unfortunately. So I am forced to

[wtr-general] Re: bring_to_front function not working...

2009-10-06 Thread John Kolokotronis
Maybe try using AutoIT's WinSetOnTop function directly? Like this: require 'win32ole' AutoIt = WIN32OLE.new(AutoItX3.Control) AutoIt.WinSetOnTop([REGEXPTITLE:#...@ie.get_title}], , 1) Regards, John --~--~-~--~~~---~--~~ You received this message because you are

[wtr-general] Re: Fire Watir and Watir and fetch object text

2009-10-01 Thread John Kolokotronis
I've come across this before - there are typically additional characters retrieved using the .text method with FireWatir - you could just use a gsub on the text to strip out the extra characters (if there are no matches, as will be the case for IE, no characters will be stripped out). I think you

[wtr-general] Re: FireWatir works in IRB not in script

2009-09-24 Thread John Kolokotronis
Try adding require 'rubygems' at the very top of your script, before the Firewatir requirement. Regards, John On Sep 23, 10:19 pm, Brad bradask...@gmail.com wrote: I installed FireWatir on the Mac.  I got the mozilla_all_tests.rb to run when I was in the unittests directory.  I can get the

[wtr-general] Re: span class and text

2009-09-17 Thread John Kolokotronis
I'm not too sure what you mean by verifying that span elements are required but you could identify the two separate elements in two ways: 1) Use the second property :index. So, it would something like @browser.span(:class = reqempty, :index = 1) and @browser.span (:class = reqempty, :index = 2).

[wtr-general] Re: A real newbie question

2009-08-26 Thread John Kolokotronis
The first error is the missing double quotes, like Željko pointed out. Your script will still not run though as there are a couple of other errors. You set up the browser like this: $ff = FireWatir::Firefox.new instead of: Ff=Firefox.new (if you use a capital letter, you set up the browser

[wtr-general] How can I add a new method to Watir::Radio?

2009-08-11 Thread John Kolokotronis
Hi All, I thought my understanding of Ruby classes was getting a bit better but I can't seem to add a new method to Watir::Radio, without breaking all functionality for radio buttons... E.g. I tried adding a dummy method like this: class Watir::Radio def myMethod puts this is my method

[wtr-general] Re: How can I add a new method to Watir::Radio?

2009-08-11 Thread John Kolokotronis
Thanks - I noticed the Radio class is in input_elements.rb and tried the structure you suggested before my original post: module Watir class Radio RadioCheckCommon def myMethod puts this is my method end end end But this just generates another error: uninitialized

[wtr-general] Re: undefined method `length' for nil:NilClass

2009-08-11 Thread John Kolokotronis
The local variable i in your last line isn't defined anywhere in your script... So: ie.text_field(:name, productName).set $worksheet.Range(a# {i}).value) i isn't defined so no value is retrieved. If you are trying to retrieve a number of cells, you can do it with a for loop: for i in 1..5 # to

[wtr-general] Re: undefined method `length' for nil:NilClass

2009-08-11 Thread John Kolokotronis
Why are you complicating the loop that much? If you only want cells 1 and 2, use the for i in 1..2 loop or for i in 1...3 (three dots - that'll exclude 3 by definition). But if you include the click in your loop, the 2nd time (and any other iteration) around won't work because you won't be on

[wtr-general] Re: Fire Watir and Safari Watir

2009-08-07 Thread John Kolokotronis
SafariWatir is Mac OS X only - when you install Watir 1.6.2 on a Mac, both SafariWatir and FireWatir get installed. Though for the most part Watir/FireWatir and SafariWatir are API compatible, there are certain differences though these days, Watir and FireWatir are coming closer together.

[wtr-general] Re: Select_list does not select anything

2009-08-06 Thread John Kolokotronis
If you want to use the value, I think you should be doing: ff.select_list(:name, 'fileFormate').select_value('3') Or if you want to use the description (value 3), try this: ff.select_list(:name, 'fileFormate').select(/value 3/) Regards, John

[wtr-general] Re: Differences in behavior between IE and FF3/3.5

2009-07-27 Thread John Kolokotronis
I don't think you can use :alt in FireWatir to identify the control - use xpath instead and it should work in both IE and FF with no changes: browser.element_by_xpath(//i...@alt = 'Members Login Here']).click Regards, John --~--~-~--~~~---~--~~ You received

[wtr-general] Re: Error in running script

2009-07-03 Thread John Kolokotronis
You'll need the require statement, don't remove it. Try updating your gem system with: gem update --system And failing that, try updating windows-pr with: gem update windows-pr I currently have version 0.9.6 installed and working fine with watir 1.6.2. Regards, John

[wtr-general] Re: How can we take screen shot when error occurs?

2009-05-12 Thread John Kolokotronis
Sorry, that second $ie, should be ie to match your browser object, like this: t = Thread.new(){ ie.button(:name, searchSub).click } m = Thread.new(ie) { screen_capture(keywordserror.jpg,true) } m.join t.join --~--~-~--~~~---~--~~ You received this message because

[wtr-general] Re: jssh (firefox) and unicode

2009-05-01 Thread John Kolokotronis
I'm having similar problems working with double byte unicode, like Japanese and yes, I'm certain the problem is with the jssh extension - unfortunately, I don't know of any real solution and given that jssh is abandonware, it's very hard to get any help with it on any platform. Unicode works for

[wtr-general] Re: FireWatir and unicode IDs/input, etc... Works with Watir/IE...

2009-02-23 Thread John Kolokotronis
For anyone interested, I did get this to work after all - I needed to add these two lines to my spec_helper.rb (or whatever setup file you may be using): $KCODE = u WIN32OLE.codepage = WIN32OLE::CP_UTF8 Firefox then works with Japanese, German, etc - though some things are a bit more limited

[wtr-general] Re: FireWatir and unicode IDs/input, etc... Works with Watir/IE...

2009-02-20 Thread John Kolokotronis
Bret, I suspected the JSSH plugin might be to blame but don't know anything about its' internal workings. Does anyone know if it is possible to get it to accept UTF-8 encoding? Is anyone here able to work with unicode input in Firefox? Michael, the problems are with two byte Japanese characters

[wtr-general] Re: Does Watir 1.6.2 install on Mac OS X?

2009-02-19 Thread John Kolokotronis
tried both the built-in Leopard ruby install and the MacPorts ruby installs and neither help me avoid this error from the firewater unittests: require': no such file to load -- watir (LoadError) On Feb 10, 2:28 am, John Kolokotronis johnj...@gmail.com wrote: I have to get back to my Mac

[wtr-general] Re: problem accessing textfield property

2009-02-19 Thread John Kolokotronis
Why do you need to repeat this 20 times? ie.text_fields each iterates through every text field on the page (which could be a pretty significant number) and you are then telling it to do all that 20 times? So if you had 20 text fields, you're now iterating through those 20 times which will of

[wtr-general] FireWatir and unicode IDs/input, etc... Works with Watir/IE...

2009-02-19 Thread John Kolokotronis
Hi All, The application I mostly work with is currently being localized into a number of languages, initially German and Japanese... This is causing a number of problems with my tests but only in FireWatir/Firefox. For example, I need to select an option from select list, like so:

[wtr-general] Re: FireWatir and unicode IDs/input, etc... Works with Watir/IE...

2009-02-19 Thread John Kolokotronis
Furthermore, I tried Željko's solution here: http://zeljkofilipin.com/2007/02/26/enter-non-english-character-in-text-field/ Works perfectly with Watir/IE - I adapted the example for FireWatir: require 'watir' require 'win32ole' Watir::Browser.default = 'firefox' excel =

[wtr-general] Re: Watir and Firefox

2009-02-11 Thread John Kolokotronis
Install the latest version, 1.6.2 - a gem install watir will grab that version anyway... Setting up/selecting your browser is already covered in the wiki which you should refer to for these getting started types of questions: http://wiki.openqa.org/display/WTR/Browser.new Regards, John On

[wtr-general] Re: Does Watir 1.6.2 install on Mac OS X?

2009-02-10 Thread John Kolokotronis
::Browser.default = 'safari' = safari   Watir::Browser.new = #Watir::Safari:0x113a3d4 @scripter=#Watir::AppleScripter:0x1133ed0 @app=app(/Applications/Safari.app), @document=app(/Applications/Safari.app).documents[1], @js=#Watir::JavaScripter:0x1133ea8, @typing_lag=0.08   Bret John Kolokotronis

[wtr-general] Re: How to capture the number of search results?

2009-02-09 Thread John Kolokotronis
Yes, it's very easy to do with a regex - what element is your text returned in though (e.g. div, h1, etc)? If you can grab the text from the element (which can easily be done with Watir), you can use a regex to get the number only. If for example, the text was in a div, you might do something

[wtr-general] Re: Does Watir 1.6.2 install on Mac OS X?

2009-02-09 Thread John Kolokotronis
to launch Firefox? On Feb 9, 8:37 pm, Bret Pettichord b...@pettichord.com wrote: John Kolokotronis wrote: The wiki also still mentions that Mac installation is done with: sudo gem update --system sudo gem install firewatir sudo gem install safariwatir But that doesn't give you common Watir

[wtr-general] Re: Unable to enter integer value in a text_field

2009-02-03 Thread John Kolokotronis
Since you want everything as a string (both numbers and strings), why bother with the to_i conversion to get rid of the decimals? I'd just do this: x=w.application.cells(row_count,col_count)['value'] x.to_s.gsub(/\.\d+/, ) # This will remove anything like .00, . 12345, etc... and leave you with

[wtr-general] [OT] Is anyone here successfully posting to the Rspec group?

2009-02-03 Thread John Kolokotronis
Hi All, Apologies for the OT question, but I cannot seem to get any posts on to the Rspec group @ http://groups.google.com/group/rspec - I've joined the group, start a new post and the topic is reported as posted successfully. However, no trace of my posts exist anywhere on the list/ no mails

[wtr-general] Re: Using Watir TestCase with RSpec - Problem

2009-01-15 Thread John Kolokotronis
I forgot to note that the above code does not contain a valid assertion so the test will always pass. You can fix this with a should statement, like this: $browser.contains_text(rubyforge.org).should != nil # contains_text returns nil if no match is found...