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
* Add ``--upgrade`` OR ``-U`` to upgrade an installation.
73
73
* Add ``--force-reinstall`` to also upgrade dependencies.
74
74
75
-
### <imgsrc="https://cdn2.hubspot.net/hubfs/100006/images/super_square_logo_3a.png"title="SeleniumBase"height="32" /> Download a webdriver:
75
+
### <imgsrc="https://cdn2.hubspot.net/hubfs/100006/images/super_square_logo_3.png"title="SeleniumBase"height="32" /> Download a webdriver:
76
76
77
77
SeleniumBase can download a webdriver to the [seleniumbase/drivers](https://github.com/seleniumbase/SeleniumBase/tree/master/seleniumbase/drivers) folder with the ``install`` command:
@@ -143,7 +143,7 @@ self.save_screenshot(FILE_NAME) # Save a screenshot of the current page
143
143
```
144
144
For the complete list of SeleniumBase methods, see: **[help_docs/method_summary.md](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/method_summary.md)**
SeleniumBase automatically handles common WebDriver actions such as spinning up web browsers and saving screenshots during test failures. (<i>[Read more about customizing test runs](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/customizing_test_runs.md).</i>)
@@ -190,9 +190,9 @@ For a full list of SeleniumBase features, [Click Here](https://github.com/seleni
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``)
332
332
@@ -338,7 +338,7 @@ pytest my_first_test.py
338
338
```
339
339
340
340
341
-
### <imgsrc="https://cdn2.hubspot.net/hubfs/100006/images/super_square_logo_3a.png"title="SeleniumBase"height="32"> **Logging / Results from Failing Tests:**
341
+
### <imgsrc="https://cdn2.hubspot.net/hubfs/100006/images/super_square_logo_3.png"title="SeleniumBase"height="32"> **Logging / Results from Failing Tests:**
342
342
343
343
Let's try an example of a test that fails:
344
344
```python
@@ -361,7 +361,7 @@ You'll notice that a logs folder, "latest_logs", was created to hold information
361
361
362
362
363
363
<aid="creating_visual_reports"></a>
364
-
### <imgsrc="https://cdn2.hubspot.net/hubfs/100006/images/super_square_logo_3a.png"title="SeleniumBase"height="32"> **Creating Visual Test Suite Reports:**
364
+
### <imgsrc="https://cdn2.hubspot.net/hubfs/100006/images/super_square_logo_3.png"title="SeleniumBase"height="32"> **Creating Visual Test Suite Reports:**
365
365
366
366
(NOTE: Several command-line args are different for Pytest vs Nosetests)
(NOTE: You can add ``--show-report`` to immediately display Nosetest reports after the test suite completes. Only use ``--show-report`` when running tests locally because it pauses the test run.)
391
391
392
392
393
-
### <imgsrc="https://cdn2.hubspot.net/hubfs/100006/images/super_square_logo_3a.png"title="SeleniumBase"height="32"> **Using a Proxy Server:**
393
+
### <imgsrc="https://cdn2.hubspot.net/hubfs/100006/images/super_square_logo_3.png"title="SeleniumBase"height="32"> **Using a Proxy Server:**
394
394
395
395
If you wish to use a proxy server for your browser tests (Chrome and Firefox only), you can add ``--proxy=IP_ADDRESS:PORT`` as an argument on the command-line.
### <imgsrc="https://cdn2.hubspot.net/hubfs/100006/images/super_square_logo_3a.png"title="SeleniumBase"height="32"> **Changing the User-Agent:**
411
+
### <imgsrc="https://cdn2.hubspot.net/hubfs/100006/images/super_square_logo_3.png"title="SeleniumBase"height="32"> **Changing the User-Agent:**
412
412
413
413
If you wish to change the User-Agent for your browser tests (Chrome and Firefox only), you can add ``--agent="USER AGENT STRING"`` as an argument on the command-line.
### <imgsrc="https://cdn2.hubspot.net/hubfs/100006/images/super_square_logo_3a.png"title="SeleniumBase"height="32"> **Building Guided Tours for Websites:**
419
+
### <imgsrc="https://cdn2.hubspot.net/hubfs/100006/images/super_square_logo_3.png"title="SeleniumBase"height="32"> **Building Guided Tours for Websites:**
420
420
421
421
Learn about [SeleniumBase Interactive Walkthroughs](https://github.com/seleniumbase/SeleniumBase/tree/master/examples/tour_examples/ReadMe.md) (in the ``examples/tour_examples`` folder). It's great for prototyping a website onboarding experience.
422
422
423
423
<imgsrc="https://cdn2.hubspot.net/hubfs/100006/google_tour_3.gif"title="SeleniumBase Tour of Google" />
Additionally, you can use the ``@retry_on_exception()`` decorator to specifically retry failing methods. (First import: ``from seleniumbase import decorators``) To learn more about SeleniumBase decorators, [click here](https://github.com/seleniumbase/SeleniumBase/tree/master/seleniumbase/common).
## <imgsrc="https://cdn2.hubspot.net/hubfs/100006/images/super_square_logo_3a.png"title="SeleniumBase"height="32"> **Running Example Tests:**
3
+
## <imgsrc="https://cdn2.hubspot.net/hubfs/100006/images/super_square_logo_3.png"title="SeleniumBase"height="32"> **Running Example Tests:**
4
4
5
5
SeleniumBase tests are run with **``pytest``** or **``nosetests``**. (<i>Using pytest is recommended.</i>) ``Chrome`` is the default browser if not specified. During test failures, logs and screenshots from the most recent test run are saved to the ``latest_logs/`` folder.
6
6
7
7
(NOTE: Some example tests in this folder fail on purpose to demonstrate [logging features](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/example_logs/ReadMe.md).)
## <imgsrc="https://cdn2.hubspot.net/hubfs/100006/images/super_square_logo_3a.png"title="SeleniumBase"height="32"> Customizing test runs
3
+
## <imgsrc="https://cdn2.hubspot.net/hubfs/100006/images/super_square_logo_3.png"title="SeleniumBase"height="32"> Customizing test runs
4
4
5
5
You can customize test runs from the command-line thanks to [SeleniumBase's pytest plugin](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/plugins/pytest_plugin.py), which adds command-line options for setting/enabling the browser type, headless mode, mobile mode, multithreading mode, demo mode, proxy config, user agent config, browser extensions, and more.
0 commit comments