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
<palign="left"><b>One of many examples:</b> <ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_demo_site.py">test_demo_site.py</a></p>
> (When using a virtual env, the Editable install is faster.)
80
80
81
-
🔵 You can also install ``seleniumbase`` from [pypi](https://pypi.org/project/seleniumbase/):
81
+
🔵 Installing ``seleniumbase`` from PyPI:
82
82
83
83
```bash
84
84
pip install seleniumbase
85
85
```
86
86
87
87
> (Add ``--upgrade`` OR ``-U`` to install the latest ``seleniumbase``.)
88
88
> (Add ``--force-reinstall`` to also install the latest dependencies.)
89
-
> (Add ``--index-url=http://pypi.python.org/simple/`` if blocked by a VPN.)
90
89
> (Use ``pip3`` if multiple versions of Python are installed.)
91
90
92
91
🔵 Type ``seleniumbase`` or ``sbase`` to verify that SeleniumBase was installed successfully:
@@ -130,13 +129,13 @@ COMMANDS:
130
129
Use "pytest"for running tests.
131
130
```
132
131
133
-
<h3><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> Downloading web drivers:</h3>
132
+
<h3><img src="https://seleniumbase.io/img/green_logo.png" title="SeleniumBase" width="32" /> Downloading web drivers:</h3>
134
133
135
134
✅ SeleniumBase automatically downloads web drivers as needed, such as ``chromedriver`` and ``geckodriver`` (Firefox).
136
135
137
136
✅ To manually download a webdriver, see [Console Scripts](https://seleniumbase.io/seleniumbase/console_scripts/ReadMe/) OR [Webdriver Installation](https://seleniumbase.io/help_docs/webdriver_installation/).
🔵 If you've cloned SeleniumBase, you can run tests from the [examples/](https://github.com/seleniumbase/SeleniumBase/tree/master/examples) folder.
142
141
@@ -192,7 +191,7 @@ self.assert_no_js_errors() # Verify there are no JS errors.
192
191
193
192
🔵 For the complete list of SeleniumBase methods, see: <b><a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/method_summary.md">Method Summary</a></b>
<p>SeleniumBase automatically handles common WebDriver actions such as spinning up web browsers and saving screenshots during test failures. (<i><a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/customizing_test_runs.md">Read more about customizing test runs</a>.</i>)</p>
<a id="seleniumbase_demo_mode"></a> <b>Use Demo Mode to help you see what tests are asserting.</b>
241
240
@@ -377,7 +376,7 @@ Here's the command-line option to add to tests: (See [examples/custom_settings.p
377
376
Inside your tests, you can use ``self.data`` to access that.
378
377
379
378
380
-
<h3><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> Test Directory Configuration:</h3>
379
+
<h3><img src="https://seleniumbase.io/img/green_logo.png" title="SeleniumBase" width="32" /> Test Directory Configuration:</h3>
381
380
382
381
🔵 When running tests with **pytest**, you'll want a copy of **[pytest.ini](https://github.com/seleniumbase/SeleniumBase/blob/master/pytest.ini)**in your root folders. When running tests with **nosetests**, you'll want a copy of **[setup.cfg](https://github.com/seleniumbase/SeleniumBase/blob/master/setup.cfg)** in your root folders. These files specify default configuration details for tests. Folders should also include a blank ``__init__.py`` file, which allows your tests to import files from that folder.
383
382
@@ -433,7 +432,7 @@ Of those files, the ``pytest.ini`` config file is the most important, followed b
433
432
434
433
--------
435
434
436
-
<h3><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> Log files from failed tests:</h3>
435
+
<h3><img src="https://seleniumbase.io/img/green_logo.png" title="SeleniumBase" width="32" /> Log files from failed tests:</h3>
437
436
438
437
Let's try an example of a test that fails:
439
438
@@ -458,7 +457,7 @@ pytest test_fail.py
458
457
459
458
--------
460
459
461
-
<h3><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> The SeleniumBase Dashboard:</h3>
460
+
<h3><img src="https://seleniumbase.io/img/green_logo.png" title="SeleniumBase" width="32" /> The SeleniumBase Dashboard:</h3>
462
461
463
462
🔵 The ``--dashboard`` option for pytest generates a SeleniumBase Dashboard located at ``dashboard.html``, which updates automatically as tests run and produce results. Example:
<h3><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> Using a Proxy Server:</h3>
548
+
<h3><img src="https://seleniumbase.io/img/green_logo.png" title="SeleniumBase" width="32" /> Using a Proxy Server:</h3>
550
549
551
550
If you wish to use a proxy server for your browser tests (Chromium or Firefox), you can add ``--proxy=IP_ADDRESS:PORT`` as an argument on the command line.
<h3><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> Changing the User-Agent:</h3>
577
+
<h3><img src="https://seleniumbase.io/img/green_logo.png" title="SeleniumBase" width="32" /> Changing the User-Agent:</h3>
579
578
580
579
🔵 If you wish to change the User-Agent for your browser tests (Chromium and Firefox only), you can add ``--agent="USER AGENT STRING"`` as an argument on the command-line.
<h3><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> Handling Pop-Up / Pop Up Alerts:</h3>
586
+
<h3><img src="https://seleniumbase.io/img/green_logo.png" title="SeleniumBase" width="32" /> Handling Pop-Up / Pop Up Alerts:</h3>
588
587
589
588
🔵 <code>self.accept_alert()</code> automatically waits for and accepts alert pop-ups. <code>self.dismiss_alert()</code> automatically waits for and dismisses alert pop-ups. On occasion, some methods like <code>self.click(SELECTOR)</code> might dismiss a pop-up on its own because they call JavaScript to make sure that the <code>readyState</code> of the page is <code>complete</code> before advancing. If you're trying to accept a pop-up that got dismissed this way, use this workaround: Call <code>self.find_element(SELECTOR).click()</code> instead, (which will let the pop-up remain on the screen), and then use <code>self.accept_alert()</code> to accept the pop-up (<a href="https://github.com/seleniumbase/SeleniumBase/issues/600#issuecomment-647270426">more on that here</a>). If pop-ups are intermittent, wrap code in a try/except block.
590
589
591
590
592
-
<h3><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> Building Guided Tours for Websites:</h3>
591
+
<h3><img src="https://seleniumbase.io/img/green_logo.png" title="SeleniumBase" width="32" /> Building Guided Tours for Websites:</h3>
593
592
594
593
🔵 Learn about <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/tour_examples/ReadMe.md">SeleniumBase Interactive Walkthroughs</a> (in the ``examples/tour_examples/`` folder). It's great for prototyping a website onboarding experience.
595
594
596
595
597
596
<a id="utilizing_advanced_features"></a>
598
-
<h3><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> Production Environments & Integrations:</h3>
597
+
<h3><img src="https://seleniumbase.io/img/green_logo.png" title="SeleniumBase" width="32" /> Production Environments & Integrations:</h3>
599
598
600
599
🔵 Here are some things you can do to set up a production environment for your testing:
<p>Additionally, you can use the <code>@retry_on_exception()</code> decorator to specifically retry failing methods. (First import: <code>from seleniumbase import decorators</code>) To learn more about SeleniumBase decorators, [click here](https://github.com/seleniumbase/SeleniumBase/tree/master/seleniumbase/common).</p>
> (Add ``--upgrade`` OR ``-U`` to upgrade an installation.)
36
36
> (Add ``--force-reinstall`` to upgrade dependencies.)
37
+
> (Add ``--index-url=http://pypi.python.org/simple/`` if blocked by a VPN.)
37
38
> (Use ``pip3`` if multiple versions of Python are installed.)
38
39
39
40
(If you're not using a virtual environment, you may need to add <code>--user</code> to your <code>pip</code> command if you're seeing errors during installation.)
0 commit comments