FYI, I was able to investigate the issue and pinpoint a probable cause.<div><br></div><div>It seems that when selenium performs a 'click' event it actually sends twice a mouseDown/mouseUp event sequence.</div><div>
The first one has the correct location on the map: a couple of positive > 0 coordinates (say x=200,y=210)</div><div>The second one instead has totally bogus coordinates, negative coordinates (say x=-20,y=-70)</div><div>
<br></div><div>Tha last event is registered as the last position at which a mouseDown occurred and therefore when the click handler evaluates</div><div>this condition (<a href="https://github.com/openlayers/openlayers/blob/master/lib/OpenLayers/Handler/Click.js#L403">https://github.com/openlayers/openlayers/blob/master/lib/OpenLayers/Handler/Click.js#L403</a>) it returns false and the event</div>
<div>is discarded, together with the first one (which had correct coordinates).</div><div><br></div><div>As a POC I have hacked a local copy of OL and changed the mouseDown event handler as follows:</div><div><br></div><div>
<div>    /**</div><div>     * Method: mousedown</div><div>     * Handle mousedown.</div><div>     *</div><div>     * Returns:</div><div>     * {Boolean} Continue propagating this event.</div><div>     */</div><div>    mousedown: function(evt) {</div>
<div>        console.log('mousedown');</div><div>        if(evt.xy && (evt.xy.x <= 0.0 && evt.xy.y <= 0.0)) {</div><div>            return true;</div><div>        }</div><div>        this.down = this.getEventInfo(evt);</div>
<div>        this.last = this.getEventInfo(evt);</div><div>        console.log('mousedown '+this.down.xy);</div><div>        console.log(evt);</div><div>        return true;</div><div>    },</div></div><div><br></div>
<div>You can see the original code at:</div><div><a href="https://github.com/openlayers/openlayers/blob/master/lib/OpenLayers/Handler/Click.js#L220">https://github.com/openlayers/openlayers/blob/master/lib/OpenLayers/Handler/Click.js#L220</a><br>
</div><div><br></div><div>Note the logging statements and the check for <=0 coordinates. Events with x,y both <=0 are discarded.</div><div><br></div><div>With these modifications I was able to successfully trigger the getfeatureinfo control from selenium. While using the map myself I did not find any negative side effect.</div>
<div><br></div><div>This looks pretty much like a Selenium issue to me, and I am going to report it to them, but I just wanted to share the findings with you in the hope that someone's light bulb turns itself on ;-)</div>
<div><br></div><div>Umberto</div><div><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Nov 12, 2012 at 5:32 PM, Umberto Nicoletti <span dir="ltr"><<a href="mailto:umberto.nicoletti@gmail.com" target="_blank">umberto.nicoletti@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<div>I need (actually it's more want) to test an application that uses OpenLayers internally with selenium IDE (<a href="http://seleniumhq.org/" target="_blank">http://seleniumhq.org/</a>).</div>
<div><br></div><div>Unfortunately it seems I can't find the right event combination to reproduce a 'click' on the map which then triggers a getfeatureinfo request.</div>
<div><br></div><div>I have already tried all possible permutations of mouseDownAt/mouseUpAt/click events, then played with timings and playback speed but without success.</div><div><br></div><div>Interestingly enough if I try to record events with Selenium IDE nothing is recorded when I pan/click on the map.</div>

<div><br></div><div>STFW did not help either: Openlayers and Selenium are mentioned only once, and with similar, unresolved issues as the ones I am seeing.</div><div><br></div><div>So here I am asking the great OL community: has anyone, ever got OpenLayers to work, and how, with Selenium or any other in browser automated testing tool?</div>

<div><br></div><div>Thanks in advance,</div><div>Umberto</div>
</blockquote></div><br></div>