https://github.com/browserstack/xunit-appium-app-browserstack
This repository demonstrates how to run Appium tests in Xunit on BrowserStack App Automate.
https://github.com/browserstack/xunit-appium-app-browserstack
Last synced: 6 months ago
JSON representation
This repository demonstrates how to run Appium tests in Xunit on BrowserStack App Automate.
- Host: GitHub
- URL: https://github.com/browserstack/xunit-appium-app-browserstack
- Owner: browserstack
- Created: 2024-08-20T02:52:27.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-11-21T14:44:37.000Z (over 1 year ago)
- Last Synced: 2025-09-24T15:40:57.129Z (10 months ago)
- Language: C#
- Size: 33.7 MB
- Stars: 0
- Watchers: 6
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# xunit-appium-app-browserstack
This repository demonstrates how to run Appium tests in Xunit on BrowserStack App Automate.
## Setup
### Requirements
1. Visual Studio and .NET Core
- Download Visual Studio from [here](https://visualstudio.microsoft.com/)
- Install .NET Core while installing Visual Studio
## Getting Started
Getting Started with Appium tests in Xunit on BrowserStack devices couldn't be easier!
### **Run first test :**
- Open the project in Visual Studio by opening `xunit-appium-app-browserStack.sln` file
- Go to `android` or `ios` directory
- If you have uploaded your app then add the app id to the `browserstack.yml` config file, or you can directly specify the path to your app in the `browserstack.yml` file.
- Run `dotnet test --filter "Category=sample-test"`
- You can access the test execution results, and debugging information such as video recording, network logs on [App Automate dashboard](https://app-automate.browserstack.com/dashboard)
### **Use Local testing for apps that access resources hosted in development or testing environments :**
- Open the project in Visual Studio by opening `xunit-appium-app-browserStack.sln` file
- Go to `android` or `ios` directory
- Ensure that `browserstackLocal` capability is set to `true` in the `browserstack.yml` file
- If you have uploaded your app then add the app id to the `browserstack.yml` config file, or you can directly specify the path to your app in the `browserstack.yml` file.
- Run `dotnet test --filter "Category=sample-local-test"`
- You can access the test execution results, and debugging information such as video recording, network logs on [App Automate dashboard](https://app-automate.browserstack.com/dashboard)
### **Integrate your test suite**
This repository uses the BrowserStack SDK to run tests on BrowserStack. Follow the steps below to install the SDK in your test suite and run tests on BrowserStack:
- Create sample browserstack.yml file with the browserstack related capabilities with your BrowserStack Username and Access Key and place it in your root folder.
- Add nuget library BrowserStack.TestAdapter
```sh
dotnet add BrowserStack.TestAdapter
```
- Build project `dotnet build`
--
## Integration with other CSharp frameworks
For other CSharp frameworks samples, refer to following repositories :
- [Appium CSharp tests](https://github.com/browserstack/csharp-appium-app-browserstack)
Note: For other test frameworks supported by App-Automate refer our [Developer documentation](https://www.browserstack.com/docs/)
--
## Troubleshooting
- In case `Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'Newtonsoft.Json'` issue is encountered while running a Local test on Windows, please follow the these steps to resolve it :
- Go to Tools > NuGet Package Manager > Package Manager Console
- Run the command `update-package Newtonsoft.Json -reinstall` in the opened console
- Then run `update-package Newtonsoft.Json` in the same console
--
## Getting Help
If you are running into any issues or have any queries, please check [Browserstack Support page](https://www.browserstack.com/support/app-automate) or [get in touch with us](https://www.browserstack.com/contact?ref=help).