This uses an HTTP based web driver that treats every command as a separate request.
- Event driven
Locator Strategies
class namelocates elements whose class name contains the search valuecss selectorlocates elements matching a css selectoridlocates elements whose ID attribute matches the search valuenamelocates elements whose Name attribute matches the search valuelink textlocates anchor elements whose visible text matches the search valuepartial link textlocates elements whose tag name matches the search valuexpathlocates elements matching an XPath expression
Framework Dependency
- Selenium provides the web driver and web element APIs not a test assertion library.
- The assertions come from the testing framework you use with selenium like pytest, or JUnit, etc
Waiting Strategies
- Implicit wait: A global setting that instructs the web driver to poll the DOM for a specified maximum amount of time when trying to find an element before throwing an Exception
- Once set, this wait applies toe very element-location call
- If the element is found before the timeout, the script proceeds
- This only checks existence, not intractability
- Explicit wait: Pauses the test execution until a specific, predefined condition is met or a maximum timeout is reached
- It is applied only to the specific element and condition
- It waits for a specific contition
- The script proceeds once the condition is met