<learning Selenium testing Tools with python>

Source: Internet
Author: User

Here's the book.

  1. Selenium is a set of tools for automating browsers
  2. Selenium Ide:this is a Firefox add-in used to record and play back the Selenium scripts with Firefox.
  3. Selenium Webdriver:this is a programming interface for developing advanced Selenium scripts using programming languages.
  4. Installing the Seleniun package:pip install-u Selenium
  5. 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
  6. 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
  7. 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.
  8. 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.
  9. 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.
  10. For each test method, the Test runner finds, it executes the setUp () method before executing the test method.
  11. 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.
  12. 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
  13. 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
  14. 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.
  15. The @data decorator takes as many arguments as we have the values, we want to feed to the test.
  16. The Page object pattern is making tests separate from low-level actions, and providing a high-level abstraction.
  17. 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>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.