If that Image map is not inside a FRAME(currently xpath extension doesn't work for FRAMES) you can use XPath extension to identify the element inside image map. You can download the tar ball from the HEAD and read the examples provided in 'Support for XPath in Watir.doc' under the documents directory.
The syntax for identifying the link would be like this:
ie.link(:xpath, [xpath to the link under image map])
Regards,
Angrez
P.S.: This will work only if image map is not inside any frames.
On 1/17/06, Terry Peppers <[EMAIL PROTECTED]> wrote:
First off, I wanted to thank Chris and Brett for responding to my 'Design Problems' question last week. Both comments were incredibly helpful. That, and I had a total RTFM manual moment when it came to creating functions in my test cases. Thanks a ton for the responses.
New question, though. I was digging through the Watir mailing list archive looking for any information about how to access links that are in an image map. Didn't come up with anything and was wondering if there was a way to do this? I've created a function that basically goes through a page, grabs all the links, puts them in an array and then I have another function that takes in that array and clicks all the applicable links. Examples:
def get_links()
@links = Array.new
@ie.links.each do |link|
@links.push(link.href)
end
return @links
end
def click_links(pages)
pages.each do |page|
puts "Step: Click the \"#{page}\" link"
@ie.link(:url, page).click
@ie_pop = IE.attach(:url, page)
@ie_pop.wait
# do some assertions here
@ie_pop.close
end
end
def test_links
@list = get_links()
click_links(@list)
end
I keep printing out the array '@links' in the 'test_links' method and I don't see the links that happen to be in image maps. Do I need to write another function that looks @ at image maps and put those into another array?
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general
_______________________________________________ Wtr-general mailing list [email protected] http://rubyforge.org/mailman/listinfo/wtr-general
