Here is something that confuses everyone arriving from Cypress or Playwright.
Selenium has no assertion library. None. There is no expect, no should. Search the documentation and you will not find one.
That is not an omission. Selenium's job is to control a browser. Deciding whether a value is correct is a different job, and it was left to the tools that already did it well.
So a Selenium project has two halves you assemble yourself:
- Selenium WebDriver finds elements and does things to them.
- A test framework and assertion library structures the tests and checks the results.