Test localhost and staging websites that are not publicly accessible
BrowserStack can integrate with test suites pointing to your localhost URL, staging environment, and even websites behind one or more proxies/firewalls. This is done using BrowserStack Local - a tunneling feature that establishes a secure connection between your machine and the BrowserStack Cloud.
Prerequisites
BrowserStack Username and Access key. You can find this in your account profile. If you do not have an account yet, you can sign up for a Free Trial or purchase a plan.
Run your Local test
Follow the steps to configure and run your xUnit tests for Local Testing.
-
Clone the xunit-browserstack repository on GitHub that contains BrowserStack’s sample test, if you haven’t already done so:
git clone -b selenium-4 https://github.com/browserstack/xunit-browserstack.git
-
Open the
XUnit-BrowserStack.sln
solution file in Visual Studio. -
Update your xUnit
App.config
file by setting your credentials and by setting thelocal
capability totrue
.
-
Run a sample test case using the following command, to check whether the Local test connection has been setup properly.
dotnet test --filter "Category=local"
-
You can now run your xUnit test using BrowserStack Local using the following steps:
- Build the solution in Visual Studio.
- Run the test with fixture
local
from Test Explorer.
Next steps
After you have successfully run your first test using BrowserStack Local, you can explore the following sections:
- Run multiple tests in parallel to speed up the build execution
- Testing your local site that might be behind a proxy
- Local flags to customize your local testing setup
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!