Re: [wtr-general] Error opening new Firefox window with Watir-Webdriver

2011-04-26 Thread Željko Filipin
On Tue, Apr 26, 2011 at 1:07 AM, Jari Bakken jari.bak...@gmail.com wrote:
 I would recommend upgrading to Ruby 1.9.2.

Watir-webdriver works on ruby 1.9.2?

Željko
--
watir.com - community manager
watir.com/book - author
watirpodcast.com - host
viaqa.mobi conference on software testing - organizer

-- 
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] Error opening new Firefox window with Watir-Webdriver

2011-04-26 Thread Jari Bakken
On Tue, Apr 26, 2011 at 11:03 AM, Željko Filipin
zeljko.fili...@wa-research.ch wrote:
 On Tue, Apr 26, 2011 at 1:07 AM, Jari Bakken jari.bak...@gmail.com wrote:
 I would recommend upgrading to Ruby 1.9.2.

 Watir-webdriver works on ruby 1.9.2?


Yes.

-- 
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] Error opening new Firefox window with Watir-Webdriver

2011-04-26 Thread Željko Filipin
On Tue, Apr 26, 2011 at 11:06 AM, Jari Bakken jari.bak...@gmail.com wrote:
 Yes.

Good to know, I did not know that. :)

Željko

-- 
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] using drag_and_drop_on with watir-webdriver

2011-04-26 Thread marc betts
One of the big things I like about watir-webdriver is the ability to drag
and drop page elements. This works in version 0.2.0 and seems to have
stopped working with version 0.2.1. I'm trying to figure out if this was by
design, and if so, is there a better way to accomplish what I'm trying to
do.

browser.div(:id=some_div).element.drag_and_drop_on(browser.div(:id=some_other_div).element)

NoMethodError: undefined method `drag_and_drop_on' for
#Watir::HTMLElement:0x33
05838 located=false selector={}

 C:/Ruby187/lib/ruby/gems/1.8/gems/watir-webdriver-0.2.1/lib/watir-webdriver/
elements/element.rb:283:in `method_missing'

Thanks,
Marc

-- 
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] using drag_and_drop_on with watir-webdriver

2011-04-26 Thread Jari Bakken
Hi,

On Tue, Apr 26, 2011 at 2:42 PM, marc betts marcbe...@gmail.com wrote:

 browser.div(:id=some_div).element.drag_and_drop_on(browser.div(:id=some_other_div).element)


When you call Watir::Element#element to fetch the underlying
Selenium::WebDriver::Element instance, you're using a private API that
was changed in 0.2.1:

 
https://github.com/jarib/watir-webdriver/commit/7cee77a7b81d87df1392c43d402d262f5df9ecac

You can still do this by replacing the #element calls in your code
with #wd, but keep in mind that this API is not public (it's marked as
private in the documentation).

We should probably add Watir::Element#drag_and_drop_on directly - feel
free to file that to the tracker:

  https://github.com/jarib/watir-webdriver/issues

-- 
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: using drag_and_drop_on with watir-webdriver

2011-04-26 Thread marc
Jari,
Thanks for the quick reply. I've added the issue to the tracker.
Marc

On Apr 26, 9:04 am, Jari Bakken jari.bak...@gmail.com wrote:
 Hi,

 On Tue, Apr 26, 2011 at 2:42 PM, marc betts marcbe...@gmail.com wrote:

  browser.div(:id=some_div).element.drag_and_drop_on(browser.div(:id=som 
  e_other_div).element)

 When you call Watir::Element#element to fetch the underlying
 Selenium::WebDriver::Element instance, you're using a private API that
 was changed in 0.2.1:

  https://github.com/jarib/watir-webdriver/commit/7cee77a7b81d87df1392c...

 You can still do this by replacing the #element calls in your code
 with #wd, but keep in mind that this API is not public (it's marked as
 private in the documentation).

 We should probably add Watir::Element#drag_and_drop_on directly - feel
 free to file that to the tracker:

  https://github.com/jarib/watir-webdriver/issues

-- 
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] Error opening new Firefox window with Watir-Webdriver

2011-04-26 Thread Abe Heward
Thanks for the info.  Based on what I've seen on the blogosphere, upgrading 
from 1.9.1 to 1.9.2 is not pleasant.

I'll report back my results once I get through it. Not going to be today, 
though, since I have a bunch of regression scripts to run in order to pass a 
release candidate. Not a good day to mess with what works. :-)

