diff --git a/README.md b/README.md index 6cbcab92..a26ab280 100755 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ -
Example: test_demo_site.py from ./examples/ (Uses --chrome
by default)
Example: test_demo_site.py from ./examples/ (Uses --chrome
by default)
(--demo
mode slows down tests and highlights actions)
(--demo
mode slows down tests and highlights actions)
๐ก SeleniumBase is a Python framework for browser automation and testing. SeleniumBase uses Selenium/WebDriver APIs, and incorporates test-runners such as pytest
, pynose
, and behave
to provide organized structure, test discovery, test execution, test state (eg. passed, failed, or skipped), and command-line options for changing default settings (such as choosing the browser to use). With raw Selenium, you would need to set up your own options-parser for configuring tests from the command-line.
๐ก SeleniumBase is a Python framework for browser automation and testing. SeleniumBase uses Selenium/WebDriver APIs, and incorporates test-runners such as pytest
, pynose
, and behave
to provide organized structure, test discovery, test execution, test state (eg. passed, failed, or skipped), and command-line options for changing default settings (such as choosing the browser to use). With raw Selenium, you would need to set up your own options-parser for configuring tests from the command-line.
๐ก With raw Selenium, commands that use selectors need to specify the type of selector (eg. "css selector", "button#myButton"
). With SeleniumBase, there's auto-detection between CSS Selectors and XPath, which means you don't need to specify the type of selector in your commands (but optionally you could).
๐ก With raw Selenium, commands that use selectors need to specify the type of selector (eg. "css selector", "button#myButton"
). With SeleniumBase, there's auto-detection between CSS Selectors and XPath, which means you don't need to specify the type of selector in your commands (but optionally you could).
๐ก SeleniumBase methods often perform multiple actions in a single method call. For example, self.type(selector,text)
does the following:
1. Waits for the element to be visible.
2. Waits for the element to be interactive.
3. Clears the text field.
4. Types in the new text.
5. Presses Enter/Submit if the text ends in "\n"
.
With raw Selenium, those actions require multiple method calls.
๐ก SeleniumBase methods often perform multiple actions in a single method call. For example, self.type(selector,text)
does the following:
1. Waits for the element to be visible.
2. Waits for the element to be interactive.
3. Clears the text field.
4. Types in the new text.
5. Presses Enter/Submit if the text ends in "\n"
.
With raw Selenium, those actions require multiple method calls.
๐ก SeleniumBase uses default timeout values when not set:
-โ
self.click("button")
+โ
self.click("button")
With raw Selenium, methods would fail instantly (by default) if an element needed more time to load:
-โself.driver.find_element(by="css selector", value="button").click()
+โself.driver.find_element(by="css selector", value="button").click()
(Reliable code is better than unreliable code.)
๐ก SeleniumBase lets you change the explicit timeout values of methods:
-โ
self.click("button",timeout=10)
+โ
self.click("button",timeout=10)
With raw Selenium, that requires more code:
-โWebDriverWait(driver,10).until(EC.element_to_be_clickable("css selector", "button")).click()
+โWebDriverWait(driver,10).until(EC.element_to_be_clickable("css selector", "button")).click()
(Simple code is better than complex code.)
๐ก SeleniumBase gives you clean error output when a test fails. With raw Selenium, error messages can get very messy.
-๐ก SeleniumBase gives you the option to generate a dashboard and reports for tests. It also saves screenshots from failing tests to the ./latest_logs/
folder. Raw Selenium does not have these options out-of-the-box.
๐ก SeleniumBase gives you the option to generate a dashboard and reports for tests. It also saves screenshots from failing tests to the ./latest_logs/
folder. Raw Selenium does not have these options out-of-the-box.
๐ก SeleniumBase includes desktop GUI apps for running tests, such as SeleniumBase Commander for pytest
and SeleniumBase Behave GUI for behave
.
๐ก SeleniumBase includes desktop GUI apps for running tests, such as SeleniumBase Commander for pytest
and SeleniumBase Behave GUI for behave
.
๐ก SeleniumBase has its own Recorder / Test Generator that can create tests from manual browser actions. SeleniumBase also includes other useful tools and console scripts for getting things done quickly. (See the documentation for more details!)
@@ -185,7 +185,7 @@ class TestMFALogin(BaseCase): self.save_screenshot_to_logs() ``` -๐๐ An example test with the sb
pytest
fixture. Runs with pytest.
๐๐ An example test with the sb
pytest
fixture. Runs with pytest.
๐๐ An example test with the SB
Context Manager. Runs with pure python
.
๐๐ An example test with the SB
Context Manager. Runs with pure python
.
๐๐ An example test with behave-BDD Gherkin structure. Runs with behave
. (Learn more)
๐๐ An example test with behave-BDD Gherkin structure. Runs with behave
. (Learn more)
pytest
, pynose
, or pure python
. Not all test runners can run all test formats. For example, tests that use the ``sb`` pytest fixture can only be run with ``pytest``. (See Syntax Formats) There's also a Gherkin test format that runs with behave.
+Most SeleniumBase scripts can be run with pytest
, pynose
, or pure python
. Not all test runners can run all test formats. For example, tests that use the ``sb`` pytest fixture can only be run with ``pytest``. (See Syntax Formats) There's also a Gherkin test format that runs with behave.
```bash
pytest coffee_cart_tests.py --rs
@@ -478,20 +478,20 @@ behave realworld.feature
behave calculator.feature -D rs -D dashboard
```
-โ
pytest
includes automatic test discovery. If you don't specify a specific file or folder to run, pytest
will automatically search through all subdirectories for tests to run based on the following criteria:
โ
pytest
includes automatic test discovery. If you don't specify a specific file or folder to run, pytest
will automatically search through all subdirectories for tests to run based on the following criteria:
โ
You can do a pre-flight check to see which tests would get discovered by pytest
before the real flight:
โ
You can do a pre-flight check to see which tests would get discovered by pytest
before the real flight:
โ
You can be more specific when calling pytest
or pynose
on a file:
โ
You can be more specific when calling pytest
or pynose
on a file:
โ
No More Flaky Tests! SeleniumBase methods automatically wait for page elements to finish loading before interacting with them (up to a timeout limit). This means you no longer need random time.sleep()
statements in your scripts.
โ
No More Flaky Tests! SeleniumBase methods automatically wait for page elements to finish loading before interacting with them (up to a timeout limit). This means you no longer need random time.sleep()
statements in your scripts.
pytest
:
+โ
Here are some useful command-line options that come with pytest
:
```bash
-v # Verbose mode. Prints the full name of each test and shows more details.
@@ -577,7 +577,7 @@ pytest test_coffee_cart.py --trace
```
-โ
SeleniumBase provides additional pytest
command-line options for tests:
+โ
SeleniumBase provides additional pytest
command-line options for tests:
```bash
--browser=BROWSER # (The web browser to use. Default: "chrome".)
@@ -923,7 +923,7 @@ pytest user_agent_test.py --agent="Mozilla/5.0 (Nintendo 3DS; U; ; en) Version/1
self.accept_alert()
automatically waits for and accepts alert pop-ups. self.dismiss_alert()
automatically waits for and dismisses alert pop-ups. On occasion, some methods like self.click(SELECTOR)
might dismiss a pop-up on its own because they call JavaScript to make sure that the readyState
of the page is complete
before advancing. If you're trying to accept a pop-up that got dismissed this way, use this workaround: Call self.find_element(SELECTOR).click()
instead, (which will let the pop-up remain on the screen), and then use self.accept_alert()
to accept the pop-up (more on that here). If pop-ups are intermittent, wrap code in a try/except block.
+๐ต self.accept_alert()
automatically waits for and accepts alert pop-ups. self.dismiss_alert()
automatically waits for and dismisses alert pop-ups. On occasion, some methods like self.click(SELECTOR)
might dismiss a pop-up on its own because they call JavaScript to make sure that the readyState
of the page is complete
before advancing. If you're trying to accept a pop-up that got dismissed this way, use this workaround: Call self.find_element(SELECTOR).click()
instead, (which will let the pop-up remain on the screen), and then use self.accept_alert()
to accept the pop-up (more on that here). If pop-ups are intermittent, wrap code in a try/except block.
--with-s3-logging
on the command-line when running your tests.--with-s3-logging
on the command-line when running your tests.self.get_page_source()
method with Python's find()
command to parse through HTML to find something specific. (For more advanced parsing, see the BeautifulSoup example.)
+ProTipโข: You can use the self.get_page_source()
method with Python's find()
command to parse through HTML to find something specific. (For more advanced parsing, see the BeautifulSoup example.)
```python
source = self.get_page_source()
@@ -1001,13 +1001,13 @@ self.click("div#my_id")
๐ต **Typing Text:**
-self.type(selector, text)
# updates the text from the specified element with the specified value. An exception is raised if the element is missing or if the text field is not editable. Example:
+self.type(selector, text)
# updates the text from the specified element with the specified value. An exception is raised if the element is missing or if the text field is not editable. Example:
```python
self.type("input#id_value", "2012")
```
-You can also use self.add_text()
or the WebDriver .send_keys()
command, but those won't clear the text box first if there's already text inside.
+You can also use self.add_text()
or the WebDriver .send_keys()
command, but those won't clear the text box first if there's already text inside.
๐ต **Getting the text from an element on a page:**
@@ -1109,7 +1109,7 @@ if self.is_text_visible("You Shall Not Pass!", "h1"):
is_text_visible():
is_text_visible():
If your test opens up a new tab/window, you can switch to it. (SeleniumBase automatically switches to new tabs that don't open to about:blank
URLs.)
If your test opens up a new tab/window, you can switch to it. (SeleniumBase automatically switches to new tabs that don't open to about:blank
URLs.)
self.generate_referral(start_page, end_page)
and the self.generate_traffic(start_page, end_page, loops)
methods.)
+(Due to popular demand, this traffic generation example has been included in SeleniumBase with the self.generate_referral(start_page, end_page)
and the self.generate_traffic(start_page, end_page, loops)
methods.)
deferred_assert_element()
and deferred_assert_text()
will save any exceptions that would be raised.
-To flush out all the failed deferred asserts into a single exception, make sure to call self.process_deferred_asserts()
at the end of your test method. If your test hits multiple pages, you can call self.process_deferred_asserts()
before navigating to a new page so that the screenshot from your log files matches the URL where the deferred asserts were made.
+deferred_assert_element()
and deferred_assert_text()
will save any exceptions that would be raised.
+To flush out all the failed deferred asserts into a single exception, make sure to call self.process_deferred_asserts()
at the end of your test method. If your test hits multiple pages, you can call self.process_deferred_asserts()
before navigating to a new page so that the screenshot from your log files matches the URL where the deferred asserts were made.
You can use pytest --reruns=NUM
to retry failing tests that many times. Add --reruns-delay=SECONDS
to wait that many seconds between retries. Example:
You can use pytest --reruns=NUM
to retry failing tests that many times. Add --reruns-delay=SECONDS
to wait that many seconds between retries. Example:
You can use the @retry_on_exception()
decorator to retry failing methods. (First import: from seleniumbase import decorators
). To learn more about SeleniumBase decorators, click here.
You can use the @retry_on_exception()
decorator to retry failing methods. (First import: from seleniumbase import decorators
). To learn more about SeleniumBase decorators, click here.
behave
scripts from a Desktop GUI.behave
scripts from a Desktop GUI.Run Selected Tests
button.
+๐๐๏ธ Once launched, you can further customize which tests to run and what settings to use. There are various controls for changing settings, modes, and other "behave" command line options that are specific to SeleniumBase. You can also set additional options that don't have a visible toggle. When you're ready to run the selected tests with the specified options, click on the Run Selected Tests
button.
๐โช With the Dashboard enabled, you'll get one of these:
diff --git a/help_docs/commander.md b/help_docs/commander.md
index 8ae395b0..9336b5b7 100644
--- a/help_docs/commander.md
+++ b/help_docs/commander.md
@@ -2,7 +2,7 @@
## [pytest
scripts from a Desktop GUI.pytest
scripts from a Desktop GUI.Run Selected Tests
button.
+๐๏ธ Once launched, you can further customize which tests to run and what settings to use. There are various controls for changing settings, modes, and other pytest command line options that are specific to SeleniumBase. You can also set additional options that don't have a visible toggle. When you're ready to run the selected tests with the specified options, click on the Run Selected Tests
button.
--------
diff --git a/help_docs/customizing_test_runs.md b/help_docs/customizing_test_runs.md
index 3bba9f1e..6bb47c62 100644
--- a/help_docs/customizing_test_runs.md
+++ b/help_docs/customizing_test_runs.md
@@ -251,7 +251,7 @@ pytest -n8
You can use pytest --reruns=NUM
to retry failing tests that many times. Add --reruns-delay=SECONDS
to wait that many seconds between retries. Example:
You can use pytest --reruns=NUM
to retry failing tests that many times. Add --reruns-delay=SECONDS
to wait that many seconds between retries. Example:
-n8 --dist=loadgroup
(click to expand)-n8 --dist=loadgroup
(click to expand)xdist_group
mark. Groups are distributed to available workers as whole units. This guarantees that all tests with the same xdist_group
name run in the same worker.xdist_group
mark. Groups are distributed to available workers as whole units. This guarantees that all tests with the same xdist_group
name run in the same worker.+This makes
test_1
andTest::test_2
run in the same worker. Tests without thexdist_group
mark are distributed normally.
This makes
test_1
andTest::test_2
run in the same worker. Tests without thexdist_group
mark are distributed normally.
BaseCase
is imported at the top of a Python file, followed by a Python class inheriting BaseCase
. Then, any test method defined in that class automatically gains access to SeleniumBase methods, including the setUp()
and tearDown()
methods that are automatically called for opening and closing web browsers at the start and end of tests.
+In this format, (which is used by most of the tests in the SeleniumBase examples folder), BaseCase
is imported at the top of a Python file, followed by a Python class inheriting BaseCase
. Then, any test method defined in that class automatically gains access to SeleniumBase methods, including the setUp()
and tearDown()
methods that are automatically called for opening and closing web browsers at the start and end of tests.
To run a test of this format, use **``pytest``** or ``pynose``. Adding ``BaseCase.main(__name__, __file__)`` enables ``python`` to run ``pytest`` on your file indirectly. Here's an example:
@@ -67,7 +67,7 @@ Using ``BaseCase`` inheritance is a great starting point for anyone learning Sel
setUp
and tearDown
of your tests. Maybe you want to have all your tests login to a specific web site first, or maybe you want to have your tests report results through an API call depending on whether a test passed or failed. This can be done by creating a subclass of BaseCase
and then carefully creating custom setUp()
and tearDown()
methods that don't overwrite the critical functionality of the default SeleniumBase setUp()
and tearDown()
methods. Afterwards, your test classes will inherit the subclass of BaseCase
with the added functionality, rather than directly inheriting BaseCase
itself. Here's an example of that:
+There are situations where you may want to customize the setUp
and tearDown
of your tests. Maybe you want to have all your tests login to a specific web site first, or maybe you want to have your tests report results through an API call depending on whether a test passed or failed. This can be done by creating a subclass of BaseCase
and then carefully creating custom setUp()
and tearDown()
methods that don't overwrite the critical functionality of the default SeleniumBase setUp()
and tearDown()
methods. Afterwards, your test classes will inherit the subclass of BaseCase
with the added functionality, rather than directly inheriting BaseCase
itself. Here's an example of that:
```python
from seleniumbase import BaseCase
@@ -114,7 +114,7 @@ class MyTests(BaseTestCase):
setUp()
and tearDown()
methods at the beginning and end of test methods. To work, sb
is added as an argument to each test method definition that needs SeleniumBase functionality. This means you no longer need import statements in your Python files to use SeleniumBase. If using other pytest fixtures in your tests, you may need to use the SeleniumBase fixture (instead of BaseCase
class inheritance) for compatibility reasons. Here's an example of the sb
fixture in a test that does not use Python classes:
+The pytest framework comes with a unique system called fixtures, which replaces import statements at the top of Python files by importing libraries directly into test definitions. More than just being an import, a pytest fixture can also automatically call predefined setUp()
and tearDown()
methods at the beginning and end of test methods. To work, sb
is added as an argument to each test method definition that needs SeleniumBase functionality. This means you no longer need import statements in your Python files to use SeleniumBase. If using other pytest fixtures in your tests, you may need to use the SeleniumBase fixture (instead of BaseCase
class inheritance) for compatibility reasons. Here's an example of the sb
fixture in a test that does not use Python classes:
```python
def test_sb_fixture_with_no_class(sb):
@@ -129,7 +129,7 @@ def test_sb_fixture_with_no_class(sb):
sb
pytest fixture can also be used inside of a class. There is a slight change to the syntax because that means test methods must also include self
in their argument definitions when test methods are defined. (The self
argument represents the class object, and is used in every test method that lives inside of a class.) Once again, no import statements are needed in your Python files for this to work. Here's an example of using the sb
fixture in a test method that lives inside of a Python class:
+The sb
pytest fixture can also be used inside of a class. There is a slight change to the syntax because that means test methods must also include self
in their argument definitions when test methods are defined. (The self
argument represents the class object, and is used in every test method that lives inside of a class.) Once again, no import statements are needed in your Python files for this to work. Here's an example of using the sb
fixture in a test method that lives inside of a Python class:
```python
class Test_SB_Fixture:
@@ -145,7 +145,7 @@ class Test_SB_Fixture:
self
variable (from test methods that inherit BaseCase
) contains the driver and all other framework-specific variable definitions. Therefore, that self
must be passed as an arg into any outside class method in order to call SeleniumBase methods from there. In the example below, the self
variable from the test method is passed into the sb
arg of the Page Object class method because the self
arg of the Page Object class method is already being used for its own class. Every Python class method definition must include the self
as the first arg.
+With SeleniumBase, you can use Page Objects to break out code from tests, but remember, the self
variable (from test methods that inherit BaseCase
) contains the driver and all other framework-specific variable definitions. Therefore, that self
must be passed as an arg into any outside class method in order to call SeleniumBase methods from there. In the example below, the self
variable from the test method is passed into the sb
arg of the Page Object class method because the self
arg of the Page Object class method is already being used for its own class. Every Python class method definition must include the self
as the first arg.
```python
from seleniumbase import BaseCase
@@ -170,7 +170,7 @@ class MyTests(BaseCase):
BaseCase
inheritance, except that this time we pass the sb
pytest fixture from the test into the sb
arg of the page object class method, (instead of passing self
). Now that you're using sb
as a pytest fixture, you no longer need to import BaseCase
anywhere in your code. See the example below:
+This is similar to the classic Page Object Model with BaseCase
inheritance, except that this time we pass the sb
pytest fixture from the test into the sb
arg of the page object class method, (instead of passing self
). Now that you're using sb
as a pytest fixture, you no longer need to import BaseCase
anywhere in your code. See the example below:
```python
class LoginPage:
@@ -192,7 +192,7 @@ class MyTests:
request
fixture can be used to retrieve other pytest fixtures from within tests, such as the sb
fixture. This allows you to have more control over when fixtures get initialized because the fixture no longer needs to be loaded at the very beginning of test methods. This is done by calling request.getfixturevalue('sb')
from the test. Here's an example of using the pytest request
fixture to load the sb
fixture in a test method that does not use Python classes:
+The pytest request
fixture can be used to retrieve other pytest fixtures from within tests, such as the sb
fixture. This allows you to have more control over when fixtures get initialized because the fixture no longer needs to be loaded at the very beginning of test methods. This is done by calling request.getfixturevalue('sb')
from the test. Here's an example of using the pytest request
fixture to load the sb
fixture in a test method that does not use Python classes:
```python
def test_request_sb_fixture(request):
@@ -210,7 +210,7 @@ def test_request_sb_fixture(request):
request
fixture can also be used to get the sb
fixture from inside a Python class. Here's an example of that:
+The pytest request
fixture can also be used to get the sb
fixture from inside a Python class. Here's an example of that:
```python
class Test_Request_Fixture:
@@ -230,7 +230,7 @@ class Test_Request_Fixture:
BaseCase
, but you want total freedom to control how you spin up your web browsers, this is the format you want. Although SeleniumBase gives you plenty of command-line options to change how your browsers are launched, this format gives you more control when the existing options aren't enough. Here's an example of that:
+When you want to use SeleniumBase methods via BaseCase
, but you want total freedom to control how you spin up your web browsers, this is the format you want. Although SeleniumBase gives you plenty of command-line options to change how your browsers are launched, this format gives you more control when the existing options aren't enough. Here's an example of that:
```python
from selenium import webdriver
@@ -398,7 +398,7 @@ class TestWire:
BaseCase
inheritance, but there's a different import statement, and method names have been translated into Chinese. Here's an example of that:
+This format is similar to the English version with BaseCase
inheritance, but there's a different import statement, and method names have been translated into Chinese. Here's an example of that:
```python
from seleniumbase.translate.chinese import ็กๆต่ฏ็จไพ
@@ -430,7 +430,7 @@ class ๆ็ๆต่ฏ็ฑป(็กๆต่ฏ็จไพ):
BaseCase
inheritance, but there's a different import statement, and method names have been translated into Dutch. Here's an example of that:
+This format is similar to the English version with BaseCase
inheritance, but there's a different import statement, and method names have been translated into Dutch. Here's an example of that:
```python
from seleniumbase.translate.dutch import Testgeval
@@ -461,7 +461,7 @@ class MijnTestklasse(Testgeval):
BaseCase
inheritance, but there's a different import statement, and method names have been translated into French. Here's an example of that:
+This format is similar to the English version with BaseCase
inheritance, but there's a different import statement, and method names have been translated into French. Here's an example of that:
```python
from seleniumbase.translate.french import CasDeBase
@@ -492,7 +492,7 @@ class MaClasseDeTest(CasDeBase):
BaseCase
inheritance, but there's a different import statement, and method names have been translated into Italian. Here's an example of that:
+This format is similar to the English version with BaseCase
inheritance, but there's a different import statement, and method names have been translated into Italian. Here's an example of that:
```python
from seleniumbase.translate.italian import CasoDiProva
@@ -523,7 +523,7 @@ class MiaClasseDiTest(CasoDiProva):
BaseCase
inheritance, but there's a different import statement, and method names have been translated into Japanese. Here's an example of that:
+This format is similar to the English version with BaseCase
inheritance, but there's a different import statement, and method names have been translated into Japanese. Here's an example of that:
```python
from seleniumbase.translate.japanese import ใปใฌใใฆใ ใในใใฑใผใน
@@ -555,7 +555,7 @@ class ็งใฎใในใใฏใฉใน(ใปใฌใใฆใ ใในใใฑใผใน):
BaseCase
inheritance, but there's a different import statement, and method names have been translated into Korean. Here's an example of that:
+This format is similar to the English version with BaseCase
inheritance, but there's a different import statement, and method names have been translated into Korean. Here's an example of that:
```python
from seleniumbase.translate.korean import ์
๋ ๋_ํ
์คํธ_์ผ์ด์ค
@@ -585,7 +585,7 @@ class ํ
์คํธ_ํด๋์ค(์
๋ ๋_ํ
์คํธ_์ผ์ด์ค):
BaseCase
inheritance, but there's a different import statement, and method names have been translated into Portuguese. Here's an example of that:
+This format is similar to the English version with BaseCase
inheritance, but there's a different import statement, and method names have been translated into Portuguese. Here's an example of that:
```python
from seleniumbase.translate.portuguese import CasoDeTeste
@@ -619,7 +619,7 @@ class MinhaClasseDeTeste(CasoDeTeste):
BaseCase
inheritance, but there's a different import statement, and method names have been translated into Russian. Here's an example of that:
+This format is similar to the English version with BaseCase
inheritance, but there's a different import statement, and method names have been translated into Russian. Here's an example of that:
```python
from seleniumbase.translate.russian import ะขะตััะะฐะกะตะปะตะฝ
@@ -650,7 +650,7 @@ class ะะพะนะขะตััะพะฒัะนะะปะฐัั(ะขะตััะะฐะกะตะปะตะฝ):
BaseCase
inheritance, but there's a different import statement, and method names have been translated into Spanish. Here's an example of that:
+This format is similar to the English version with BaseCase
inheritance, but there's a different import statement, and method names have been translated into Spanish. Here's an example of that:
```python
from seleniumbase.translate.spanish import CasoDePrueba
@@ -783,7 +783,7 @@ def login_to_swag_labs(context, user):
test
option to True
(or calling python --test
), then standard test logging will occur, such as screenshots and reports for failing tests. All the usual SeleniumBase options are available, such as customizing the browser settings, etc. Here are some examples:
+This format provides a pure Python way of using SeleniumBase without a test runner. Options can be passed via method instantiation or from the command-line. When setting the test
option to True
(or calling python --test
), then standard test logging will occur, such as screenshots and reports for failing tests. All the usual SeleniumBase options are available, such as customizing the browser settings, etc. Here are some examples:
```python
from seleniumbase import SB
@@ -803,7 +803,7 @@ with SB() as sb: # By default, browser="chrome" if not set.
(See examples/raw_sb.py for the test.)
-Here's another example, which uses test
mode:
+Here's another example, which uses test
mode:
```python
from seleniumbase import SB
@@ -834,7 +834,7 @@ with SB(test=True, rtf=True, demo=True) as sb:
webdriver
instance in a with
block. The SeleniumBase Driver Manager will automatically make sure that your driver is compatible with your browser version. It gives you full access to customize driver options via method args or via the command-line. The driver will automatically call quit()
after the code leaves the with
block. Here are some examples:
+This pure Python format gives you a raw webdriver
instance in a with
block. The SeleniumBase Driver Manager will automatically make sure that your driver is compatible with your browser version. It gives you full access to customize driver options via method args or via the command-line. The driver will automatically call quit()
after the code leaves the with
block. Here are some examples:
```python
"""This script can be run with pure "python". (pytest not needed)."""