Unfortunately you can't pass parameters to the fireEvent ... all you are doing is telling IE that the event needs to be fired ... IE looks at the event you requested to see if that element has a handler for that event.
 
You can do the multiple criteria, without WET (yes it's more limited, but it does work).
 
$ie.buttons( :alt, "Delete Asset" )[1].click
 
However this still doesn't help with the OP as much as he would like. Truly, I would suggest getting the developers to add an id attribute to these and name it something like delete_#{ item_id } so if the id is 84 then the tag would ge <img id="delete_84" src=""
 
It would make your life MUCH easier, then you simply code for
 
$ie.button( :id, "delete_#{ desired_item_id }" ).click
 
done.
 
With out that, using index is your only real choice. Currently.  When the new version of WATiR hits that has XPath support, you'll be able to find it with:
 
$ie.button( :xpath, "//[EMAIL PROTECTED]'rusure(#{ desired_item_id })\'" ).click  # ( or something like that... ) 
 
My XPath is rusty ... use www.zvon.org  ... great online XPath tutorial.
 
Anyways, the new xpath support is going to open up our world ... just gotta wait a bit longer...

j.
 
On 10/25/05, Sathya Shankar <[EMAIL PROTECTED]> wrote:
Hi Roy.

I think for this case you require multiple parameter to recognzie one
object.  This option is supported in WET.
In WET the syntax would by like this.

Browser("title:=.....").Button("alt:=Delete Asset", "id:=....",
"index:=1").click

I think this should solve your issue.

Regards
Sathya

Roy Sin wrote:

>thanks for the suggestion this will work if there was only
>one image with alt text "Delete Asset". But I have more
>than one images with the same alt text, the only thing that
>differentiate them is the dynamically generated id, that is
>why I'm trying to pass the id. Could I pass the id in the
>onclick in the fire_event method?
>
>
>--- amol deshpande < [EMAIL PROTECTED]> wrote:
>
>
>
>>Hi,
>>try and use the alt attribute.
>>$ie.frame("main").image(:alt,"Delete
>>Asset").fire_event("onclick")
>>AD
>>
>>--- Roy Sin <[EMAIL PROTECTED]> wrote:
>>
>>
>>
>>>Hi All
>>>
>>>I have an image tag like:
>>><IMG alt="Delete Asset"
>>>src="" border=0>
>>>
>>>I tried the following where the variable $theid is
>>>1334
>>>from
>>>above but
>>>
>>>$ie.frame("main").image(:text,
>>>/>>>>
>>>but i get the error
>>>Watir::Exception::UnknownObjectException: Unable to
>>>locate
>>>object, using text and (?-mix:>>>>
>>>thanks in advance for any help on that.
>>>
>>>
>>>
>>>
>>>
>>>
>>>__________________________________
>>>Yahoo! Mail - PC Magazine Editors' Choice 2005
>>> http://mail.yahoo.com
>>>_______________________________________________
>>>Wtr-general mailing list
>>>[email protected]
>>>http://rubyforge.org/mailman/listinfo/wtr-general
>>>
>>>
>>>
>>No Body Has ever Collided With The Sky...So Sky Is The
>>Limit!
>>
>>
>>
>>__________________________________
>>Yahoo! FareChase: Search multiple travel sites in one
>>click.
>> http://farechase.yahoo.com
>>_______________________________________________
>>Wtr-general mailing list
>>[email protected]
>> http://rubyforge.org/mailman/listinfo/wtr-general
>>
>>
>>
>
>
>
>
>
>__________________________________
>Yahoo! Mail - PC Magazine Editors' Choice 2005
>http://mail.yahoo.com
>_______________________________________________
>Wtr-general mailing list
> [email protected]
>http://rubyforge.org/mailman/listinfo/wtr-general
>
>


--
Sathya Shankar M G
Software Testing Engineer
Qantom Software
http://www.qantom.com
Ph : 26799269 Xtn. 123
sip : [EMAIL PROTECTED]


_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general



--
"http://ruby-lang.org -- do you ruby?"

Jeff Wood
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to