lefthandedgoat / canopy

f# web automation and testing library, built on top of Selenium (friendly to c# also)
http://lefthandedgoat.github.io/canopy/
MIT License
506 stars 115 forks source link

Fake user geolocation #448

Closed nojaf closed 6 years ago

nojaf commented 6 years ago

Hi, is it possible to simulate the user's location somehow? I saw this but you like quite the hack. A solution that work in chrome would suffice.

lefthandedgoat commented 6 years ago

I have never tried. Reading that ticket, if chrome won't let you set a flag to fake it, you will have to use JS to fake it like they suggest. Or you could have the developers who work on the site you are testing provide a js method to call to set it for you, or maybe hardcode geolocation for a specific test user etc.

Lots of hacky ways, but it doesn't look like there is a 'clean' way.

nojaf commented 6 years ago

Ok, thanks for your comment.