Use IP geolocation
BrowserStack’s IP geolocation feature allows you to simulate website and mobile behavior from different locations by using IP addresses hosted in 45+ countries around the world. By incorporating IP geolocation into your tests, you can verify scenarios such as localized pricing, languages, product listings and much more.
With IP geolocation enabled, traffic from your mobile app will originate from an IP address hosted in the country you have chosen. With over 45+ countries to choose from, you can now test how your mobile app behaves across the world.
IP geolocation feature for app testing is only available with a BrowserStack Enterprise plan. View details.
Use the capability to test country-specific behavior for your apps:
If you are using BrowserStack SDK, you can set the following capability within the browserstack.yml
file:
Capability | Description | Value |
---|---|---|
geoLocation |
Test how your app behaves in specific countries | < Two letter country code > Example: “CN” for China, “FR” for France, “IN” for India and “US” for United States of America |
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.
Use the following code snippet to set the geo location:
Capability | Description | Value |
---|---|---|
geoLocation |
Test how your app behaves in specific countries | < Two letter country code > Example: “CN” for China, “FR” for France, “IN” for India and “US” for United States of America |
Example:
DesiredCapabilities capabilities = new DesiredCapabilities();
HashMap<String, Object> browserstackOptions = new HashMap<String, Object>();
browserstackOptions.put("geoLocation", "FR");
var capabilities = {
'bstack:options' : {
"geoLocation" : "FR",
},
}
AppiumOptions capabilities = new AppiumOptions();
Dictionary<string, object> browserstackOptions = new Dictionary<string, object>();
browserstackOptions.Add("geoLocation", "FR");
$caps = array(
'bstack:options' => array(
"geoLocation" => "FR",
),
)
desired_cap = {
'bstack:options' : {
"geoLocation" : "FR",
},
}
capabilities = {
'bstack:options' => {
"geoLocation" => "FR",
},
}
Capability | Description | Value |
---|---|---|
browserstack.geoLocation |
Test how your app behaves in specific countries | < Two letter country code > Example: “CN” for China, “FR” for France, “IN” for India and “US” for United States of America |
Example:
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("browserstack.geoLocation", "FR");
var capabilities = {
"browserstack.geoLocation" : "FR",
}
AppiumOptions capabilities = new AppiumOptions();
capabilities.AddAdditionalCapability("browserstack.geoLocation", "FR");
$caps = array(
"browserstack.geoLocation" => "FR"
)
desired_cap = {
"browserstack.geoLocation" : "FR"
}
caps = Selenium::WebDriver::Remote::Capabilities.new
caps["browserstack.geoLocation"] = "FR"
List of supported country codes:
Check out the list of supported countries. Here is a complete list of over 45+ countries that are supported:
BrowserStack’s IP addresses may or may not comply with Chinese firewall regulations.
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
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
Thank you for your valuable feedback!