Work with PAC files for Flutter tests
Use a Proxy Auto-Configuration file to route Local Testing traffic for your Flutter integration tests on BrowserStack App Automate.
A PAC file lets you define rules that decide which requests go through a proxy and which connect directly. When your network relies on a PAC file, point the Local binary to it so that your Flutter tests resolve traffic the same way your machine does.
This feature is available on Android devices only.
Establish a connection with a PAC file
A PAC file contains a JavaScript function that determines whether a request goes through the proxy server. After you have the absolute path of the PAC file on your machine, use the --pac-file flag to establish the Local Testing connection:
BrowserStack doesn’t support authentication with a PAC file.
To resolve all requests on BrowserStack devices through your PAC proxy, add the --force-proxy and --force-local flags to the command. Without these flags, the Local binary tries to connect directly for better performance.
Sample PAC file
The following function checks whether the hostname is a plain hostname. If it is, the connection is direct. Otherwise, the connection goes through the proxy:
If you’re unsure about the proxy script or need permission to modify it, please reach out to your IT or network support team.
Run your build through the connection
After the connection is established, set the local parameter to true in your build REST API request:
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!