{"id":21944819,"url":"https://github.com/browserstack/browserstack-local-java","last_synced_at":"2025-04-06T03:12:23.730Z","repository":{"id":41165409,"uuid":"51923142","full_name":"browserstack/browserstack-local-java","owner":"browserstack","description":"Java bindings for BrowserStack Local","archived":false,"fork":false,"pushed_at":"2024-12-26T12:30:13.000Z","size":146,"stargazers_count":18,"open_issues_count":26,"forks_count":35,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-03-30T02:09:48.871Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.browserstack.com","language":"Java","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:06:38.000Z","updated_at":"2024-12-26T12:30:14.000Z","dependencies_parsed_at":"2025-01-09T18:43:28.657Z","dependency_job_id":null,"html_url":"https://github.com/browserstack/browserstack-local-java","commit_stats":{"total_commits":133,"total_committers":21,"mean_commits":6.333333333333333,"dds":0.7593984962406015,"last_synced_commit":"23e1b35539f94935af37778e79c3507801f8f951"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserstack%2Fbrowserstack-local-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserstack%2Fbrowserstack-local-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserstack%2Fbrowserstack-local-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserstack%2Fbrowserstack-local-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/browserstack","download_url":"https://codeload.github.com/browserstack/browserstack-local-java/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247427012,"owners_count":20937214,"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:12.120Z","updated_at":"2025-04-06T03:12:23.715Z","avatar_url":"https://github.com/browserstack.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# browserstack-local-java\n\n[![Build Status](https://travis-ci.org/browserstack/browserstack-local-java.svg?branch=master)](https://travis-ci.org/browserstack/browserstack-local-java)\n\nJava bindings for BrowserStack Local.\n\n## Installation\n\nAdd this dependency to your project's POM:\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.browserstack\u003c/groupId\u003e\n    \u003cartifactId\u003ebrowserstack-local-java\u003c/artifactId\u003e\n    \u003cversion\u003e1.1.5\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## Example\n\n```java\nimport com.browserstack.local.Local;\n\n// creates an instance of Local\nLocal bsLocal = new Local();\n\n// replace \u003cbrowserstack-accesskey\u003e with your key. You can also set an environment variable - \"BROWSERSTACK_ACCESS_KEY\".\nHashMap\u003cString, String\u003e bsLocalArgs = new HashMap\u003cString, String\u003e();\nbsLocalArgs.put(\"key\", \"\u003cbrowserstack-accesskey\u003e\");\n\n// starts the Local instance with the required arguments\nbsLocal.start(bsLocalArgs);\n\n// check if BrowserStack local instance is running\nSystem.out.println(bsLocal.isRunning());\n\n// stop the Local instance\nbsLocal.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```java\nbsLocalArgs.put(\"v\", \"true\");\n```\n\n#### Folder Testing\nTo test local folder rather internal server, provide path to folder as value of this option -\n```java\nbsLocalArgs.put(\"f\", \"/my/awesome/folder\");\n```\n\n#### Force Start\nTo kill other running Browserstack Local instances -\n```java\nbsLocalArgs.put(\"force\", \"true\");\n```\n\n#### Only Automate\nTo disable local testing for Live and Screenshots, and enable only Automate -\n```java\nbsLocalArgs.put(\"onlyAutomate\", \"true\");\n```\n\n#### Force Local\nTo route all traffic via local(your) machine -\n```java\nbsLocalArgs.put(\"forcelocal\", \"true\");\n```\n#### Force Proxy\nTo route all traffic via the proxy specified.\n```java\nbsLocalArgs.put(\"forceproxy\", \"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```java\nbsLocalArgs.put(\"proxyHost\", \"127.0.0.1\");\nbsLocalArgs.put(\"proxyPort\", \"8000\");\nbsLocalArgs.put(\"proxyUser\", \"user\");\nbsLocalArgs.put(\"proxyPass\", \"password\");\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```java\nbsLocalArgs.put(\"localProxyHost\", \"127.0.0.1\");\nbsLocalArgs.put(\"localProxyPort\", \"8000\");\nbsLocalArgs.put(\"-localProxyUser\", \"user\");\nbsLocalArgs.put(\"-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```java\nbsLocalArgs.put(\"-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```java\nbsLocalArgs.put(\"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```java\nbsLocalArgs.put(\"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```java\nbsLocalArgs.put(\"v\", \"true\");\nbsLocalArgs.put(\"logFile\", \"/browserstack/logs.txt\");\n```\n\n## Contribute\n\n### Compile Instructions\n\nTo compile the package, `mvn compile`.\n\nTo run the test suite run, `mvn test`.\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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrowserstack%2Fbrowserstack-local-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrowserstack%2Fbrowserstack-local-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrowserstack%2Fbrowserstack-local-java/lists"}