Generally the functionality you describe is event based..

So there's an element on the page (we'll call this the 'trigger') that
is set to call some client side script when an event like
'onMouseOver' occurs, that client side scripting then re-renders a
part of the webpage causing the thing you want to interact with (call
it the 'target element') to appear or be created.

How this works can vary quite a bit, sometimes the 'target' is there
all along, it's just not set to be visible, sometimes it's just an
animation of sorts, using tricks with images and such, but in that
case the link or other thing is usually there all along, it just looks
visually like appeared becase an image changed.  But generally the
mechanics here are not terribly important, it's enough to know that
the trigger causes 'HTML script magic to happen' of some variety that
enables the target.

So the key is to first figure out what is the 'trigger' element, the
thing reacting to the initial event like the mouseover,   Usually you
can find that using the IE Developer Toolbar, or Firebug, or just by
skimming the HTML for the page and looking for things that have event
actions like onmouseover, onmousedown, onmouseup, onfocus, etc.

Once you have a likely suspect, try a bit of watir code from an IRB
session, and experiement with using the fire_event method on the
'trigger' element, and see if you can get it to do it's thing.. (the
'console' capability in the Watircraft framework rocks for this kind
of experimentation BTW)

Next, (and unless you want to do a lot of script reverse engineering,
this is where the dev-toolbar or firebug are really handy) find the
target elementt such as the link that is rendered/made visible/
enabled  etc when the event occurs, and write the watir code to click
on, or otherwise interact (might be more events) with that object.
You can generally tell if you have the right element on the page if
you've got that part of the DOM displayed in the toolbar, and you can
watch some of it's properties (like visibility style) change as you
move the mouse over the 'trigger' that makes it appear.

Once you've nailed that down, then you can write some watir code that
clicks on, or otherwise works with that 'target' element.

So to summarize
 1) find the trigger element that is responding to initial event, and
fire event at it to 'enable' the target element
 2) interact with the now 'active' target element

To get more specific than that, we'd have to see the HTML for the
portion of the page in question, and perhaps also the script code
that's called by that element when the event occurs..

Better yet, if it's a public site, give us the URL and tell us
specifically where on the site the thing you are trying to control is
located.

On Jul 1, 3:21 am, rrash586 <[email protected]> wrote:
> Hi All,
>
> I want to automate the web apps which having some ajax based
> controls ,like we have in yahoo home page, where if we move the cursor
> to the mail tab automatically we get popup or info about mail tab,
> similarly for astrology,groups etc.
>
> i have applicatuion which is similar to this .i want to click inside
> link which is present on info page ,but by watir i unable to recognize
> the link since it is not vissible till we move cursor to the tab
> first.how i can move the cursor to the specific location using watir
>
> how can i do it ,please let me know .
>
> Thanks in advance
--~--~---------~--~----~------------~-------~--~----~
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