When writing selenium tests in Python, Iām used to using Explicit Waits repeatedly to wait for a page to load or to wait for an element to become visible, or clickable, etc.:
from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC element = WebDriverWait(driver, 10).until( EC.presence_of_element_located((By.ID, "myDynamicElement")) )
The key concept here is to provide the expected condition for the wait; there are several types:
Using the expected conditions makes the code cleaner and more reliable than using sleep with hard-coded time intervals.
Now we are moving from our end-to-end testing infrastructure to a lot of protractor .
Are there similar Expected Conditions in the transporter as it is in python-selenium or java-selenium ? If not, what is the canonical way to explicitly wait for a condition in a protractor ?
I looked through the documentation documentation and found nothing about it.
python selenium testing selenium-webdriver protractor
alecxe Jan 02 '15 at 4:22 2015-01-02 04:22
source share