Simulate location of browsers and devices using IP Geo-location on BrowserStack Automate
IP Geolocation is an Enterprise-only feature. You can contact sales to get an Enterprise plan for your account.
If your website serves different content based on the country your end-users live in, you will want to test that functionality. You can use the geolocation capability to test your websites across different countries using BrowserStack’s IP Geolocation feature.
BrowserStack SDK is a plug-n-play solution that takes care of all the integration steps for you. Using the BrowserStack SDK is the recommended integration method for your project. To know more, visit the SDK core concepts page.
// Testing with the IP geolocation set to FranceMutableCapabilities capabilities =newMutableCapabilities();HashMap<String,Object> browserstackOptions =newHashMap<String,Object>();
browserstackOptions.put("geoLocation","FR");
capabilities.setCapability("bstack:options", browserstackOptions);// ... other capabilities
// Testing with the IP geolocation set to Francevar capabilities ={'bstack:options':{"geoLocation":"FR",}}
// Testing with the IP geolocation set to FranceDictionary<string,object> browserstackOptions =newDictionary<string,object>();
browserstackOptions.Add("geoLocation","FR");
capabilities.AddAdditionalOption("bstack:options", browserstackOptions);// ... other capabilities
# Testing with the IP geolocation set to France$caps=array('bstack:options'=>array("geoLocation"=>"FR",),)
# Testing with the IP geolocation set to France
desired_cap ={'bstack:options':{"geoLocation":"FR",},}
# Testing with the IP geolocation set to France
capabilities ={'bstack:options'=>{"geoLocation"=>"FR",},}# ... other capabilities
// Testing with the IP geolocation set to FranceDesiredCapabilities caps =newDesiredCapabilities();
caps.setCapability("browserstack.geoLocation","FR");// ... other capabilities
// Testing with the IP geolocation set to Francevar capabilities ={"browserstack.geoLocation":"FR"// ... other capabilities}
// Testing with the IP geolocation set to FranceDesiredCapabilities caps =newDesiredCapabilities();
caps.SetCapability("browserstack.geoLocation","FR");// ... other capabilities
# Testing with the IP geolocation set to France$caps=array("browserstack.geoLocation"=>"FR"# ... other capabilities);
# Testing with the IP geolocation set to France
capabilities ={"browserstack.geoLocation":"FR"# ... other capabilities}
# Testing with the IP geolocation set to France
caps =Selenium::WebDriver::Remote::Capabilities.new
caps["browserstack.geoLocation"]="FR"# ... other capabilities
# Testing with the IP geolocation set to Francemy$capabilities={"browserstack.networkLogs"=>"true"# ... other capabilities}
Note: This feature only sets the IP to the selected geolocation, and not guaranteed to set the appropriate timezone. If you want to use the timezone in that country, you will have to configure a custom timezone.
Did this page help you?
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked