Skip to main content
No Result Found
Connect & Get help from fellow developers on our Discord community. Ask the CommunityAsk the Community

Test Apple Pay on Private Devices

Learn how to test Apple Pay on iOS private devices using BrowserStack Automate with Selenium.

Apple Pay testing allows you to validate one-click payments and purchase flows securely within your test suite.

Prerequisites

Before you begin, please ensure your setup meets the following requirements. You may need to contact your Customer Engineer (CE) for assistance.

  • You must have access to devices with Apple Pay enabled.

  • iOS entitlements must be preserved for developer or enterprise-signed apps.

  • Supported App configuration:

    • Your app must be signed using the developer (for app testing) or enterprise signed certificates.
    • Your app must have the Apple Pay entitlement added as a dependency.
    • In addition, you must add your device UDID to the developer signed certificates for Private Devices.

Supported devices and OS versions:

Supported Devices iOS Version
iPhone 16 18
iPhone 15 17
iPhone 14 16
iPhone 14 Pro 16
iPhone 13 Pro Max 15
iPhone 13 Pro 15
iPhone 13 Mini 15
iPhone 13 15
iPhone 11 15
iPhone XR 15

Benefits of using Apple Pay on Private Devices

You can use Apple Pay on private devices to support a variety of advanced testing needs. Here are some of the common use cases:

  • Test with production or custom cards:
    You can manually set up the Apple Pay process on your private devices to add and test with production cards or cards from your own custom sandbox environment.

  • Meet security and compliance requirements:
    You get a fully isolated environment for running your tests securely, which is not possible on public cloud.

  • Perform advanced, end-to-end testing:
    You can use private device features like UDID targeting and app persistence to validate your complete app experience. This is essential when Apple Pay is deeply integrated into your app and testing the payment flow in isolation isn’t enough.

  • Test developer-signed apps:
    On public cloud, apps are resigned, which can cause them to lose the necessary entitlements for Apple Pay to function. With private devices, your app is not resigned, allowing you to test your developer-signed app without any issues.

Enable Apple Pay in your test script

To enable Apple pay, use the appropriate capability based on your protocol:

If you are using BrowserStack SDK, you can set the following capability within the browserstack.yml file:

Capability Description
enableApplePay Set this capability to "true" if you want to use Apple Pay in the test.
applePayPreferredNetworks Set this capability if you want to set preferred payment networks for Apple Pay to improve stability. For example, ["Visa", "Mastercard"].
This capability is optional.
nativeWebTap Set this capability to "true" if you are unable to get Apple Pay payment screen after clicking the Apple Pay button.

Example

browserstack.yml
Copy icon Copy
Capability Description
enableApplePay Set this capability to "true" if you want to use Apple Pay in the test.
applePayPreferredNetworks Set this capability if you want to set preferred payment networks for Apple Pay to improve stability. For example, ["Visa", "Mastercard"].
This capability is optional.
nativeWebTap Set this capability to "true" if you are unable to get Apple Pay payment screen after clicking the Apple Pay button.

W3C example

Ruby
Copy icon Copy

Update your test logic

After enabling the capability, you must update your test script’s logic to handle the Apple Pay UI. This involves using custom JavaScript executors to trigger the Apple Pay button within your app.

For complete implementation details and sample logic, check out the Apple Pay test flow documentation.

Geographic limitations

Testing for Apple Pay on BrowserStack’s remote iOS devices is currently limited to specific geographic regions.

Geography Country
North America United States, Canada
Europe France, Ireland, Italy, Spain, United Kingdom, Germany
Asia China Mainland, Hong Kong, Taiwan, Japan, Russia, Singapore
Australia Australia, New Zealand

Understanding the test environment

To provide a stable testing experience, the Apple Pay test environment has a specific cleanup process and some setting restrictions.

Session cleanup

After your test session is complete, a cleanup process runs. The behavior depends on your device configuration settings.

  • If you select Retain user data between sessions: Your non-card specific details including the shipping and billing address on card is retained for your next session. All other card details are cleared out.

  • If you select Reset all user data after each session: All card details and non-card-specific details like shipping and billing addresses are cleared.

Device setting restrictions

To ensure the Apple Pay configuration remains stable, BrowserStack restricts certain sections within the device’s Settings app. These restrictions are active during all sessions on the device.

Full sections restricted:

  • Apple Account: Prevents changes to personal info, payment details, and associated devices.

  • Wallet: Prevents modification of the sandbox cards used for testing.

Sub-sections restricted:

  • Accessibility → Touch → AssistiveTouch: The Confirm with AssistiveTouch toggle is locked.

  • Language & Region → Region: The ability to change the region is locked to prevent you from selecting a region that does not support Apple Pay.

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 Check Circle