How to locate cursors randomly in a map?



  • There is a lot of cursors in the map. Every time you refresh the map you will get another different cursors with different IDs, o I can't use the IDs.

    I want to click at any cursor, a tooltip should appear when I click any of them. I've tried lots of things but I can't do it.

    All 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>
    
    <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">
    

    XPath for cursor 1

    /html/body/div[5]/div[2]/table/tbody/tr/td[2]/div[3]/div[2]/div/div/div[3]/div[2]/div[50]/map/area
    

    XPath for cursor 2

    /html/body/div[5]/div[2]/table/tbody/tr/td[2]/div[3]/div[2]/div/div/div[3]/div[2]/div[25]/map/area
    

    XPath for cursor 3

    /html/body/div[5]/div[2]/table/tbody/tr/td[2]/div[3]/div[2]/div/div/div[3]/div[2]/div[9]/map/area
    

    CSS

    html.win body.rtl div.content-for-layout div#page-container table tbody tr td div#Map div div div div div div.gmnoprint map#gmimap83 area
    

    HTML

    <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;">
    


  • There seem to be two problems in your question: how to you locate the cursors (clickable parts of the map), and how do you determine whether a tooltip appears when you click a cursor. You did not explicitly ask about the second problem, so I will assume you are mostly interested in the first part.

    If all of your cursors are area elements, you might try using an Xpath like //area.



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2