[wtr-general] Re: click_no_wait fails for button to open modal dialog (Win XP, Ruby 1.8.6.26, Watir 1.6.7)

2010-12-01 Thread Jarmo Pertman
Why are you running your tests in $DEBUG mode anyway? There should be
a lot of information in your console if $DEBUG is enabled all the
time. Do you really need it? It seems to me that you're just doing it
wrong if it's enabled for your whole testsuite...

You can monkey-patch that if it's really needed:

module Watir
  class Element
   def spawned_click_no_wait_command(command)
  command = -e #{command.inspect}
  start rubyw #{command}
  end
end
  end
end

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


On Nov 30, 8:36 am, Arto Vuori vuo...@iki.fi wrote:
 Ah, there seems to be a design decision between debugging
 click_no_wait output and breaking the method in debug mode. The latter
 was confusing, the former was on the other hand very helpful
 initially. Could there be another way of debugging the output of
 click_no_wait, as now it is not possible to run tests (that are using
 click_no_wait) in debug mode at all? Therefore, I must leave my change
 in place.

 --A. Vuori

 On 30 marras, 02:27, Jarmo Pertman jarm...@gmail.com wrote:







  Arto Vuori:
  #click_no_waitis only blocking intentionally when $DEBUG is true. As
  soon as you use it normally (e.g. $DEBUG being false) then start
  rubyw is used to perform the click itself thus the change made by you
  should not be needed and it should work without that either. Just make
  sure that $DEBUG is not true :)

-- 
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] If-Else and loops

2010-12-01 Thread Željko Filipin
On Wed, Dec 1, 2010 at 7:49 AM, Sudeep sudeeppattn...@gmail.com wrote:
 Please can you let me know how to write IF..ELSE and loops in WATIR
 with example??

Watir is just a browser driver implemented in Ruby (programming language).
Watir does not know about loops. Loops are a feature of Ruby. So, as Sharma
said, Google for ruby loop.

Željko
--
watir.com - community manager
watirpodcast.com - host
testingpodcast.com - audio podcasts on software testing. all of them

-- 
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] Opening new browser window from existing one

2010-12-01 Thread Amit Kulkarni
Hi Vishavdeep,
I got my problem solved.yes my app does not have the code to open in new
window.
Actually i totaly misunderstood the attach method.
Now got the concept and problem is solved

Thanks a lot for notifying me.

