Learn more
Automatic WebDriver abilities:
¶
SeleniumBase automatically handles common WebDriver actions such as spinning up web browsers and saving screenshots during test failures. (Read more about customizing test runs.)
Simplified code:
¶
SeleniumBase uses simple syntax for commands, such as:
self.update_text("input", "dogs\n")
The same command with regular WebDriver is very messy: (And it doesn't include SeleniumBase smart-waiting.)
self.driver.find_element_by_css_selector("input").clear() # Not always needed
self.driver.find_element_by_css_selector("input").send_keys("dogs")
self.driver.find_element_by_css_selector("input").submit()
(You can still use self.driver in your code.)
Run tests with pytest or nosetests in any browser:
¶
(Using pytest is recommended. Chrome is the default browser.)
pytest my_first_test.py --browser=chrome
nosetests test_suite.py --browser=firefox
All Python methods that start with test_ will automatically be run when using pytest or nosetests on a Python file, (or on folders containing Python files). You can also be more specific on what to run within a file by using the following: (Note that the syntax is different for pytest vs nosetests.)
pytest [FILE_NAME].py::[CLASS_NAME]::[METHOD_NAME]
nosetests [FILE_NAME].py:[CLASS_NAME].[METHOD_NAME]
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.
Automated/manual hybrid mode:
¶
SeleniumBase includes a solution called MasterQA, which speeds up manual testing by having automation perform all the browser actions while the manual tester handles validatation.
Feature-Rich:
¶
For a full list of SeleniumBase features, Click Here.