{"id":21944931,"url":"https://github.com/browserstack/browserstack-local-csharp","last_synced_at":"2025-04-22T21:13:47.577Z","repository":{"id":37458436,"uuid":"51923158","full_name":"browserstack/browserstack-local-csharp","owner":"browserstack","description":"CSharp bindings for BrowserStack Local","archived":false,"fork":false,"pushed_at":"2025-01-07T12:55:49.000Z","size":247,"stargazers_count":3,"open_issues_count":8,"forks_count":12,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-04-22T21:13:39.038Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.browserstack.com","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/browserstack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-02-17T13:07:01.000Z","updated_at":"2025-01-07T12:55:51.000Z","dependencies_parsed_at":"2024-12-23T18:37:05.160Z","dependency_job_id":null,"html_url":"https://github.com/browserstack/browserstack-local-csharp","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserstack%2Fbrowserstack-local-csharp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserstack%2Fbrowserstack-local-csharp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserstack%2Fbrowserstack-local-csharp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserstack%2Fbrowserstack-local-csharp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/browserstack","download_url":"https://codeload.github.com/browserstack/browserstack-local-csharp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250324708,"owners_count":21411946,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-29T04:17:26.220Z","updated_at":"2025-04-22T21:13:47.551Z","avatar_url":"https://github.com/browserstack.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# browserstack-local-csharp\n\n[![.NET package CI](https://github.com/browserstack/browserstack-local-csharp/actions/workflows/ci.yml/badge.svg)](https://github.com/browserstack/browserstack-local-csharp/actions/workflows/ci.yml)\n\nC# bindings for BrowserStack Local.\n\n## Setup\n\nOpen the solution file `BrowserStack/BrowserStack.sln` in `Visual Studio`. The projects are `Visual Studio 2015` compatible.\nYou will need to resolve the references from the `Solution Explorer`. `Visual Studio` with automatically download the references from NuGet.\n\n## Example\n\n```\nusing BrowserStack;\n\n# creates an instance of Local\nLocal local = new Local();\n\n# replace \u003cbrowserstack-accesskey\u003e with your key. You can also set an environment variable - \"BROWSERSTACK_ACCESS_KEY\".\nList\u003cKeyValuePair\u003cstring, string\u003e\u003e bsLocalArgs = new List\u003cKeyValuePair\u003cstring, string\u003e\u003e() {\n  new KeyValuePair\u003cstring, string\u003e(\"key\", \"\u003cbrowserstack-accesskey\u003e\"),\n};\n\n# starts the Local instance with the required arguments\nlocal.start(bsLocalArgs);\n\n# check if BrowserStack local instance is running\nConsole.WriteLine(local.isRunning());\n\n# stop the Local instance\nlocal.stop();\n```\n\n## Arguments\n\nApart from the key, all other BrowserStack Local modifiers are optional. For the full list of modifiers, refer [BrowserStack Local modifiers](https://www.browserstack.com/local-testing#modifiers). For examples, refer below -\n\n#### Verbose Logging\nTo enable verbose logging -\n```\nbsLocalArgs.Add(new KeyValuePair\u003cstring, string\u003e(\"v\", \"true\"));\n```\n\n#### Folder Testing\nTo test local folder rather internal server, provide path to folder as value of this option -\n```\nbsLocalArgs.Add(new KeyValuePair\u003cstring, string\u003e(\"f\", \"/my/awesome/folder\"));\n```\n\n#### Force Start\nTo kill other running Browserstack Local instances -\n```\nbsLocalArgs.Add(new KeyValuePair\u003cstring, string\u003e(\"force\", \"true\"));\n```\n\n#### Only Automate\nTo disable local testing for Live and Screenshots, and enable only Automate -\n```\nbsLocalArgs.Add(new KeyValuePair\u003cstring, string\u003e(\"onlyAutomate\", \"true\"));\n```\n\n#### Force Local\nTo route all traffic via local(your) machine -\n```\nbsLocalArgs.Add(new KeyValuePair\u003cstring, string\u003e(\"forcelocal\", \"true\"));\n```\n\n#### Proxy\nTo use a proxy for local testing -\n\n* proxyHost: Hostname/IP of proxy, remaining proxy options are ignored if this option is absent\n* proxyPort: Port for the proxy, defaults to 3128 when -proxyHost is used\n* proxyUser: Username for connecting to proxy (Basic Auth Only)\n* proxyPass: Password for USERNAME, will be ignored if USERNAME is empty or not specified\n\n```\nbsLocalArgs.Add(new KeyValuePair\u003cstring, string\u003e(\"proxyHost\", \"127.0.0.1\"));\nbsLocalArgs.Add(new KeyValuePair\u003cstring, string\u003e(\"proxyPort\", \"8000\"));\nbsLocalArgs.Add(new KeyValuePair\u003cstring, string\u003e(\"proxyUser\", \"user\"));\nbsLocalArgs.Add(new KeyValuePair\u003cstring, string\u003e(\"proxyPass\", \"password\"));\n```\n\n#### Local Proxy\nTo use local proxy in local testing -\n\n* localProxyHost: Hostname/IP of proxy, remaining proxy options are ignored if this option is absent\n* localProxyPort: Port for the proxy, defaults to 8081 when -localProxyHost is used\n* localProxyUser: Username for connecting to proxy (Basic Auth Only)\n* localProxyPass: Password for USERNAME, will be ignored if USERNAME is empty or not specified\n\n```\nbsLocalArgs.Add(new KeyValuePair\u003cstring, string\u003e(\"localProxyHost\", \"127.0.0.1\"));\nbsLocalArgs.Add(new KeyValuePair\u003cstring, string\u003e(\"localProxyPort\", \"8000\"));\nbsLocalArgs.Add(new KeyValuePair\u003cstring, string\u003e(\"-localProxyUser\", \"user\"));\nbsLocalArgs.Add(new KeyValuePair\u003cstring, string\u003e(\"-localProxyPass\", \"password\"));\n```\n\n#### PAC (Proxy Auto-Configuration)\nTo use PAC (Proxy Auto-Configuration) in local testing -\n\n* pac-file: PAC (Proxy Auto-Configuration) file’s absolute path\n\n```\nbsLocalArgs.Add(new KeyValuePair\u003cstring, string\u003e(\"-pac-file\", \"\u003cpac_file_abs_path\u003e\"));\n```\n\n#### Local Identifier\nIf doing simultaneous multiple local testing connections, set this uniquely for different processes -\n```\nbsLocalArgs.Add(new KeyValuePair\u003cstring, string\u003e(\"localIdentifier\", \"randomstring\"));\n```\n\n## Additional Arguments\n\n#### Binary Path\n\nBy 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.\nPath to specify local Binary path -\n```\nbsLocalArgs.Add(new KeyValuePair\u003cstring, string\u003e(\"binarypath\", \"/browserstack/BrowserStackLocal\"));\n```\n\n#### Logfile\nTo 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.\nTo specify the path to file where the logs will be saved -\n```\nbsLocalArgs.Add(new KeyValuePair\u003cstring, string\u003e(\"v\", \"true\"));\nbsLocalArgs.Add(new KeyValuePair\u003cstring, string\u003e(\"logfile\", \"/browserstack/logs.txt\"));\n```\n\n## Contribute\n\n### Build Instructions\n\nTo run the test suite run the nunit tests from Visual Studio.\n\n### Packaging\n\nTo pack using nuget, run `nuget pack BrowserStackLocal\\BrowserStackLocal\\BrowserStackLocal.csproj -Prop Configuration=Release`\n\n### Reporting bugs\n\nYou can submit bug reports either in the Github issue tracker.\n\nBefore 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.\n\nWhen 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.\n\n### Pull Requests\n\nWe love pull requests! We are very happy to work with you to get your changes merged in, however, please keep the following in mind.\n\n* Adhere to the coding conventions you see in the surrounding code.\n* Include tests, and make sure all tests pass.\n* 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.\n\n## Example\n\nTo run the example,\n- open the solution file `BrowserStackExample/BrowserStackExample.sln`\n- resolve the references (Will need to resolve the reference to BrowserStack.dll [built from the main project])\n- change the `BROWSERSTACK_USERNAME` and `BROWSERSTACK_ACCESS_KEY` string variables to your BrowserStack username and key mentioned [here](https://www.browserstack.com/accounts/settings)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrowserstack%2Fbrowserstack-local-csharp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrowserstack%2Fbrowserstack-local-csharp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrowserstack%2Fbrowserstack-local-csharp/lists"}