Here's the book.
- Selenium is a set of tools for automating browsers
- Selenium Ide:this is a Firefox add-in used to record and play back the Selenium scripts with Firefox.
- Selenium Webdriver:this is a programming interface for developing advanced Selenium scripts using programming languages.
- Installing the Seleniun package:pip install-u Selenium
- The Selenium.webdriver module implements the browser driver classes that is supported by selenium, including Firefox, CHR ome, interne Explorer, Safari, and various other browsers, and Remotewebdriver to test on browsers that is hosted on Remo Te machines
- Test Fixture:by using a test Fixture, we can define the prepartion needed to perform one or more tests and any associated clean-up actions
- Test case:a test case was the smallest unit of testing in UnitTest. It checks for a specific response to a particular set of actions and inputs using various assert methods provided by the U Nitest Library. The UnitTest library provides a base class called TestCase that is used to create new test cases.
- Test suite:a Test Suite is A collection of multiple tests or test cases to create groups of tests representing specific F Unctionality or modules of the application under test, which would be executed together.
- The starting point for test cases are the SetUp () method, which we can use to perform some tasks at the start of each test Or all the tests, that'll be defined in the class. The method takes no arguments and doesn ' t return anything. When a setUp () method is defined, the test runner would run that method prior to each test method.
- For each test method, the Test runner finds, it executes the setUp () method before executing the test method.
- How about sharing a single Firefox instance between the methods instead of creating a new instance every time? This can is done by using the SetupClass () and Teardownclass () methods and using the @classmethod decorator. These methods allow us to initialize values on the classes level instead of the the method level and then share these values B Etween hte test methods.
- Using the testsuites feature of UnitTest, we can collect various tests into logical groups and then into a unified test Su Ite that can is run with a single command
- Selenium provides various find_element_by methods to find elements on a Web page. These methods search for a element based on the criteria supplied to them. If a matching element is found, an instance of webelement are returned or the nosuchelementexception exception is thrown if Selenium is isn't able to find any element matching the search criteria
- To create a Data-driven test we need the @ddt decorator for the test class and use the @data decorator on the data- Driven test methods.
- The @data decorator takes as many arguments as we have the values, we want to feed to the test.
- The Page object pattern is making tests separate from low-level actions, and providing a high-level abstraction.
- The Page object pattern offers creating an object representing each Web page from the application under test. We can define classes for each page, modeling all attributes and the actions for that page.
<learning Selenium testing Tools with Python>