Login   /   Register

Automating Google Earth

Rate this article
     5 votes, average: 3.2 out of 55 votes, average: 3.2 out of 55 votes, average: 3.2 out of 55 votes, average: 3.2 out of 55 votes, average: 3.2 out of 5
Loading ... Loading ...
December 15th, 2009 by daniva

Local Search Results

You arrived here after searching for the following phrases:

Click a phrase to jump to the first occurrence, or return to the search results.

One big question I’ve been asked a few days ago. it is possible to automate Google Earth with QuickTest?

the answer is yes!

to do that you need some follow some pre-requisites.

This demo works only on browser embedded Google Earth maps. The demo will change view types, display controls on the window and “DIVE” into Times Square, New York

the demo was tested on Internet Explorer 7.

Const URL = "http://earth-api-samples.googlecode.com/svn/trunk/demos/kmlplayground/index.html"

Const SW_MAXIMIZED = 3

 

' Closing any open browsers and reopen URL

SystemUtil.CloseProcessByName "iexplore.exe"

SystemUtil.Run "iexplore.exe", URL, "", "open", SW_MAXIMIZED

Browser("CreationTime:=0").Page("index:=0").Sync

Set objActiveX = Browser("CreationTime:=0").Page("index:=0").ActiveX("progid:=GEPluginCoClass.GEPluginCoClass.1.0", "location:=0").Object

' setting variables values

ALTITUDE_ABSOLUTE = objActiveX.ALTITUDE_ABSOLUTE

VISIBILITY_SHOW = objActiveX.VISIBILITY_SHOW

ALTITUDE_RELATIVE_TO_GROUND = objActiveX.ALTITUDE_RELATIVE_TO_GROUND

MAP_TYPE_EARTH = objActiveX.MAP_TYPE_EARTH

MAP_TYPE_SKY = objActiveX.MAP_TYPE_SKY

SPEED_TELEPORT = objActiveX.SPEED_TELEPORT

 

wait 2

' Changing to SKY view

Set geOptions = objActiveX.getOptions()

Call geOptions.setMapType( MAP_TYPE_SKY )

wait 5

 

' Changing to EARTH view

Call geOptions.setMapType( MAP_TYPE_EARTH )

' Setting to Minimum zoom at max speed

geOptions.setFlyToSpeed( SPEED_TELEPORT ) 

Set kmlLookAt = objActiveX.getView().copyAsLookAt( ALTITUDE_ABSOLUTE )

kmlLookAt.setRange(50000000)

objActiveX.getView().setAbstractView(kmlLookAt)

 

 

wait 2

' adding visual controls

geOptions.setGridVisibility( true )

geOptions.setStatusBarVisibility(true)

geOptions.setScaleLegendVisibility( true )  

geOptions.setMouseNavigationEnabled( true )

geOptions.setOverviewMapVisibility( true )

 

' retrieve the navigating control

Set geNavigationControl = objActiveX.getNavigationControl()

geNavigationControl.setVisibility( VISIBILITY_SHOW )

Set geView = objActiveX.getView()

Set kmlLookAt = geView.copyAsLookAt( ALTITUDE_RELATIVE_TO_GROUND )

 

' ** MAIN DEMO : set speed, tilt and heading

geOptions.setFlyToSpeed(0.5) 

kmlLookAt.setTilt(0)

kmlLookAt.setHeading(0)

' Times Square, New York, NY

kmlLookAt.setLatitude( 40.7594 )

kmlLookAt.setLongitude( -73.985 )

' setting new values 

objActiveX.getView().setAbstractView(kmlLookAt)

'zooming…

For i = 1 to 17

    kmlLookAt.setRange(kmlLookAt.getRange() * 0.5)

    objActiveX.getView().setAbstractView(kmlLookAt)

    Wait 1

Next

 

Posted in web

6 Responses to “Automating Google Earth”

  1. Twitter Trackbacks for Automating Google Earth | AdvancedQTP [advancedqtp.com] on Topsy.com Says:

    [+]

    [...] Automating Google Earth | AdvancedQTP www.advancedqtp.com/knowledge-base/articles/environment-techniques-id15/ – view... ...

  2. mailkarthi Says:

    [+]

    This is a good post on automating Goog Earth, but it has nothing to do with QTP though :) except for one line where you get refere... ...

  3. daniva Says:

    [+]

    hi mailkharti maybe you have never need to test maps. what i did is only an example, and share and a knowledge to accessing ma... ...

  4. lengchun10 Says:

    [-]

    this is very good!

  5. Olga Ivolgin Says:

    [-]

    excellent as usual !

  6. primal_v Says:

    [-]

    Its a nice thought

Leave a Reply

You must be logged in to post a comment.

This article was viewed 466 times