This uses an HTTP based web driver that treats every command as a separate request.

  • Event driven

Locator Strategies

  1. class name locates elements whose class name contains the search value
  2. css selector locates elements matching a css selector
  3. id locates elements whose ID attribute matches the search value
  4. name locates elements whose Name attribute matches the search value
  5. link text locates anchor elements whose visible text matches the search value
  6. partial link text locates elements whose tag name matches the search value
  7. xpath locates 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