BrowserStackLocal 2.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package BrowserStackLocal --version 2.0.0                
NuGet\Install-Package BrowserStackLocal -Version 2.0.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="BrowserStackLocal" Version="2.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add BrowserStackLocal --version 2.0.0                
#r "nuget: BrowserStackLocal, 2.0.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install BrowserStackLocal as a Cake Addin
#addin nuget:?package=BrowserStackLocal&version=2.0.0

// Install BrowserStackLocal as a Cake Tool
#tool nuget:?package=BrowserStackLocal&version=2.0.0                

browserstack-local-csharp

Build Status

C# bindings for BrowserStack Local.

Setup

Open the solution file BrowserStack/BrowserStack.sln in Visual Studio. The projects are Visual Studio 2015 compatible. You will need to resolve the references from the Solution Explorer. Visual Studio with automatically download the references from NuGet.

Example

using BrowserStack;

# creates an instance of Local
Local local = new Local();

# replace <browserstack-accesskey> with your key. You can also set an environment variable - "BROWSERSTACK_ACCESS_KEY".
List<KeyValuePair<string, string>> bsLocalArgs = new List<KeyValuePair<string, string>>() {
  new KeyValuePair<string, string>("key", "<browserstack-accesskey>"),
}

# starts the Local instance with the required arguments
local.start(bsLocalArgs);

# check if BrowserStack local instance is running
Console.WriteLine(local.isRunning());

# stop the Local instance
local.stop();

Arguments

Apart from the key, all other BrowserStack Local modifiers are optional. For the full list of modifiers, refer BrowserStack Local modifiers. For examples, refer below -

Verbose Logging

To enable verbose logging -

bsLocalArgs.Add(new KeyValuePair<string, string>("v", "true"));
Folder Testing

To test local folder rather internal server, provide path to folder as value of this option -

bsLocalArgs.Add(new KeyValuePair<string, string>("f", "/my/awesome/folder"));
Force Start

To kill other running Browserstack Local instances -

bsLocalArgs.Add(new KeyValuePair<string, string>("force", "true"));
Only Automate

To disable local testing for Live and Screenshots, and enable only Automate -

bsLocalArgs.Add(new KeyValuePair<string, string>("onlyAutomate", "true"));
Force Local

To route all traffic via local(your) machine -

bsLocalArgs.Add(new KeyValuePair<string, string>("forcelocal", "true"));
Proxy

To use a proxy for local testing -

  • proxyHost: Hostname/IP of proxy, remaining proxy options are ignored if this option is absent
  • proxyPort: Port for the proxy, defaults to 3128 when -proxyHost is used
  • proxyUser: Username for connecting to proxy (Basic Auth Only)
  • proxyPass: Password for USERNAME, will be ignored if USERNAME is empty or not specified
bsLocalArgs.Add(new KeyValuePair<string, string>("proxyHost", "127.0.0.1"));
bsLocalArgs.Add(new KeyValuePair<string, string>("proxyPort", "8000"));
bsLocalArgs.Add(new KeyValuePair<string, string>("proxyUser", "user"));
bsLocalArgs.Add(new KeyValuePair<string, string>("proxyPass", "password"));
Local Proxy

To use local proxy in local testing -

  • localProxyHost: Hostname/IP of proxy, remaining proxy options are ignored if this option is absent
  • localProxyPort: Port for the proxy, defaults to 8081 when -localProxyHost is used
  • localProxyUser: Username for connecting to proxy (Basic Auth Only)
  • localProxyPass: Password for USERNAME, will be ignored if USERNAME is empty or not specified
bsLocalArgs.Add(new KeyValuePair<string, string>("localProxyHost", "127.0.0.1"));
bsLocalArgs.Add(new KeyValuePair<string, string>("localProxyPort", "8000"));
bsLocalArgs.Add(new KeyValuePair<string, string>("-localProxyUser", "user"));
bsLocalArgs.Add(new KeyValuePair<string, string>("-localProxyPass", "password"));
PAC (Proxy Auto-Configuration)

