Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Cover image for Emulate GeoLocation for Manual Testing
coffeestain.io profile imagePablo Calvo
Pablo Calvo forcoffeestain.io

Posted on

     

Emulate GeoLocation for Manual Testing

In a web world so advanced that it is almost mandatory to deliver uniqueUser Experiences to uniqueCustomers Profiles, we need to make sure our system behaves as expected under different circumstances, and those circumstances can be as simple as where my customers are located.

Old fashion way!

One simple solution to testGeo Location features is to use a VPN provider that can easily transport us to almost anywhere in the world. But as simple as the solution looks like, it also comes with several constraints: Limited to the VPN provider location points and really hard to programmatically change location on demand, and of course the monetary cost of acquiring the service.

Google Chrome DevTools to the rescue!

With google chrome devTools we can easily override the user current geo location and test our unique experience. Check it outhere.

Let's try it out!

Once you have followed the previous link and know how to change the default location, let's make some tests around it.

  1. Navigate tohttps://www.where-am-i.net/, and check the current location.
    Alt Text

  2. Let's override the default user location to Berlin, and notice how the map is automatically updated.
    Alt Text

  3. Let's try one more time with a different city.
    Alt Text

So far pretty awesome...

Custom locations

We can basically add anywhere in the world as a custom location, as long as the timezone matches with the geo coordinates.

Checkthis list to find the supported timezones.

  1. First find a timezone you want to test. i.e.America/Costa_Rica.
  2. Go to google maps and find the right coordinates. ..www.google.com/maps/place/San+Jos%C3%A9,+Costa+Rica/@**9.9314988,-84.0951252**,14.76z/data..
  3. Then add everything as a new custom location on the Sensors window.Alt Text

As simple as that you can know use your custom timezone.

Alt Text

Final Thoughts

Geo Location testing just turned very simple with Google Chrome and devTools. Of course you are limited to this specific browser and I think that the use of a VPN will be a solid complement for this kind of testing.

Comment below what you do to test geo location features on your website, and any comments you have!!

Top comments(1)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss
CollapseExpand
 
yeri profile image
Yeri Manderi
Where am I
  • Joined

while buildingwhereami.place/, i faced similar issue with customizing the experience for different users under different circumstance, lets say the phone location is turned off, or they are using a VPN. These small changes can actually distort the result of the location app. So i had to put out a notice just incase it wasnt working as expected

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

More fromcoffeestain.io

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp