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 :

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

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

  • Is this the only area on the page, or are there multiple? Could it be finding the incorrect element? Also, does the click fail, or does it complete and appear to succeed from Selenium's point of view but doesn't do anything in your app?
    – Sam Woods
    Commented May 3, 2013 at 17:56
  • Surely, it is just the part of the page. I don think its finding the incorrect element as when I run it in Selenium IDE it enters the checkPosition function; but the only thing I don get the post_x and post_y calculated as I get all of the event.pageX/pageY and event.offsetX/offsetY to be undefined !! Any idea ? Commented May 6, 2013 at 0:52

1 Answer 1


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


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.