Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

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>
share|improve this question
    
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 May 3 '13 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 ? –  marifrahman May 6 '13 at 0:52

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.