How to get the Event Object of the Click event on Selenium IDE?



  • I am a newb at selenium thing. I have image map area and on click event of this area a function is firing where the click Event Object is being passed to do some calculation. I have recorded the scenario with Selenium IDE and it produced Click command for it. What I see is that it enters into the function but the event object not got. I tried fireEvent and set value Click instead of Click. The result is same.

    Can anybody please guide me to anything ?

    Image map area :

    <map>
    <area shape="poly" alt="frontTrunk" onclick="setPositionCheck('frontTrunk');checkPosition($('bodyDiv'),event);" />
    </map>
    

    js function :

    function checkPosition(obj, event) {
        var bodyImgPos = findPos($(Prefix + "bodyImg"));
        var bodyImg = $(Prefix + "bodyImg");
    
        pos_x = event.pageX ? (event.pageX - bodyImgPos[0]) : (event.offsetX);
        pos_y = event.pageY ? (event.pageY - bodyImgPos[1]) : (event.offsetY);
    
    }
    

    Selenium IDE source

    <tr>
        <td>fireEvent</td>
        <td>css=area[alt=&quot;frontTrunk&quot;]</td>
        <td>click</td>
    </tr>
    


  • It seems that you need coordinates for the event, which are not filled by fireEvent. Maybe clickAt might work for you:

    <tr>
        <td>clickAt</td>
        <td>css=area[alt=&quot;frontTrunk&quot;]</td>
        <td>1,1</td>
    </tr>
    


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2