Charley and Bret,
Thank you. If I took a better look at Pickaxe I would save some of your
time. I was trying this (and of course it did not work). If I posted this in
my original post, maybe my mistake would be clearer to you.
div(:name = 'foo', :index = 2)
def div(first, second)
hash =
I was browsing true Watir General forum at OpenQA Forums and I wonder how to
mark Charley's answer as correct. I am logged in (I can edit my posts). I
thought I would see something like mark as correct somewhere, but I can
not find it.
Or is it something that forum administrator does?
--
Zeljko
when you make a new thread you have the option of making it a 'question'. If
you do that then there will be an icon next to each post to mark them as
correct or mostly correct.
Think its too late now though :)
-
Posted via Jive
On 2/9/07, John Lolis [EMAIL PROTECTED] wrote:
Think its too late now though :)
It is. I tried to edit my original post, but there is no option to make it a
message. Thanks for info.
--
Zeljko Filipin
zeljkofilipin.com
___
Wtr-general mailing list
How this works?
ie.div(:name = 'foo', :index = 2).click
I tried to find in Watir source how it is done, but I could not find it.
Could somebody please point me to the right method? It would make sense to
me if the argument was a hash.
ie.div({:name = 'foo', :index = 2}).click
I would like to
Zeljko,
I'm not sure if this is what you are looking for, but here is the source for
`click()` method in Watir:
# This method clicks the active element.
# raises: UnknownObjectException if the object is not found
# ObjectDisabledException if the object is currently
Hi Nathan,
Thanks, but now I see I was not clear enough. I did not want how click
method works (but, once more, thanks for your time). I wanted to know how
are this method arguments handled:
(:name = 'foo', :index = 2)
It would make sense to me if it is a hash
({:name = 'foo', :index = 2})
Zeljko,
The arguments are a hash. Ruby implicitly creates a hash when they're sent
in. I'm not sure how it's not working for you. Try a simple example:
require 'test/unit'
class HashArgs Test::Unit::TestCase
def test_args
implicit_hash(:foo = 'bar', :other_foo = 'other_bar')
end
def
Zeljko,
Possibly this could help, I believe the `getObject( how, what, types, value=nil
)` method could provide some more infromation to you with regards to this
matter:
=begin method=
# This is the main method for finding objects on a web page.
#
# This method is used
Like Charley said, the first form below is automatically understood by
ruby to imply the second. It is a feature of Ruby and there is nothing
special in the Watir library to make this happen.
Bret
ie.div(:name = 'foo', :index = 2).click
ie.div({:name = 'foo', :index = 2}).click
Thought i remembered it from the Pickaxe book, guess I did. :) If you check
out the bottom of the page on this link:
http://www.rubycentral.com/book/tut_methods.html
you'll find a reference to it - Collecting hash arguments. Passing curly
braces to a method can get confused with blocks, so this
11 matches
Mail list logo