Title: Re: [Wtr-general] How to click or access Map and Area tags?
I am not sure about your exact problem but I ran into something similar where I needed to click in a specific area of the screen.  I had to use the AutotIt capability with Mouseclick function which allows to specific the mouse button, x, y, clicks... http://www.autoitscript.com/autoit3/docs/functions.htm
If you are not running on Windows then I am not sure...
Hope this helps.
Pat.



From: Amitha Shetty <[EMAIL PROTECTED]>
Reply-To: <[email protected]>
Date: Wed, 21 Dec 2005 08:33:12 +0000 (GMT)
To: <[email protected]>
Subject: Re: [Wtr-general] How to click or access Map and Area tags?

Hi,
  
The Chart I am trying to access is in a table within a "Frame".
  
The code I used to access it is:
  
  
ie.element_by_xpath("//area[contains(@href , "PieChart.html?category=Critical&pieIndex=0")]/").click()
  
it throws  'Undefined method click for nil class' exception
  
I also tried:
  
  
ie.element_by_xpath("//area[contains(@href , "PieChart.html")]/").click() and I got the same exception
  
  
when I try ie.frame(:index,3).element_by_xpath("//area[contains(@href , 'PieChart.html?category=Critical&pieIndex=0')]/").click() it throws : undefined method `element_by_xpath' for #<Watir::Frame:0x2d92b48> (NoMethodError) exception
  
I read in the doc 'Support for XPATH in watir' that xpath does not support FRAMES.
  
  
I have to specify the frame and then the link...How do I do it?
  
 
  
  
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=""> <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="" WIDTH="300" HEIGHT="150" BORDER="0" USEMAP="">   


Angrez Singh <[EMAIL PROTECTED]> wrote:
  
Hi,

  
  
 
So when I try
  
ie.element_by_xpath("//area[contains(@href , ' PieChart.html')]/").click()
  
it throws  'Undefined method click for nil class' exception

This means that it hasn't returned you the element. I did tried the same xpath on the HTML code snippet provided by you in the mail and it did worked. Just check your xpath _expression_ or try some different xpath _expression_. Can you send the complete HTML, and watir code ?

Regards,
Angrez
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general
 


Send 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

Reply via email to