To use PAC (Proxy Auto-Configuration) in local testing -

  • pac-file: PAC (Proxy Auto-Configuration) file’s absolute path
bsLocalArgs.Add(new KeyValuePair<string, string>("-pac-file", "<pac_file_abs_path>"));
Local Identifier

If doing simultaneous multiple local testing connections, set this uniquely for different processes -

bsLocalArgs.Add(new KeyValuePair<string, string>("localIdentifier", "randomstring"));

Additional Arguments

Binary Path

By default, BrowserStack local wrappers try downloading and executing the latest version of BrowserStack binary in ~/.browserstack or the present working directory or the tmp folder by order. But you can override these by passing the -binarypath argument. Path to specify local Binary path -

bsLocalArgs.Add(new KeyValuePair<string, string>("binarypath", "/browserstack/BrowserStackLocal"));
Logfile

To save the logs to the file while running with the '-v' argument, you can specify the path of the file. By default the logs are saved in the local.log file in the present woring directory. To specify the path to file where the logs will be saved -

bsLocalArgs.Add(new KeyValuePair<string, string>("v", "true"));
bsLocalArgs.Add(new KeyValuePair<string, string>("logfile", "/browserstack/logs.txt"));

Contribute

Build Instructions

To run the test suite run the nunit tests from Visual Studio.

Packaging

To pack using nuget, run nuget pack BrowserStackLocal\BrowserStackLocal\BrowserStackLocal.csproj -Prop Configuration=Release

Reporting bugs

You can submit bug reports either in the Github issue tracker.

Before submitting an issue please check if there is already an existing issue. If there is, please add any additional information give it a "+1" in the comments.

When submitting an issue please describe the issue clearly, including how to reproduce the bug, which situations it appears in, what you expect to happen, what actually happens, and what platform (operating system and version) you are using.

Pull Requests

We love pull requests! We are very happy to work with you to get your changes merged in, however, please keep the following in mind.

  • Adhere to the coding conventions you see in the surrounding code.
  • Include tests, and make sure all tests pass.
  • Before submitting a pull-request, clean up the git history by going over your commits and squashing together minor changes and fixes into the corresponding commits. You can do this using the interactive rebase command.

Example

To run the example,

  • open the solution file BrowserStackExample/BrowserStackExample.sln
  • resolve the references (Will need to resolve the reference to BrowserStack.dll [built from the main project])
  • change the BROWSERSTACK_USERNAME and BROWSERSTACK_ACCESS_KEY string variables to your BrowserStack username and key mentioned here
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net20 is compatible.  net35 was computed.  net40 was computed.  net403 was computed.  net45 was computed.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (6)

Showing the top 5 NuGet packages that depend on BrowserStackLocal:

Package Downloads
KoloDev.GDS.QA.Accelerator

KoloDev Ltd. QA Accelerator. This package contains the solution accelerators for testing teams, enabling selenium, accessibility, cross browser testing and more.

AutoTestExtras.Core

Automation test extension for API/Web/Mobile/Performance with enabled dotnet core support and other features. This package includes the AutoTestExtras framework assembly, which is referenced by your automation tests.

OneStreamAutoLibrary

Package Description

KoloDev.GDS.QA

KoloDev Ltd. QA Accelerator. This package contains the solution accelerators for testing teams, enabling selenium, accessibility, cross browser testing and more.

SpecFlow.Actions.Browserstack

SpecFlow aims at bridging the communication gap between domain experts and developers by binding business readable behavior specifications to the underlying implementation. Our mission is to provide a pragmatic and frictionless approach to Acceptance Test Driven Development and Behavior Driven Development for .NET projects today."

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.3.1 101,588 6/7/2023
2.3.0 60,677 2/20/2023
2.2.0 50,981 12/6/2022
2.1.0 78,447 7/25/2022
2.0.0 643,872 11/11/2020
1.4.0 283,613 8/14/2018
1.3.0 73,927 1/19/2017
1.2.0 19,216 7/15/2016
1.1.0 4,660 5/13/2016
1.0.0 1,148 5/12/2016
0.2.0 67,179 5/10/2016
0.1.0 1,698 5/4/2016