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,
.
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
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
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
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
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
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).
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
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
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
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
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
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.
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
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
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
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
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
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
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
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
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
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:
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 =
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
::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
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
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
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
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
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...
31 matches
Mail list logo