Selenium test with V3

4,053 views
Skip to first unread message

23tux

unread,
Mar 30, 2011, 7:46:18 AM3/30/11
to Google Maps JavaScript API v3
Hi folks,

I'm currently writing selenium tests in Ruby on Rails 3 and Cucumber.
I'm wondering if it is possible, to select a specific marker through
the DOM or any other selectors.
I've found the selenium tests for the V2 api at
http://gmaps-api-issues.googlecode.com/svn/trunk/selenium/core/TestRunner.html?test=../tests/examples_stable_suite.html

Here they are selecting a marker with
waitForElementPresent xpath=//img[contains(@src,'marker')]

but this seems not to work with the V3. I've tried it as mentioned
above with cucumber in rails, but it doesn't find the element.

Any idea how to check if a marker is on the map with selenium? I have
to do several tests, like click and drag the map etc.pp (if anybody
has a good tutorial or some resources for this kind of tests in V3,
please let me know).

Hope someone can help!
Beste regards,
tux

23tux

unread,
Apr 2, 2011, 3:30:30 AM4/2/11
to Google Maps JavaScript API v3
Me again,

I've tried to use a special icon for the marker, so that I can search
for the url of the image within the DOM. That was my idea. But it
doesn't work, the marker isn't in any img tag or listed in the source
code.

Does anybody know how google implements the marker? Are they drawn in
canvas? With firebug I can see, that the marker is loaded, but as I
said, I can't find it in the DOM.

Any idea would be helpful,

thx,
tux

Rossko

unread,
Apr 2, 2011, 5:59:59 AM4/2/11
to Google Maps JavaScript API v3
> Does anybody know how google implements the marker? Are they drawn in
> canvas?

Sometimes. See for example
http://groups.google.com/group/google-maps-js-api-v3/browse_thread/thread/2de0ea37567063d8/0cc94043a1408c51
and

ling ling

unread,
Apr 29, 2011, 6:17:39 PM4/29/11
to Google Maps JavaScript API v3
Does anyone have any success in automating the v3 google map using
selenium? Our dev test changed the implementation to use canvas and
as 23tux mentioned, the markers are now "painted" on the canvas now
and we can't use xpath to verify the markers anymore.

On Apr 2, 2:59 am, Rossko <ros...@culzean.clara.co.uk> wrote:
> > Does anybody know how google implements the marker? Are they drawn in
> > canvas?
>
> Sometimes.  See for examplehttp://groups.google.com/group/google-maps-js-api-v3/browse_thread/th...
> and

James McGill

unread,
Apr 30, 2011, 5:00:51 AM4/30/11
to google-map...@googlegroups.com
Set optimized = false; for each of your markers (see
http://code.google.com/apis/maps/documentation/javascript/reference.html#MarkerOptions).

Note that this has a performance cost, so I would suggest doing this
only for the purposes of testing.

> --
> You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
> To post to this group, send email to google-map...@googlegroups.com.
> To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.
>
>

John Lauck

unread,
Apr 10, 2012, 2:06:59 PM4/10/12
to google-map...@googlegroups.com
Is this still the optimal way to handle integration tests with Google Maps V3?


On Saturday, April 30, 2011 5:00:51 AM UTC-4, James McGill (Google Employee) wrote:
Set optimized = false; for each of your markers (see
http://code.google.com/apis/maps/documentation/javascript/reference.html#MarkerOptions).

Note that this has a performance cost, so I would suggest doing this
only for the purposes of testing.

On Sat, Apr 30, 2011 at 8:17 AM, ling ling <h...@gmail.com> wrote:
> Does anyone have any success in automating the v3 google map using
> selenium?  Our dev test changed the implementation to use canvas and
> as 23tux mentioned, the markers are now "painted" on the canvas now
> and we can't use xpath to verify the markers anymore.
>
> On Apr 2, 2:59 am, Rossko <ros...@culzean.clara.co.uk> wrote:
>> > Does anybody know how google implements the marker? Are they drawn in
>> > canvas?
>>
>> Sometimes.  See for examplehttp://groups.google.com/group/google-maps-js-api-v3/browse_thread/th...
>> and
>
> --
> You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.

> To post to this group, send email to google-maps-js-api-v3@googlegroups.com.
> To unsubscribe from this group, send email to google-maps-js-api-v3+unsub...@googlegroups.com.

prateek...@gmail.com

unread,
Aug 10, 2016, 7:16:07 PM8/10/16
to Google Maps JavaScript API v3, in...@sketchit.de
@23tux, Hey did you found the solution? If you have it then please explain the solution. 
thanks
Reply all
Reply to author
Forward
0 new messages