Johnny
Johnny

Reputation: 7351

Selenium tests for Google maps

Does anyone have a code example for a Selenium test (or some other browser testing environment) on a Google Maps API V3 map? Specifically, I want to interact with the markers and popup windows.

Upvotes: 8

Views: 21486

Answers (2)

Grooveek
Grooveek

Reputation: 10094

It's been a long time since this question has been answered, but I think it's nice to post here another solution that offers other possibilities that didn't exist at the time, for people that are interested in that topic

You can use SikuliFirefoxDriver to automate Google Maps with WebDriver, with the image recognition tooling of hte great Sikuli software

Upvotes: 3

Johnny
Johnny

Reputation: 7351

Solved. Not 100% elegant but it works. Set optimized : false on the markers. This makes them all appear on the map (docs). Then set the XPath selector in the Selenium test to '//div[@class="gmnoprint" and @title], this will select all the markers. You can then interact with the markers. See also this Google groups posting.

Upvotes: 8

Related Questions