Re: [wtr-general] access ul and li elements in below html..

2011-03-14 Thread Сергей Демьянчук
*1.
*control = browser.text_field(:id, Cars)
control.lis.each do |li|
  li.flash
  li(:text, 'Toyota').link(:index, 1).attribute_value(href)
  # li(:text, 'Toyota').link(:index, 1).click
end

*2.*
list.ole_methods if list.ole_object != nil

*3.*
http://www.w3schools.com/xpath/default.asp

Best regards,
Sergii

2011/3/14 Girish girish.bha...@gmail.com

 Hey All,

 Here is a piece of html
 ul id=Cars
   li class=selecteda href=/landing/toyota spanToyota/
 span/a/li
   lia href=/landing/hondaspanHonda/span/a/li
   lia href=/landing/nissan spanNissan/span/a/li
  /ul

 I have 3 questions:
 1. How would i iterate over all the li elements and get reference of
 the href element and click on it?
 2. I tried  list=ie.elements_by_xpath(//ul[@id='channelnames']/li)
   when i try to print  values of list, i get #WIN32OLE:0x3225e40.
   Where can i get properties for WIN32OLE?
 3. Where can i get more documentation on accessing elements by XPATH?

 Can anyone guide me ?

 --
 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.comhttp://groups.google.com/group/watir-general%0awatir-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: Recent Stack Overflow Questions Tagged Watir

2011-03-14 Thread Željko Filipin
http://stackoverflow.com/questions/5285776/how-do-i-check-for-text-inside-a-div

-- 
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: Re-Usable Load Testing with Watir : Optimize loadtester.rb

2011-03-14 Thread Chuck van der Linden
Generally speaking, in order to handle a large pool of threads and be
able to scale the load, most loadtesting is done at the protocol
(HTTP) level, not using full blown browser based clients.

Since most load is not from simple page hits against static or cached
pages, you need to actually be interacting with the server as would a
large number of unique users.  Most decent webservers can serve cached
copies of a static page until the pipe saturates without overloading
the server or the back end.  So having 200 users doing the same
search, doesn't create the load you need.

So what you need is a system where thread to use its own unique data,
so you can simulate a hundred different users, shopping for 80-100
different items, or doing different searches or whatever.  (and 100 is
just to start, a true loadtest often simulates interacting with many
thousand users over a period of an hour or so)

While I might use Watir to conduct a functional test DURING a
loadtest, I would not use it to apply the load.

Despite the existence of the example, I personally would not do
loadtesting with watir.  I'd use something like the loadtesting tool
in VS2010, Jmeter, or if you can afford it, Loadrunner.  (which one
would work best and provide the best bang for the buck depends on your
server environment)

On Mar 11, 10:30 am, pierrelebai...@gmail.com
pierrelebai...@gmail.com wrote:
 Hi,

 to see there are realy diffrent thread that are running change :
 ...(Thread #{i} executed...
 by
 ...(Thread #{Thread.current} executed ...

 in log file information for loadtester.rb which can be download here :

 http://wiki.openqa.org/display/WTR/Re-Usable+Load+Testing+Example

 best regards,
 plebailly

-- 
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: error message

2011-03-14 Thread Chuck van der Linden
I agree.   The other possibility is that the server is sending
different HTML, perhap using an older technique like frames etc, to do
something that is done another way in FF, but can't be done that way
in IE, because IE doesn't support it.

You might want to view source, and save it for both pages, and then
compare it with a diffing tool to see if there's an obvious difference

Since it looks like you are trying to click an 'about us' link, I'd
also check to be sure there is not more than one of them on the page,
and maybe you need something else to better nail down which one to
click.


On Mar 11, 4:54 am, Basim Baassiri ba...@baassiri.ca wrote:
 It would very very helpful if you provided the code that generated this
 exception

 My gut feeling is that you are using something incorrectly

 Did you read any of the exampleshttp://wiki.openqa.org/display/WTR/Cheat+Sheet

 On Fri, Mar 11, 2011 at 6:29 AM, tsd mail...@testsitedaily.com wrote:
  hi
  I am trying to run a watir script in internet explorer and getting
  this messge . the same script with the required browser changes works
  fine with firefox . I use vista .

  c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:56:in
  `assert_ex
  ists': Unable to locate element, using :href,
  Aboutus.aspx (Watir::Exception::
  UnknownObjectException)
         from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/
  element.rb:288
  :in `enabled?'
         from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/
  element.rb:60:
  in `assert_enabled'
         from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/
  element.rb:233
  :in `click!'
         from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/
  element.rb:219
  :in `click'

  --
  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: Re-Usable Load Testing with Watir : Optimize loadtester.rb

2011-03-14 Thread Tim Koopmans
Personally I've used WatirGrid[1] with great success, I used it to drive 50
browsers concurrently. 50 is not the ceiling, I was just limited by how many
boxes I had at hand.

The limitation with browser based testing is the resources required on which
to drive the browsers! BrowserMob have reduced this (but they only support
Selenium). I'm thinking of something similar for Watir users. I've also been
experimenting with headless tests (watir-webdriver with htmlunit) with a
fair amount of success, which increases your bang-for-box. I'll talk about
some of this at Watir day in any case.

In my experience, not every load test is thousands of users. I've load
tested some awful intranet apps that have fallen over well before 100 users
... So you may get some mileage out of Watir yet ... Protocol level testing
is probably better for load tests with thousands of users though based on
bang-for-box. I expect there's an undiscovered sweet spot somewhere there
where the cost per vuser shifts in favour of protocol level (when using
commercial licensed tools) testing.


Cheers,
Tim

@90kts
https://github.com/90kts/watirgrid/blob/master/EXAMPLES.rdoc


On Tue, Mar 15, 2011 at 4:21 AM, Chuck van der Linden sqa...@gmail.comwrote:

 Generally speaking, in order to handle a large pool of threads and be
 able to scale the load, most loadtesting is done at the protocol
 (HTTP) level, not using full blown browser based clients.

 Since most load is not from simple page hits against static or cached
 pages, you need to actually be interacting with the server as would a
 large number of unique users.  Most decent webservers can serve cached
 copies of a static page until the pipe saturates without overloading
 the server or the back end.  So having 200 users doing the same
 search, doesn't create the load you need.

 So what you need is a system where thread to use its own unique data,
 so you can simulate a hundred different users, shopping for 80-100
 different items, or doing different searches or whatever.  (and 100 is
 just to start, a true loadtest often simulates interacting with many
 thousand users over a period of an hour or so)

 While I might use Watir to conduct a functional test DURING a
 loadtest, I would not use it to apply the load.

 Despite the existence of the example, I personally would not do
 loadtesting with watir.  I'd use something like the loadtesting tool
 in VS2010, Jmeter, or if you can afford it, Loadrunner.  (which one
 would work best and provide the best bang for the buck depends on your
 server environment)

 On Mar 11, 10:30 am, pierrelebai...@gmail.com
 pierrelebai...@gmail.com wrote:
  Hi,
 
  to see there are realy diffrent thread that are running change :
  ...(Thread #{i} executed...
  by
  ...(Thread #{Thread.current} executed ...
 
  in log file information for loadtester.rb which can be download here :
 
  http://wiki.openqa.org/display/WTR/Re-Usable+Load+Testing+Example
 
  best regards,
  plebailly

 --
 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] Re: Windows IE9 support?

2011-03-14 Thread A.Denter
I got exactly the same problem with IE9 (rc). Even with the very
simple google script that works on all the other IE versions:
...
require 'rubygems'
require 'watir'
b = Watir::Browser.new
b.goto 'www.google.com'
b.text_field(:name = 'q').set '\alien life forms\'
b.button(:name = 'btnG').click
b.close
...

Any help would be greatly appreciated! :)

Andy
On 11 Mrz., 00:53, Trampus Richmond trichm...@sugarcrm.com wrote:
 As anyone looked into this?  It is still and issue for me.

 Thanks,
 --Trampus

 On 2/11/11 4:11 PM, Trampus Richmond trichm...@sugarcrm.com wrote:

 The following code works fine with FireFox, IE8, but not with IE9RC.  The 
 code finds the button control as it never throws an exception, but the button 
 is never clicked.

 require 'rubygems'
 require 'watir'

    Watir::Browser.default = ie
    b = Watir::Browser.new()
    b.goto(http://www.twistedminds.org/sugarcrm;)
    b.text_field(:id, user_name).set(guest)
    b.text_field(:id, user_password).set(guest)
    sleep(2)
    print Clicking...\n
    b.button(:id, login_button).click()
    print Finished clicking.\n
    print Sleeping...\n
    sleep(6)
    print Done...\n

-- 
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] Watir Book

2011-03-14 Thread Željko Filipin
Hi,

I have started writing a book on Watir. My family has agreed that I can work
on the book for about 8 hours almost every Saturday.

The source (markdown) will always be free at Github[1] and I plan to sell
the pdf for $9. I know I will not get rich by writing a book on Watir, but
some money would be nice.

Version 0.1.1 of the pdf is available now[2], for free.

If you think there needs to be a book on Watir, and you think I am the right
person to write it, feel free to buy the book now[3]. You will get all
updates to the book for free. (Well, version 0.1.1 can be downloaded for
free anyway.)

I promise I will not take the money, spend it on beer and never write the
book. :)

If I see I will not finish the book, I will return the money. Also, if you
buy the book and you do not like it, I will return the money.

If you like the idea, but do not have $9, feel free to send any amount to
zeljko.fili...@gmail.com via Paypal. You can also donate to the book via
Flattr[4]. I appreciate any amount.

Željko
--
[1] https://github.com/zeljkofilipin/watirbook
[2] https://github.com/zeljkofilipin/watirbook/downloads
[3]
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclickhosted_button_id=WVJATC56MJS3N
[4] https://flattr.com/thing/147956/Watir-Book

-- 
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] Watir Book

2011-03-14 Thread Tim Koopmans
Just bought a copy! Well done Željko for taking the initiative. I look
forward to the end result =)

Cheers,
Tim

@90kts



On Tue, Mar 15, 2011 at 11:12 AM, Željko Filipin 
zeljko.fili...@wa-research.ch wrote:

 Hi,

 I have started writing a book on Watir. My family has agreed that I can
 work on the book for about 8 hours almost every Saturday.

 The source (markdown) will always be free at Github[1] and I plan to sell
 the pdf for $9. I know I will not get rich by writing a book on Watir, but
 some money would be nice.

 Version 0.1.1 of the pdf is available now[2], for free.

 If you think there needs to be a book on Watir, and you think I am the
 right person to write it, feel free to buy the book now[3]. You will get all
 updates to the book for free. (Well, version 0.1.1 can be downloaded for
 free anyway.)

 I promise I will not take the money, spend it on beer and never write the
 book. :)

 If I see I will not finish the book, I will return the money. Also, if you
 buy the book and you do not like it, I will return the money.

 If you like the idea, but do not have $9, feel free to send any amount to
 zeljko.fili...@gmail.com via Paypal. You can also donate to the book via
 Flattr[4]. I appreciate any amount.

 Željko
 --
 [1] https://github.com/zeljkofilipin/watirbook
 [2] https://github.com/zeljkofilipin/watirbook/downloads
 [3]
 https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclickhosted_button_id=WVJATC56MJS3N
 [4] https://flattr.com/thing/147956/Watir-Book

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