Skip to main content
Transform your testing process with: Real Device Features, Company-wide Licences, & App Percy

Google account login

You can log in to a Google account on a BrowserStack device to test:

  1. Google in-app purchase flows.
  2. Accepting payments using Google Pay.
  3. Integration of your app with other Google apps (e.g. Google Calendar).
  4. 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.yml
Copy icon Copy snippet

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"}'
}

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:

  1. 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.
  2. Turn off the account’s security settings - 2 Step verification and Use your phone to sign in
  3. Ensure that 1 google account is not used for login in multiple parallel sessions (keep the parallel runs below 5 preferably)
  4. 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






Thank you for your valuable feedback

Is this page helping you?

Yes
No

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!

Talk to an Expert
Download Copy