Hi Tony,
Here is the code of the fire_event_no_wait method:
    def fire_event_no_wait(event)
    puts("Inside fire_event_no_wait")
     assert_enabled

     highlight(:set)
     object = "#{self.class}.new(self, :unique_number,
#{self.unique_number})"
     @page_container.eval_in_spawned_process(object +
".fire_event(\"#{event}\")")
     highlight(:clear)
     end

As you can see I've added a "puts" in order to be sure I'm in the right
method.
On a related note: is there a difference between java threads and ruby
threads? It looks like if there is a blocking part inside the ruby thread,
the other threads are stuck, waiting for it to release itself.

On Tue, Aug 25, 2009 at 1:17 PM, Tony <[email protected]> wrote:

>
> Hi Adrian,
>
> Please note - make sure you have edited the element.rb to include
> fire_event_no_wait code.
> Using the above fire_event_no_wait iam able to do a fire event on a
> mousedown.
>
> Here's an example of the mousedown and mouseover event (should work
> with any events)-
> require 'watir'
> iewin = Watir::IE.new
> iewin.goto("http://www.w3schools.com/jsref/tryit_view.asp?
> filename=tryjsref_onmousedown<http://www.w3schools.com/jsref/tryit_view.asp?%0Afilename=tryjsref_onmousedown>
> ")
> img = iewin.image(:xpath, "//img")
> img.fire_event_no_wait("mousedown")
> puts "will return now without waiting for alert box"
> ## wait for a few secs and the alert box will come up ....
>
> sleep 5
> iewin.goto("http://www.w3schools.com/jsref/jsref_onmouseover.asp";)
> img = iewin.image(:alt, "W3Schools")
> img.fire_event_no_wait("onmouseover")
>
> Thanks,
> Tony
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to [email protected]
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to