Your problem is how to access an element for which there is no class in WATiR. You can use XPATH extension of WATiR which will be availabe in v1.5 or you can always download the tar ball from HEAD. By using XPATH extension you can get any element by using an XPATH _expression_.
For elements having class in WATiR a new attribute (:xpath) for selecting element is added. But for elements not having class, you can use function element_by_xpath of IE class to get the underlying OLE Object.
In your case it would be something like this:
ie.element_by_xpath("//area[contains(@href , 'PieChart.html')]/").click()
For more details refer to the "XPath suppoort in Watir.doc" under the doc section in CVS.
Regards,
Angrez
On 12/19/05, Amitha Shetty
<[EMAIL PROTECTED]> wrote:
Hi,The screen under test has a piechart.HTML source for this Chart has Map and Area tags. This Chart has link on one of its portions.How do I click on this link using Watir?I want to access this chart.HTML for the chart is as shown below:<table width="100%" border="0" cellpadding="0" cellspacing="1">
<MAP NAME="chart">
<AREA SHAPE="POLY" COORDS="150,16,159,17,168,20,175,25,182,32,150,56,150,56" >
<AREA SHAPE="POLY" COORDS="182,32,188,43,190,56,150,56,150,56" href="" ?category=Critical&pieIndex=0">
<AREA SHAPE="POLY" COORDS="190,56,189,64,186,71,178,84,165,93,158,95,150,96,141,95,134,93,121,84,113,71,110,64,109,56,110,48,113,40,121,27,134,19,141,16,150,16,150,56,150,56" >
</MAP>
<IMG SRC="" t100.png" WIDTH="300" HEIGHT="150" BORDER="0" USEMAP="">"$ie.link(:url,"PieChart.html?category=Critical&pieIndex=0").click" gives Unable to locate object exception.However $ie.goto("PieChart.html?category=Critical&pieIndex=0") will go to the page directed by the link on the Chart.How to click or access these Map and Area tags?Thanks,AmithaSend instant messages to your online friends http://in.messenger.yahoo.com
_______________________________________________
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
- Re: [Wtr-general] How to click or access Map and Area tags? Angrez Singh
- Re: [Wtr-general] How to click or access Map and Area ... Angrez Singh
- Re: [Wtr-general] How to click or access Map and Area ... Pat Cappelaere
