How to perform Automated Geolocation testing in JUnit with Selenium?

How to perform Automated Geolocation testing with Selenium JUnit?

Hi Ian !

It’s easy to test geolocation while performing JUnit testing with Selenium.

You need to use the "geoLocation", "AR" capability in your code snippet.

Here is an example:

DesiredCapabilities capabilities = new DesiredCapabilities();
       capabilities.setCapability("browserName", "chrome");
        capabilities.setCapability("version", "latest");
        capabilities.setCapability("platform", "Windows 10"); // If this cap isn't specified, it will just get the any available one
        capabilities.setCapability("build", "Junit Testing Example");
        capabilities.setCapability("name", "GeoLocation Test");
        capabilities.setCapability("plugin", "git-junit");

        capabilities.setCapability("geoLocation", "AR"); // Geolocation capability, check LambdaTest Capability Generator

Here is the GitHub repo for the same