[wtr-general] Re: Skip blank rows

2011-04-18 Thread Tiffany Fodor
Hi!

You're almost there.

I use Xls.rb as well and to check for blank rows, I usually use
something like this:

myData.each do |record|
  if record['WHERE'] != ''
ie.frame(:name, "main").text_field(:name,
'account').set(record['WHERE'])
ie.frame(:name, "main").text_field(:name,
'item').set(record['WHAT'])
  end
end

This will skip rows where the 'WHERE' column is blank.

I can't tell how many rows you're importing from your code, so if
you're not already, you may want to limit the number of rows you're
importing from Excel.  I usually bring back about 5-10 rows past where
my data ends so that if I add a couple more rows, I won't have to
change the import range from Excel.  You don't want to bring back all
the rows in the spreadsheet or your framework will need to check each.

Hope this helps!

-Tiffany


On Apr 15, 4:09 pm, mdwin01  wrote:
> Hi-
>
> Could someone help me figure out how to skip over blank Excel rows
> (where the first item in the array is "" or length=0) and continue to
> the next row?  I use xls.rb 
> (http://wiki.openqa.org/display/WTR/Excel+interface+class
> ) to read Excel workbook cells that each contain a formula, where
> everything defaults to "" or zero length blank.
>
> Here's a sample xls (note how second to the last row appears blank):
> Import
> WHERE   WHAT
> Account1        Apple
>
> Account3        Orange
>
> Here's a snippet of my code:
>
> require 'xls'
> require 'rubygems'
> require 'watir'
>
> ie = Watir::IE.attach(:url, 'http://www.blah.com) #reuse existing
> browser window
>
> #Open Excel file, Import worksheet
> xlFile = XLS.new('C:\MyFile.xls') #grab the data file
> myData = xlFile.getRowRecords('Import','Import')  #pull data records
> from Excel
> xlFile.close
>
> myData.each do |record|
>
>   #need something that says if record['WHERE'] = "" or 0 length then
> skip to next row
>   ie.frame(:name, "main").text_field(:name,
> 'account').set(record['WHERE'])
>   ie.frame(:name, "main").text_field(:name,
> 'item').set(record['WHAT'])
>
> end

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


Re: [wtr-general] Re: how to send_keys on firefox or how to simulate Enter on a jumper box

2011-04-18 Thread a b
Hi,

for now I am using Windows7, but I would like to run the tests on MAC OSX
also.

Thanks,
Cristina


On Fri, Apr 15, 2011 at 1:49 PM, Chuck van der Linden wrote:

> What OS are you running on?   what you can use to send keystrokes is
> often dependent on the OS moreso than the browser
>
> On Apr 14, 9:48 am, a b  wrote:
> > Hi all,
> >
> > I was searching on watir google group but I found only:
> > For example: browser.send_keys('{ENTER}')
> > For more info, seehttp://
> wtr.rubyforge.org/rdoc/1.6.5/classes/Watir/IE.html#M000497
> > "
> >
> > The problem is that I am using firefox.
> >
> > Does anyone has an example on how to use send_keys('{ENTER}' on firefox.
> >
> > That is my code
> > Jump:
> >  > id="macjumpbox">
> >
> > Thanks a lot and have a great day!!
> > Cristina
>
> --
> Before posting, please read http://watir.com/support. In short: search
> before you ask, be nice.
>
> watir-general@googlegroups.com
> http://groups.google.com/group/watir-general
> watir-general+unsubscr...@googlegroups.com
>

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] calling screen_capture will throw an error.

2011-04-18 Thread Test0110
Hi,all:

I'm using ruby 1.9.2 and watir 1.8.0.
when i run this scripts:
require 'watir'
require 'watir/screen_capture'
include Watir::ScreenCapture

screen_capture("1.bmp",false,false)


an exception will be thrown: the infomation is like this:
C:/Ruby191/lib/ruby/1.9.1/Win32API.rb:21:in `pack': can't convert
String into Integer (TypeError)
from C:/Ruby191/lib/ruby/1.9.1/Win32API.rb:21:in `block in call'
from C:/Ruby191/lib/ruby/1.9.1/Win32API.rb:19:in `each'
from C:/Ruby191/lib/ruby/1.9.1/Win32API.rb:19:in `each_with_index'
from C:/Ruby191/lib/ruby/1.9.1/Win32API.rb:19:in `call'
from C:/Ruby191/lib/ruby/gems/1.9.1/gems/watir-1.8.0/lib/watir/
screen_capture.rb:54:in `screen_capture'
from test_capture.rb:5:in `'

the error is point to this:  args[i], = [x].pack("I").unpack("i")
if import[i] == "I"


Does anyone met this problem?

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: Released WatirSplash 1.2.0

2011-04-18 Thread Jarmo Pertman
Thank you for the interest. I think that the best resource for usage
is the README [1] file and the wiki [2]. I could write some more
thorough blog post of course, good idea.

[1] https://github.com/jarmo/WatirSplash/blob/master/README.rdoc
[2] https://github.com/jarmo/watirsplash/wiki

Jarmo Pertman
-
IT does really matter - http://www.itreallymatters.net


On Apr 18, 8:56 am, Ekin Han  wrote:
> It is great. Could you send out some samples about how to use it?
>
> 2011/4/18 Tim Koopmans 
>
>
>
>
>
>
>
> > Looks great Jarmo, am keen to give it a try. Will let you know how it goes.
>
> > Cheers,
> > Tim
>
> > @90kts
>
> > On Sun, Apr 17, 2011 at 7:47 AM, Jarmo  wrote:
>
> >> Hello!
>
> >> I've just released the WatirSplash 1.2.0 gem.
>
> >> WatirSplash makes browser-based web page testing in Ruby splashin' easy.
> >> It combines Watir (http://www.watir.com) for controlling the browser and
> >> RSpec (http://relishapp.com/rspec) for testing framework. This powerful
> >> combination gives you
> >> the ability to write easily well-maintained and easy-to-read specs
> >> (specifications in RSpec) so
> >> you don't need to have any extra documentation for your applications.
>
> >> WatirSplash makes it easier to use best features of both of these tools
> >> together so
> >> you won't have to spend time on thinking how to do that yourself - you can
> >> start
> >> testing right away!
>
> >> The most interesting new feature is the #in RSpec matcher, which allows to
> >> write your tests in even better way. Check out the wiki link below.
>
> >> Changelog:
> >>  * fixed Watir::Browser#attach for Watir::IE
> >>  * added #in(timeout) method for all RSpec matchers (read more about it on
> >> the wikihttps://github.com/jarmo/WatirSplash/wiki/RSpec-Features)
> >>  * added #make as an alias for #change as a RSpec matcher
> >>  * bump watir/firewatir dependency to 1.8.1
> >>  * bump watir-webdriver dependency to 0.2.2
> >>  * bump win32screenshot dependency to 1.0.3
>
> >> Install it with:
> >> gem install watirsplash
>
> >> Source code is located at GitHubhttps://github.com/jarmo/watirsplash
>
> >> Jarmo Pertman
> >> -
> >> IT does really matter -http://www.itreallymatters.net
>
> >> --
> >> Before posting, please readhttp://watir.com/support. In short: search
> >> before you ask, be nice.
>
> >> watir-general@googlegroups.com
> >>http://groups.google.com/group/watir-general
> >> watir-general+unsubscr...@googlegroups.com
>
> >  --
> > Before posting, please readhttp://watir.com/support. In short: search
> > before you ask, be nice.
>
> > watir-general@googlegroups.com
> >http://groups.google.com/group/watir-general
> > watir-general+unsubscr...@googlegroups.com

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


Re: [wtr-general] Re: How to Check the Flash Images Using Watir

2011-04-18 Thread Ekin Han
Hi Dan

Is Sikuli only support Jruby?


2011/4/18 Dan Claudiu Pop 

> Hi,
>
> You can switch to Jruby and use Sikuli as a library.
> I use it myself and works pretty well, even included in my cucumber
> steps.
>
> See details here:
> http://www.software-testing.com.au/blog/tag/sikuli/
>
> Dan
>
> On Apr 17, 8:35 pm, illan prem  wrote:
> > Hello Friends,
> >
> > Please How  to Test the Flash Images  Using Watir. please Provide any
> > Notes ..
>
> --
> Before posting, please read http://watir.com/support. In short: search
> before you ask, be nice.
>
> watir-general@googlegroups.com
> http://groups.google.com/group/watir-general
> watir-general+unsubscr...@googlegroups.com
>

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Sending single key presses to element.

2011-04-18 Thread Alastair Montgomery


Hi,
I am looking for a way to send single key presses to an element on the page 
which would work with both FireWatir and Watir.

Is this possible using the (Object) fire_event(event) using the keydown 
event?

I need to do this to interact with a custom jQuery rich text editor which is 
largely event driven.

Been searching all morning for a solution without much success.

Thank you
Al

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: How to Check the Flash Images Using Watir

2011-04-18 Thread Dan Claudiu Pop
Hi,

You can switch to Jruby and use Sikuli as a library.
I use it myself and works pretty well, even included in my cucumber
steps.

See details here:
http://www.software-testing.com.au/blog/tag/sikuli/

Dan

On Apr 17, 8:35 pm, illan prem  wrote:
> Hello Friends,
>
> Please How  to Test the Flash Images  Using Watir. please Provide any
> Notes ..

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com