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
* A [Python virtual env](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/) is recommended. <i><ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/virtualenv_instructions.md">See shortcut</a>.</i>
63
+
* Get **[Python](https://www.python.org/downloads/)** and **[Git](https://git-scm.com/)**
66
64
67
-
Upgrade **[pip](https://pypi.org/project/pip/)** to prevent warnings:
65
+
Upgrade <b>[pip](https://pypi.org/project/pip/)</b> and create a [Python virtual environment](https://seleniumbase.io/help_docs/virtualenv_instructions/):
<h3><imgsrc="https://seleniumbase.io/img/sb_icon.png"title="SeleniumBase"width="30" /> Download a webdriver:</h3>
89
104
90
-
SeleniumBase can download a webdriver to the [seleniumbase/drivers](https://github.com/seleniumbase/SeleniumBase/tree/master/seleniumbase/drivers) folder with the ``install`` command:
105
+
SeleniumBase can download webdrivers to the [seleniumbase/drivers](https://github.com/seleniumbase/SeleniumBase/tree/master/seleniumbase/drivers) folder with the ``install`` command:
91
106
```bash
92
-
seleniumbase install chromedriver
107
+
sbase install chromedriver
93
108
```
94
-
* You need a different webdriver for each web browser you want to run automation on: ``chromedriver`` for Chrome, ``edgedriver`` for Edge, ``geckodriver`` for Firefox, ``operadriver`` for Opera, and ``iedriver`` for Internet Explorer.
109
+
* You need a different webdriver for each browser: ``chromedriver`` for Chrome, ``edgedriver`` for Edge, ``geckodriver`` for Firefox, and ``operadriver`` for Opera.
95
110
* If you have the latest version of Chrome installed, get the latest chromedriver (<i>otherwise it defaults to chromedriver 2.44 for compatibility reasons</i>):
96
111
```bash
97
-
seleniumbase install chromedriver latest
112
+
sbase install chromedriver latest
98
113
```
99
114
100
-
(See [seleniumbase.io/seleniumbase/console_scripts/ReadMe/](https://seleniumbase.io/seleniumbase/console_scripts/ReadMe/) for more information on SeleniumBase console scripts, such as ``seleniumbase install`` and ``seleniumbase mkdir``.)
115
+
(See [seleniumbase.io/seleniumbase/console_scripts/ReadMe/](https://seleniumbase.io/seleniumbase/console_scripts/ReadMe/) for more information on SeleniumBase console scripts.)
101
116
102
-
<h3><imgsrc="https://seleniumbase.io/img/sb_icon.png"title="SeleniumBase"width="30" /> Run a test on Chrome:</h3>
117
+
<h3><imgsrc="https://seleniumbase.io/img/sb_icon.png"title="SeleniumBase"width="30" /> Create and run tests:</h3>
118
+
119
+
* Use ``sbase mkdir DIR`` to create a folder with sample tests:
103
120
104
121
```bash
105
-
cd examples/
106
-
pytest my_first_test.py
122
+
sbase mkdir ui_tests
123
+
cd ui_tests/
124
+
```
125
+
126
+
* Now run a sample test with ``pytest``:
127
+
128
+
```bash
129
+
pytest test_demo_site.py
107
130
```
108
131
109
132
* Chrome is the default browser if not specified with ``--browser=BROWSER``.
110
133
* On Linux ``--headless`` is the default behavior (running with no GUI). You can also run in headless mode on any OS. If your Linux machine has a GUI and you want to see the web browser as tests run, add ``--headed`` or ``--gui``.
111
134
135
+
<b>If you've cloned SeleniumBase from GitHub, you can also run tests from the [SeleniumBase/examples/](https://github.com/seleniumbase/SeleniumBase/tree/master/examples) folder:</b>
136
+
137
+
```bash
138
+
cd examples/
139
+
pytest my_first_test.py
140
+
pytest test_swag_labs.py
141
+
```
142
+
112
143
<b>Run [my_first_test.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/my_first_test.py) in Demo Mode:</b>
113
144
114
145
```bash
@@ -193,7 +224,7 @@ element.send_keys("dogs")
193
224
element.submit()
194
225
```
195
226
196
-
As you can see, the old WebDriver way is very bad!
227
+
As you can see, the old WebDriver way is not efficient!
197
228
Use SeleniumBase to make testing much easier!
198
229
(You can still use ``self.driver`` in your code.)
199
230
@@ -380,12 +411,12 @@ Now inside your tests, you can use ``self.data`` to access that.
380
411
381
412
For running tests outside of the SeleniumBase repo with **Pytest**, you'll want a copy of **[pytest.ini](https://github.com/seleniumbase/SeleniumBase/blob/master/pytest.ini)** on the root folder. For running tests outside of the SeleniumBase repo with **Nosetests**, you'll want a copy of **[setup.cfg](https://github.com/seleniumbase/SeleniumBase/blob/master/setup.cfg)** on the root folder. (Subfolders should include a blank ``__init__.py`` file.) These files specify default configuration details for tests. (For nosetest runs, you can also specify a .cfg file by using ``--config``. Example ``nosetests [MY_TEST].py --config=[MY_CONFIG].cfg``)
382
413
383
-
As a shortcut, you'll be able to run ``seleniumbase mkdir [DIRECTORY_NAME]`` to create a new folder that already contains necessary files and some example tests that you can run. Example:
414
+
As a shortcut, you'll be able to run ``sbase mkdir [DIRECTORY]`` to create a new folder that already contains necessary files and some example tests that you can run.
Copy file name to clipboardExpand all lines: examples/translations/ReadMe.md
+3-5Lines changed: 3 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,11 +7,9 @@
7
7
8
8
Examples can be found in [<ahref="https://github.com/seleniumbase/SeleniumBase/tree/master/examples/translations">SeleniumBase/examples/translations</a>].
9
9
10
-
Multi-language tests are run with **pytest** like any other test. Every test method has a one-to-one mapping to every other supported language.<br /><i>Examples:</i>
10
+
Multi-language tests are run with **pytest** like any other test. Every test method has a one-to-one mapping to every other supported language.<i>Example:</i>
Copy file name to clipboardExpand all lines: help_docs/translations.md
+3-5Lines changed: 3 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,11 +7,9 @@
7
7
8
8
Examples can be found in [<ahref="https://github.com/seleniumbase/SeleniumBase/tree/master/examples/translations">SeleniumBase/examples/translations</a>].
9
9
10
-
Multi-language tests are run with **pytest** like any other test. Every test method has a one-to-one mapping to every other supported language.<br /><i>Examples:</i>
10
+
Multi-language tests are run with **pytest** like any other test. Every test method has a one-to-one mapping to every other supported language.<i>Example:</i>
*``virtualenvwrapper`` can make it easier to work with [Python virtual environments](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/) by giving you the ``mkvirtualenv`` command.
4
6
5
7
### macOS / Linux:
6
8
7
9
(*Shortcut*: Run "``source virtualenv_install.sh``" from the top-level SeleniumBase folder to perform the following steps.)
(If you have multiple versions of Python installed on your machine, and you want your virtual environment to use a specific Python version, add ``--python=PATH_TO_PYTHON_EXE`` with the Python executable to use.)
31
+
* (Python 3) ``python3 -m venv ENV``:
36
32
37
-
* (Python 3) Using ``python3 -m venv``:
38
33
```bash
39
34
python3 -m venv sbase_env
40
35
source sbase_env/bin/activate
41
36
```
42
37
43
-
### Windows:
38
+
* (Python 2, 3) ``mkvirtualenv ENV``:
44
39
45
-
* Using ``mkvirtualenv`` (any version of Python):
46
40
```bash
47
41
mkvirtualenv sbase_env
48
42
```
49
43
(If you have multiple versions of Python installed on your machine, and you want your virtual environment to use a specific Python version, add ``--python=PATH_TO_PYTHON_EXE`` with the Python executable to use.)
50
44
51
-
* (Python 3) Using ``py -m venv``:
45
+
### Windows:
46
+
47
+
* (Python 3) ``py -m venv ENV``:
48
+
52
49
```bash
53
50
py -m venv sbase_env
54
51
call sbase_env\\Scripts\\activate
55
52
```
56
53
54
+
* (Python 2, 3) ``mkvirtualenv ENV``:
55
+
```bash
56
+
mkvirtualenv sbase_env
57
+
```
58
+
(If you have multiple versions of Python installed on your machine, and you want your virtual environment to use a specific Python version, add ``--python=PATH_TO_PYTHON_EXE`` with the Python executable to use.)
0 commit comments