Hey pinkoobhatia, thanks for the clarification of the code - what I meant by
"missing" was those two javascript files you included in your include tags. I
kind of figured that your links were inside of those javascript files
somewhere, but I couldn't see those, so I didn't know exactly where to begin
with helping you possibly solve your problem. So one thing to try when you are
viewing your page is the following:
1. Right click on your page and select View Source
2. Look for the links (<a href=...></a> tags) in the source code
that results. Usually the page source will load up in Notepad or watever you
have selected for it to load up in
If you can see that your links show up there, then all you need to do is find
some attribute, such as the id, name, or innertext, that is unique to each
link, then you can use that in a statement link the following:
ie.link(:someUniqueAttribute, "uniqueAttributeValue").click
where :someUniqueAttribute is eqivalent to :id, :name, :innertext, or whatever
you decide - the ':' is a necessary part of this value and it is not a string,
so no quotes, but you probably already knew that. And where
"uniqueAttributeValue" is the value of the attribute you picked. An example of
link source code follows:
<a href="#" id="newLink" class="blackLink" name="Link to nowhere">This is
my link to nowhere</a>
In the above link the following unique attributes and their values can be seen:
<pre>
attribute value
--------------------------------
:href "#"
:id "newLink"
:class "blackLink"
:name "Link to nowhere"
:innertext "This is my link to nowhere"
</pre>
That said, looking at what you have given me to work with, I'm still unsure
where your link is, or how to identify it myself. One problem with javascript
generated stuff may be the following: If you are generating links or anything
else on-the-fly every time that somebody triggers a specific event, then it's
possible that you'll never see that object. With menus for example, if you
redraw your menu completely and dynamically change the links in your menu, then
you might not be able to see that link until you first fire a mouse over event
and "mouseover" your menu, but if your menu already contains the links and all
you do is change visibility of your menu, then you might still be able to click
on them, but not if their :visible attribute is set to "hidden". To fire an
event like mouseover on a menu you might do something like this, where the menu
is an image:
require "watir"
include Watir
# Create a new browser object
$objWatirBrowser = IE.start("www.mystartpage.com")
# Fire a mouseover event on my menu to activate it
$objWatirBrowser.image(:id, "menu_Help").fireEvent("onMouseOver")
# Now I can see my link, so click on it
$objWatirBrowser.link(:innertext, "About Us").click
Let me know if this has helped you at all.
Nathan
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=5259&messageID=14674#14674
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general