@@ -6,13 +6,13 @@ Python bindings for BrowserStack Local.
6
6
7
7
## Installation
8
8
9
- ```
9
+ ``` sh
10
10
pip install browserstack-local
11
11
```
12
12
13
13
## Example
14
14
15
- ```
15
+ ``` python
16
16
from browserstack.local import Local
17
17
18
18
# creates an instance of Local
@@ -25,7 +25,7 @@ bs_local_args = { "key": "<browserstack-accesskey>" }
25
25
bs_local.start(** bs_local_args)
26
26
27
27
# check if BrowserStack local instance is running
28
- print bs_local.isRunning()
28
+ print ( bs_local.isRunning() )
29
29
30
30
# stop the Local instance
31
31
bs_local.stop()
@@ -38,31 +38,31 @@ Apart from the key, all other BrowserStack Local modifiers are optional. For the
38
38
39
39
#### Verbose Logging
40
40
To enable verbose logging -
41
- ```
41
+ ``` sh
42
42
bs_local_args = { " key" : " <browserstack-accesskey>" , " v" : " true" }
43
43
` ` `
44
44
45
45
# ### Folder Testing
46
46
To test local folder rather internal server, provide path to folder as value of this option -
47
- ```
47
+ ` ` ` sh
48
48
bs_local_args = { " key" : " <browserstack-accesskey>" , " f" : " /my/awesome/folder" }
49
49
` ` `
50
50
51
51
# ### Force Start
52
52
To kill other running Browserstack Local instances -
53
- ```
53
+ ` ` ` sh
54
54
bs_local_args = { " key" : " <browserstack-accesskey>" , " force" : " true" }
55
55
` ` `
56
56
57
57
# ### Only Automate
58
58
To disable local testing for Live and Screenshots, and enable only Automate -
59
- ```
59
+ ` ` ` sh
60
60
bs_local_args = { " key" : " <browserstack-accesskey>" , " onlyAutomate" : " true" }
61
61
` ` `
62
62
63
63
# ### Force Local
64
64
To route all traffic via local(your) machine -
65
- ```
65
+ ` ` ` sh
66
66
bs_local_args = { " key" : " <browserstack-accesskey>" , " forcelocal" : " true" }
67
67
` ` `
68
68
@@ -74,13 +74,13 @@ To use a proxy for local testing -
74
74
* proxyUser: Username for connecting to proxy (Basic Auth Only)
75
75
* proxyPass: Password for USERNAME, will be ignored if USERNAME is empty or not specified
76
76
77
- ```
77
+ ` ` ` sh
78
78
bs_local_args = { " key" : " <browserstack-accesskey>" , " proxyHost" : " 127.0.0.1" , " proxyPort" : " 8000" , " proxyUser" : " user" , " proxyPass" : " password" }
79
79
` ` `
80
80
81
81
# ### Local Identifier
82
82
If doing simultaneous multiple local testing connections, set this uniquely for different processes -
83
- ```
83
+ ` ` ` sh
84
84
bs_local_args = { " key" : " <browserstack-accesskey>" , " localIdentifier" : " randomstring" }
85
85
` ` `
86
86
@@ -90,14 +90,14 @@ bs_local_args = { "key": "<browserstack-accesskey>" , "localIdentifier": "random
90
90
91
91
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.
92
92
Path to specify local Binary path -
93
- ```
93
+ ` ` ` sh
94
94
bs_local_args = { " key" : " <browserstack-accesskey>" , " binarypath" : " /browserstack/BrowserStackLocal" }
95
95
` ` `
96
96
97
97
# ### Logfile
98
98
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.
99
99
To specify the path to file where the logs will be saved -
100
- ```
100
+ ` ` ` sh
101
101
bs_local_args = { " key" : " <browserstack-accesskey>" , " v" : " true" , " logfile" : " /browserstack/logs.txt" }
102
102
` ` `
103
103
0 commit comments