Abe

-- 
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: very slow tag iterator

2011-04-26 Thread Chuck van der Linden
at first, both sample has same loop - one

No they do NOT have the same loop.  Yes they each have one loop, but
in the first case you are iterating through the loop once for every
checkbox in the system, and you are retrieving the ID and doing a
regex compare, and then maybe doing a set.   If there are 111
checkboxes, you do the loop 111 times

In the second you are pre-filtering as it were, and passing to the
loop ONLY the checkboxes that have ID's that match.  So if there are
only 11 checkboxes that match the ID pattern, it only does the loop 11
times.  Furthermore what's inside the loop is simpler, it's just
setting the checkbox

If you don't believe me, create an iterator for each loop and have it
do a puts of the iteration number every time it goes through the loop.

In your 'test' code you have no 'control' to compare against, and
things are bound to be different since there is no interacting with
the DOM or the browser.  So instead you should compare what you did,
with a pre-filtered loop that does basically the same thing
(increments cc.. the only 'work' being done by the loop)

If we let cc+=1  stand in for the operation being done by the loop,
then to get a true comparison, compare the 20 seconds to do the loop
you had in your test code, to the time to do something like this

src = array of 111 elements

def Z1(src)
  cc=0
  src.each do |l|
cc+=1
  end
  cc
end

Neither one includes the time it takes to 'create' the array that is
being processed, which is another aspect of the time involved, however
given the 3 second time of the second approach, I think we can safely
assume that the .elements method is able to build it's list of
matching elements fairly rapidly.

OTOH the other loop, the list of checkbox objects may not contain the
ID information.  I don't have enough info to know what information is
actually included inside the collection returned by .checkboxes, to
know if this is the case or not, but potentially c.id is acting like a
method (as opposed to a property) and having to go to the dom and get
that info each time, which could be adding time, and then the system
has to do the regex compare as well.



On Apr 25, 4:05 am, Sergey Erokhin sergey.erok...@gmail.com wrote:
 sorry joedio, but you are wrong ;)

 at first, both sample has same loop - one
 and faster example has much more regexp (each checkox placed in
 different table cell, and a lot of different elements on page)

 and if in slow code add printout (like puts c.id, each next puts get
 more time, looks like each next took time of all previously and self
 time)

 and especially for you

 src = array of 500 elements where 111 match regexp

 def Z1(src)
   cc=0
   src.each do |l|
     next unless l =~ /ctl00_cph_rpt.*?Notif.*?_eml_ctl\d+_chkEmail/
     cc+=1
   end
   cc
 end
 Benchmark.bm(7) do |x|
   x.report(z1:)  { (1..1).each { Z1($src) }}
 end
              user     system      total        real
 z1:     20.50   0.01  20.51 ( 20.515719)

 execution time about 20 second, there a MUCH more regex and loops than
 in my first code ;)







  I wouldn't say its a bug, but that its a fine example of how
  different coding techniques can affect performance.
  Thus it makes sense that the second example will run faster:
      Less loops means faster execution
      Fewer RegExp checks also means faster execution

-- 
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: Watir simple field recorder

2011-04-26 Thread Babitha
I know Watir community does not like recorders - I read about it in
Wikipedia.

This script is not exactly a recorder per say. I would call it a
Object repository builder - if that appeals better to the Watir
community. It helps you get around the mundane task of using Firebug
or Developer tool bar to identify each element ids/names. Moreover, it
is written in a very object oriented way.

I have uploaded it at http://pastie.org/1837926. Thanks Darryl for
that info.

Željko, I suggest you try it. It will not solve your complex field
identification problems where you still have to use Firebug/Developer
Toolbar; but it will ease your development effort a lot; especially if
you have a form based application with lots of data entry fields.

Thanks
Babitha



On Apr 21, 1:46 am, Željko Filipin zeljko.fili...@wa-research.ch
wrote:
 On Fri, Apr 1, 2011 at 7:26 PM, Babitha babitha.augus...@gmail.com wrote:
  I could share this script if anybody was interested. But, I am not
  sure where I can upload it.

 You will find that Watir community does not like recorders. You can upload
 it on your site, github, or you can take over watir recorder project at
 openqa.org.

 Željko
 --
 watir.com - community manager
 watir.com/book - author
 watirpodcast.com - host
 viaqa.mobi conference on software testing - organizer

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