# What are assertions available to test relational comparisons in Selenium with python?

Selenium Web DriverAutomation TestingSoftware Testing

#### React Full Stack Web Development With Spring Boot

67 Lectures 4.5 hours

#### The Complete Selenium WebDriver with Java Course

192 Lectures 20 hours

#### Fundamentals of React and Flux Web Development

48 Lectures 10.5 hours

There are numerous assertions available to test relational comparisons in Selenium. They are listed below −

• assertGreater – This assertion has two parameters. A comparison is done between the first and second parameter. In case the first parameter is greater than the second one, the test case is considered a pass; else the test case is failed.

The third parameter of assertGreater is an optional one. It is mostly used for informational purposes for result analysis.

## Syntax

assertGreater(3, 2)
• assertGreaterEqual – This assertion has two parameters. A comparison is done between the first and second parameter. In case the first parameter is greater than equal to the second one, the test case is considered a pass; else the test case is failed.

The third parameter of assertGreaterEqual is an optional one. It is mostly used for informational purposes for result analysis.

## Syntax

assertGreater(2, 2)
• assertLesser – This assertion has two parameters. A comparison is done between the first and second parameter. In case the first parameter is less than the second one, the test case is considered a pass; else the test case is failed.

The third parameter of assertLesser is an optional one. It is mostly used for informational purposes for result analysis.

## Syntax

assertLesser(2, 3)
• assertLesserEqual – This assertion has two parameters. A comparison is done between the first and second parameter. In case the first parameter is less than equal to the second one, the test case is considered a pass; else the test case is failed.

The third parameter of assertLesserEqual is an optional one. It is mostly used for informational purposes for result analysis.

## Syntax

assertLesserEqual(1, 3)

Updated on 29-Jul-2020 10:46:28