Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Placing an embedded google map marker with Selenium

I have an asp.net website which as part of a wizard uses an embedded google map to select a location by clicking on the map to place a marker. How do I automate this with Selenium?

In particular I've tried:

  • ClickAt
  • DoubleClickAt
  • MouseDownAt
  • MouseUpAt

In all cases passing the map div id as the locator and "100,100" as the coordinate.

I don't care where on the map the marker is placed, as long as I can place that marker.

like image 900
Isaac Avatar asked May 21 '26 16:05

Isaac


1 Answers

The command:

<tr>
    <td>clickAt</td>
    <td>//div[@id='gmap']/div/div[1]</td>
    <td>(400,300)</td>
</tr>

works for me.

like image 71
dave1010 Avatar answered May 25 '26 09:05

dave1010



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!