© Sujay Raghavendra 2021
S. RaghavendraPython Testing with Seleniumhttps://doi.org/10.1007/978-1-4842-6249-8_8

8. Assertions

Sujay Raghavendra1  
(1)
Dharwad, Karnataka, India
 

In the preceding chapters, you studied locating web elements like links, buttons, frames, and textboxes, and the test cases related to them. Before automating any test case for a web app or page, you need to validate it, which is done by providing conditions about the web element. This validation or check is done by using assertion functions, which are available in Selenium with Python.

The assertion allows you to validate or check an expected value with the allocated value of the web elements. The allocated value may be any attribute associated with it, and the expected value ...

Get Python Testing with Selenium: Learn to Implement Different Testing Techniques Using the Selenium WebDriver now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.