You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# starts the Local instance with the required arguments
20
+
bsLocal.start(bsLocalArgs);
18
21
19
-
*`key`: BrowserStack Access Key
20
-
*`v`: Provides verbose logging
21
-
*`f`: If you want to test local folder rather internal server, provide path to folder as value of this option
22
-
*`force`: Kill other running Browserstack Local
23
-
*`only`: Restricts Local Testing access to specified local servers and/or folders
24
-
*`forcelocal`: Route all traffic via local machine
25
-
*`onlyAutomate`: Disable Live Testing and Screenshots, just test Automate
26
-
*`proxyHost`: Hostname/IP of proxy, remaining proxy options are ignored if this option is absent
27
-
*`proxyPort`: Port for the proxy, defaults to 3128 when -proxyHost is used
28
-
*`proxyUser`: Username for connecting to proxy (Basic Auth Only)
29
-
*`proxyPass`: Password for USERNAME, will be ignored if USERNAME is empty or not specified
30
-
*`localIdentifier`: If doing simultaneous multiple local testing connections, set this uniquely for different processes
31
-
*`hosts`: List of hosts and ports where Local must be enabled for eg. localhost,3000,1,localhost,3001,0
32
-
*`logfile`: Path to file where Local logs be saved to
33
-
*`binarypath`: Optional path to Local binary
22
+
# check if BrowserStack local instance is running
23
+
System.out.println(bsLocal.isRunning());
34
24
25
+
#stop the Local instance
26
+
bsLocal.stop();
27
+
```
35
28
36
-
## Build
29
+
## Arguments
37
30
38
-
To build run, `mvn compile`.
31
+
Apart 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 -
39
32
33
+
#### Verbose Logging
34
+
To enable verbose logging -
35
+
```
36
+
bsLocalArgs.put("v", "true");
37
+
```
40
38
41
-
## Tests
39
+
#### Folder Testing
40
+
To test local folder rather internal server, provide path to folder as value of this option -
41
+
```
42
+
bsLocalArgs.put("f", "/my/awesome/folder");
43
+
```
44
+
45
+
#### Force Start
46
+
To kill other running Browserstack Local instances -
47
+
```
48
+
bsLocalArgs.put("force", "true");
49
+
```
50
+
51
+
#### Only Automate
52
+
To disable local testing for Live and Screenshots, and enable only Automate -
53
+
```
54
+
bsLocalArgs.put("onlyAutomate", "true");
55
+
```
56
+
57
+
#### Force Local
58
+
To route all traffic via local(your) machine -
59
+
```
60
+
bsLocalArgs.put("forcelocal", "true");
61
+
```
62
+
63
+
#### Proxy
64
+
To use a proxy for local testing -
65
+
66
+
* proxyHost: Hostname/IP of proxy, remaining proxy options are ignored if this option is absent
67
+
* proxyPort: Port for the proxy, defaults to 3128 when -proxyHost is used
68
+
* proxyUser: Username for connecting to proxy (Basic Auth Only)
69
+
* proxyPass: Password for USERNAME, will be ignored if USERNAME is empty or not specified
70
+
71
+
```
72
+
bsLocalArgs.put("proxyHost", "127.0.0.1");
73
+
bsLocalArgs.put("proxyPort", "8000");
74
+
bsLocalArgs.put("proxyUser", "user");
75
+
bsLocalArgs.put("proxyPass", "password");
76
+
```
77
+
78
+
#### Local Identifier
79
+
If doing simultaneous multiple local testing connections, set this uniquely for different processes -
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.
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.
96
+
To specify the path to file where the logs will be saved -
You can submit bug reports either in the Github issue tracker.
113
+
114
+
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.
115
+
116
+
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.
117
+
118
+
### Pull Requests
119
+
120
+
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.
121
+
122
+
* Adhere to the coding conventions you see in the surrounding code.
123
+
* Include tests, and make sure all tests pass.
124
+
* 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.
0 commit comments