On Wed, Dec 1, 2010 at 1:20 PM, Sharma Vishav sharma.vis...@gmail.comwrote:

 Hi Amit,

 does your application code has code to open a new window when you click on
 the link. e.g. use target attribute of href tag.

 When you click link manually do you get a new window opened ?  why do you
 want to open a new window from your watir script ?

 cheers
 Vishavdeep

 On Tue, Nov 30, 2010 at 5:13 AM, Amit Kulkarni amitkkulkarni...@gmail.com
  wrote:

 Hello all,
 Can we open a new browser window from the existing one using Firewatir for
 Linux and for Watir for windows:
 Following are my gem versions:

 firewatir (1.6.7, 1.6.5)

 Following is my code:
 require 'rubygems'
 require 'firewatir'
 Watir::Browser.default = 'firefox'
 Browser = Watir::Browser.new
 Browser.goto(http://localhost:3000/users;)
 sleep 5
 *Browser.attach(:title, '/test123/')*
 #Browser.link(:href, /users/new).click
 Browser.text_field(:name, user[name]).set(amit)
 Browser.text_field(:name, user[description]).set(Qa Engineer)
 Browser.select_list(:name, user[role]).select(Hr)
 Browser.radio(:id, user_category_hr).set
 Browser.button(:value, Create).click
 Browser.link(:href, /users).click

 The line which is bold is what i am doing for opening the link in new
 window.Actually this is a link which you can see in the next line which is
 commented.
 Now if i click on the link then it opens in the same window.What i want is
 when i click on the link it should open in new window.
 I have added the *title property* for the link as well

 In the Firefox-Edit-Preferences-tab i have unchecked the tab Open new
 windows in new tab instead

 But when i run the script it error is displayed as
 /usr/lib/ruby/gems/1.8/gems/firewatir-1.6.7/lib/firewatir/firefox.rb:272:in
 `attach': Unable to locate window, using title and
 /test123/(Watir::Exception::NoMatchingWindowFoundException)
 from user_create.rb:9

 When i inspect the link following code is displayed a title=test123
 href=/users/newNew user/a


  --
 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.comwatir-general%2bunsubscr...@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.comwatir-general%2bunsubscr...@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] Handling of Jquery objects by Watir

2010-12-01 Thread the_zonker
Hi guys,

my customers ask me to investigate the possibilities of using Watir
for test automation.
It's assumed that future service site will have a lot of Jquery
elements.
So I try to use Watir for their handling on some Jquery element
examples and faced with the problem for the foolowing Menu bar (please
observe section Example):
http://onehackoranother.com/projects/jquery/droppy/#

I 'm trying to navigate through Menu in the  following way:
1. Click on   Top level 2
2. On mouse over Sub 2 - 2
3. On mouse over Sub 2 - 2 - 3

I'm stopped on step 2. I tried to open sub menu Sub 2 - 2 in several
ways:

irb(main):029:0 ie.link(:text,/Sub 2 - 2/).fireEvent(onmousedown)
= nil
irb(main):030:0 ie.link(:text,/Sub 2 - 2/).fireEvent(onmousedown)
= nil
irb(main):031:0 ie.link(:text,/Sub 2 - 2/).fireEvent(onclick)
= nil
irb(main):032:0 ie.link(:text,/Sub 2 - 2/).click
= 0.025997

But non of them does it.

Please, help me.

Regards!

-- 
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] Handling of Jquery objects by Watir

2010-12-01 Thread Željko Filipin
On Wed, Dec 1, 2010 at 2:23 PM, the_zonker the.zonk...@gmail.com wrote:
 I'm stopped on step 2. I tried to open sub menu Sub 2 - 2 in several
 ways:

Works just fine for me (Mac, Firefox, watir-webdriver[1]):

$ irb
 require watir-webdriver
= true
 browser = Watir::Browser.new :ff
= #Watir::Browser:0x1023ca520 url=about:blank title=
 browser.goto http://onehackoranother.com/projects/jquery/droppy/#;
= http://onehackoranother.com/projects/jquery/droppy/#;
 browser.link(:text = Top level 2).flash
= 10
 browser.link(:text = Top level 2).click
= []
 browser.link(:text = Sub 2 - 2).click
= []

I am using IRB[2] in this example, and sumbenus open just fine.

[1] http://zeljkofilipin.com/2010/01/12/watir-on-webdriver/
[2] http://en.wikipedia.org/wiki/Interactive_Ruby_Shell

Željko
--
watir.com - community manager
watirpodcast.com - host
testingpodcast.com - audio podcasts on software testing. all of them

-- 
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] Handling of Jquery objects by Watir

2010-12-01 Thread Michael


We too have a lot of JavaScript, and the trick to get it all to work
was to use watir-webdriver which fires the events properly for MooTools
and Jquery to work. Watir was very unsuccessful on this front, and
Firewatir was so-so. 

On Wed, 1 Dec 2010 05:23:54 -0800 (PST),
the_zonker wrote: 

 Hi guys,
 
 my customers ask me to investigate
the possibilities of using Watir
 for test automation.
 It's assumed
that future service site will have a lot of Jquery
 elements.
 So I
try to use Watir for their handling on some Jquery element
 examples
and faced with the problem for the foolowing Menu bar (please
 observe
section Example):

http://onehackoranother.com/projects/jquery/droppy/# [1]
 
 I 'm
trying to navigate through Menu in the following way:
 1. Click on Top
level 2
 2. On mouse over Sub 2 - 2
 3. On mouse over Sub 2 - 2 -
3
 
 I'm stopped on step 2. I tried to open sub menu Sub 2 - 2 in
several
 ways:
 
 irb(main):029:0 ie.link(:text,/Sub 2 -
2/).fireEvent(onmousedown)
 = nil
 irb(main):030:0
ie.link(:text,/Sub 2 - 2/).fireEvent(onmousedown)
 = nil

irb(main):031:0 ie.link(:text,/Sub 2 - 2/).fireEvent(onclick)
 =
nil
 irb(main):032:0 ie.link(:text,/Sub 2 - 2/).click
 = 0.025997


 But non of them does it.
 
 Please, help me.
 

Regards!


Links:
--
[1]
http://onehackoranother.com/projects/jquery/droppy/#

-- 
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: variablize ff.link(identifier,keyword).exists?

2010-12-01 Thread dave
http://lovehateubuntu.blogspot.com/2009/04/hungarian-notation-in-ruby.html
--haha... noted...

On Nov 30, 3:17 pm, Charley Baker charley.ba...@gmail.com wrote:
 Symbols and strings aren't interchangeable, but you can convert.

 name.to_sym
 = :name
 :name.to_s
 = name

 The first part of the method argument takes a symbol, not a string:
 sname = name
 ff.link(sname.to_sym,skeyword).exists?

 Not tested, but should work. As an aside, hungarian notation in Ruby
 looks weird and kind of makes no sense. :)

 Charley Baker
 Lead Developer, Watir,http://watir.com

 On Tue, Nov 30, 2010 at 12:41 PM, dave davidrey...@gmail.com wrote:
  Currently,

  ff.link(:name,/google/).exists? works and returns true.

  However, if I variablize things

  sname = :name
  skeyword = /google.

  ff.link(sname,skeyword).exists? returns false.

  Is there any text that states how to go about this?

  Thanks

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


[wtr-general] Re: Option in select

2010-12-01 Thread Shlomit Gazit
The thing is for testing I dont want to go through all the select
options since it is a lot. I want to have only one from each. I have
about 11 select items with varied option titles, and these options are
repeating with different texts, so I want to test only the 11 options.
Is that clear?


On Nov 29, 10:55 am, Chuck van der Linden sqa...@gmail.com wrote:
 Anotheroptionmight be to use the 'select_item_in_select_list'
 method  but from what I'm seeing that only lets you select it by
 either the displayed label (:text) or the underlying value (:value)

 seehttp://rdoc.info/gems/watir/1.6.7/Watir/SelectList#select_item_in_sel...

 Is there a particular reason you need to use title? How would a normal
 user know whichoptionitem in the select list they wanted to choose?

 On Nov 24, 3:35 pm, orde ohil...@gmail.com wrote:



  I don't ever find myself using xpath, but you could look 
  here:http://wiki.openqa.org/display/WTR/XPath

  Hope it helps.

  orde

  On Nov 24, 3:01 pm, Shlomit Gazit shlomitpatr...@gmail.com wrote:

   I am not sure I know how. could I get help on that?

   On Nov 24, 1:16 am, Željko Filipin zeljko.fili...@wa-research.ch
   wrote:

On Tue, Nov 23, 2010 at 8:47 PM, Shlomit Gazit 
shlomitpatr...@gmail.com
wrote:

 Is there anoptionto use title foroption?
 This is the html code:
 optionid=http://semanticweb.databaserepublic.com/c2p/systemData/
 searchField#attachmentTargetItself value=341 title=true,Inner
 Search,^50$|^62$|^56$,attachmentTargetItselfAttachment::/option

Did you try?

Željko
--
watir.com - community manager
watirpodcast.com - host
testingpodcast.com - audio podcasts on software testing. all of them- 
Hide quoted text -

  - Show quoted text -

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