Use IP geolocation feature for Espresso tests
Use IP geolocation to test location based scenarios for your Espresso test executions on BrowserStack App Automate.
BrowserStack’s IP geolocation feature allows you to test app 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 originates from an IP address hosted in the country you choose. With over 45+ countries to choose from, you can test how your mobile app behaves across the world.
IP geolocation is an Enterprise plan feature on BrowserStack. Contact sales for details.
To specify the location, pass the geoLocation parameter in the REST API request to start Espresso test execution. You need to pass the two-letter country code for the desired location.
REST API endpoint:
POST /app-automate/espresso/build
| Parameter | 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 |
The following table lists the country codes you can use with the geoLocation parameter:
| Country Name | Country Code |
|---|---|
| Argentina | AR |
| Australia | AU |
| Austria | AT |
| Belgium | BE |
| Brazil | BR |
| Bulgaria | BG |
| Canada | CA |
| Chile | CL |
| China | CN |
| Croatia | HR |
| Czech Republic | CZ |
| Denmark | DK |
| Egypt | EG |
| Finland | FI |
| France | FR |
| Germany | DE |
| Greece | GR |
| Hong Kong | HK |
| Hungary | HU |
| Iceland | IS |
| India | IN |
| Ireland | IE |
| Israel | IL |
| Italy | IT |
| Japan | JP |
| Jordan | JO |
| Malaysia | MY |
| Mexico | MX |
| Netherlands | NL |
| New Zealand | NZ |
| Norway | NO |
| Philippines | PH |
| Poland | PL |
| Portugal | PT |
| Russia | RU |
| Singapore | SG |
| South Africa | ZA |
| South Korea | KR |
| Spain | ES |
| Sweden | SE |
| Switzerland | CH |
| Taiwan | TW |
| Thailand | TH |
| Ukraine | UA |
| United Kingdom | GB |
| United States | US |
| Vietnam | VN |
Example cURL request:
curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST "https://api-cloud.browserstack.com/app-automate/espresso/v2/build" \
-d '{"geoLocation": "FR", "devices": ["Samsung Galaxy S8-7.0"], "app": "bs://f7c874f21852ba57957a3fdc33f47514288c4ba4", "testSuite": "bs://e994db8333e32a5863938666c3c3491e778352ff"}' \
-H "Content-Type: application/json"
- Check out the complete list of 45+ supported countries.
- IP geolocation cannot be enabled if allowDeviceMockServer is set to
true.
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!