Google account login
Support for logging in to the Google Play Store using the appStoreConfiguration
capability will be deprecated on 30 September 2024. Make sure you automate the Google login process and make other necessary code changes before this date. Technical limitations may prevent the feature from working after deprecation.
You can log in to a Google account on a BrowserStack device to test:
- Google in-app purchase flows.
- Accepting payments using Google Pay.
- Integration of your app with other Google apps (e.g. Google Calendar).
- Production version of your apps by downloading it from the Google Play Store.
Use the app store configuration capability to pass your credentials to login Google Play Store:
If you are using BrowserStack SDK, you can set the following capability within the browserstack.yml
file:
Capability | Description | Values |
---|---|---|
appStoreConfiguration |
Set credentials for Google account login |
"username" : "play-store-email" "password" : "play-store-password"
|
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 pass your credentials to login Google Play Store:
Capability | Description | Values |
---|---|---|
appStoreConfiguration |
Set credentials for Google account login |
"username" : "play-store-email" "password" : "play-store-password"
|
Example:
DesiredCapabilities capabilities = new DesiredCapabilities();
HashMap<String, Object> browserstackOptions = new HashMap<String, Object>();
browserstackOptions.put("appStoreConfiguration", new HashMap<String, String>() );
var capabilities = {
'bstack:options' : {
"appStoreConfiguration" : {"username" : "your_email", "password" : "your_password" },
}
}
AppiumOptions capabilities = new AppiumOptions();
Dictionary<string, string> appStoreConfiguration = new Dictionary<string, string> { { "username", "your_email" }, { "password", "your_password" } };
browserstackOptions.Add("appStoreConfiguration", appStoreConfiguration);
$caps = array(
'bstack:options' => array(
"appStoreConfiguration" => array("username" => "your_email", "password" => "your_password" ),
),
)
capabilities = {
'bstack:options' => {
"appStoreConfiguration" => {"username" => "your_email", "password" => "your_password" },
},
}
Capability | Description | Values |
---|---|---|
browserstack.appStoreConfiguration |
Set credentials for Google account login | {"username" : "play-store-email", "password" : "play-store-password"} |
Example:
DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
desiredCapabilities.setCapability("browserstack.appStoreConfiguration", new HashMap{String, String}(){ put("username", "your_email"); put("password", "your_password");});
var capabilities = {
'browserstack.appStoreConfiguration': '{"username":"your_email", "password":"your_password"}'
}
DesiredCapabilities capability = new DesiredCapabilities();
capability.SetCapability("browserstack.appStoreConfiguration", "{"username":"your_email", "password":"your_password"}");
$capabilities = new DesiredCapabilities();
$capabilities->setCapability("browserstack.appStoreConfiguration", array("username" => "your_email", "password" => "your_password"));
desired_caps = {
'browserstack.appStoreConfiguration': '{"username":"your_email", "password":"your_password"}'
}
Parallel tests with the same credentials can trigger Google’s anti-bot security measures. This may lead to additional security checks causing tests to fail. If the Google login feature on App Automate fails intermittently, automate the login flow directly within the test case.
Troubleshooting Google login issues
During test initialization, BrowserStack will attempt to log in on the tested device using specified Google account credentials. In some cases, Google may pose a Two-Factor Authentication (2FA) that requires you to approve login using a trusted device or an One-Time Password (OTP) or by some other means. This will fail your test build. To fix this:
- Use a newly created Google account to sign in. Ensure that the account was never used to log in on any other device or browser.
- Turn off the account’s security settings - 2 Step verification and Use your phone to sign in
- Ensure that 1 google account is not used for login in multiple parallel sessions (keep the parallel runs below 5 preferably)
- If you observe increased flakiness, create a new account as sometimes Google suspects malicious usage if same account has been used from multiple different devices which becomes unavoidable in a public cloud setting like ours.
If you are still facing issues with Google account login, please reach out to BrowserStack support.
Your Google account credentials are secure as we wipe the devices clean at the end of your test session.
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!