I'm using google map api in my site and I want to test the cursors on map using Selenium IDE.
Now I use this code and it works fine:

clickAt > xpath=(//map[@id='gmimap85'])

but it tests only one cursor (cursor number 85), and map page is a dynamic page so I want a way to make selenium select any random cursor on map page.

Any help would be appreciated.

  • If you want it fully automated you should use WebDriver But if you dont mind using a specific range of number do a loop using sideflow.js user Extension for IDE
    – Theo
    Apr 10, 2013 at 10:00

1 Answer 1


I'm not sure if you have a set range but what you can use is:

store|javascript{"http://gmimap" + Math.floor(Math.random()*11);}|randomcoord

  • 1
    didn't work :( please help me more
    – Mai Hanafy
    May 2, 2013 at 15:41
  • cursor details map id="gmimap208" name="gmimap208"> <area log="miw" coords="11,0,12,1,13,2,14,3,14,4,14,5,14,6,14,7,14,8,14,9,14,10,13,11,12,12,12,13,11,14,10,15,10,16,9,17,9,18,8,19,7,20,7,20,7,19,6,18,6,17,5,16,4,15,4,14,3,13,2,12,2,11,1,10,1,9,0,8,0,7,0,6,0,5,1,4,1,3,2,2,2,1,4,0,11,0" shape="poly" title="" style="cursor: pointer;"> </map>
    – Mai Hanafy
    May 2, 2013 at 15:42
  • <div class="gmnoprint" style="width: 15px; height: 21px; overflow: hidden; position: absolute; opacity: 0.01; left: 373px; top: 370px; z-index: 2000;"> <img style="position: absolute; left: 0px; top: 0px; width: 15px; height: 21px; -moz-user-select: none; border: 0px none; padding: 0px; margin: 0px;" src="/img/property_icons/free/normal.png" draggable="false" usemap="#gmimap226"> <map id="gmimap226" name="gmimap226">
    – Mai Hanafy
    May 2, 2013 at 15:42
  • hank you everyone for trying help me :) i finally did it just |click | //map/area | | this command clicks at the first ID cursor in map page :)
    – Mai Hanafy
    May 7, 2013 at 19:39
  • I think we can work on axis path in a map for testing. Feb 13, 2014 at 6:21

Your Answer

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

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