pythonseleniumselenium-webdriverwebdriverwebdriverwait

WebDriverWait for multiple conditions (OR logical evaluation)


Using python, the method WebDriverWait is used to wait for 1 element to be present on the webpage. How can this method be used without multiple try/except? Is there an OR option for multiple cases using this method? https://selenium-python.readthedocs.io/waits.html


Solution

  • Without using multiple try/except{} to induce WebDriverWait for two elements through OR option you can use either of the following solutions:


    Reference

    You can find a couple of relevant discussions in: