How to click on the marker on the map.....

64 views
Skip to first unread message

JH

unread,
Jul 22, 2016, 3:49:32 PM7/22/16
to Selenium Users
We have a temporary marker that needs to be clicked to update and I can't get it to click.... 

Anyone have dealt with same or similar scenario?

This is the html code:

<div class="gmnoprint" title="Pending" style="width: 18px; height: 18px; overflow: hidden; position: absolute; opacity: 0.01; cursor: pointer; left: 755px; top: 336px; z-index: 9999;"><img src="img/img_sighting_temp.png" draggable="false" style="position: absolute; left: 0px; top: 0px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none; width: 18px; height: 18px; opacity: 1;"></div>


I can't use class because there are many on the same screen that has same class.....


Thank you!


JH

David

unread,
Jul 24, 2016, 12:45:47 AM7/24/16
to Selenium Users
Well, do you know which specific marker you want? Say by index #. Then you can look it up using class ID + index using XPath or CSS, or do a find elements with the class ID with Selenium, then simply pull out the desired indexed WebElement in the WebElements array that is returned.

You could also locate by other properties besides the class, e.g. top & left coordinates that define where the marker is on the image/map. If you don't know the index or it's top/left location values, you're out of luck. Finding by top/left values will mean you'll need to use XPath or CSS to match the values against the style attribute containing those.

JH

unread,
Jul 25, 2016, 12:11:57 PM7/25/16
to Selenium Users
Hello,

Thanks for your response.  We put the marker at the center of the screen by default.  Do you have any idea how I can use xpath to find marker which is on the center of the map?

Thank you again,

Janet
Reply all
Reply to author
Forward
0 new messages