Manish Sapariya wrote:
> Hi All,
> I am trying to automate sending mail using gmail. I could
> locate the "Compose Mail" div and make it flash using,
>
>
> irb(main):100:0> ie.frame(:name, 
> "main").frame(:name,"v1").span(:text,"Compose M
> ail").flash
>
> However,
> the click() or fire_event("onclick") does not seem to be working.
>   
I have work around, which I think would be helpful to document in form 
of reply.

After playing around the app bit more, I have figured out a way to click 
on "Compose Mail"
You can enable the key board shortcuts and use send_keys("c") for 
compose mail.

About the events though, I am clueless as to why fire_event() did not 
help in this case.
I think following link have clue to the problem, however I dont think I 
quite understand it.

http://ajaxcookbook.org/event-handling-memory-leaks/

What I understand from here is that gmail is registering the event 
handlers dynamically
and I have to figure out, how the registration javascript is invoked. I 
thought mousemove/mouseover
action might invoke this code, but then realize that there are no 
handler for these event themselves,
in the first place.

So event registration for gmail control, which uses addEventListener is 
still mistery to me,
I am on my way to completion using keyboard shortcut though.

I hope I will have enough keyboard shortcut's defined to automate other 
functionality, or else
I will have to start the hunt for finding out the answer to 
addEventListner code invocation.

This brings another question:
Is it possible to dump all javascript code snippets using watir?
I could not find the code for event registration anywhere, though I 
could see lots of SCRIPT
object it was painful to go through them all manually using devtool bar.

Thanks for any help.
Regards,
Manish

_______________________________________________
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to