So ... it looks like any element using Selenium WebDriver Wait actually uses a polling scheme. Remember that explicitly waiting for Selenium is the code that you define in order to wait for a certain condition before continuing with the code. WebDriverWait by default calls ExpectedCondition every 500 milliseconds until it returns successfully. ( link. ). What does this mean every 500 ms, Selenium checks the wait state. If this is true, go on. If this is not the case, wait for another polling frequency cycle, and then try again.
And from my testing, I believe that the survey is not ready yet, but let's call it an error that definitely generates errors in my ghostdriver.log
[ERROR - 2016-08-14T08:50:12.896Z] WebElementLocator - _handleLocateCommand - Element(s) NOT Found: GAVE UP. Search Stop Time: 1471164612878
I am working on a project that removes a complex single-page AJAX site. Since the site reuses common div elements, I need to make many calls (clear, paste the value, click, wait, go to another table on the page, copy the data of interest, repeat ...) to get the data I need. And since the site is slow, I apply the wait elements through:
driver.wait.until(EC.presence_of_element_located((By.XPATH, "//*[@id='special_content_id']//td[contains(.,'" + info.unitId + "')]")))
It turns out that the polling frequency is set in the class selenium.webdriver.support.wait.WebDriverWait(driver, timeout, poll_frequency=0.5, ignored_exceptions=None)
Link here.
I was curious about the behavior. When my poll_frequency was set to 0.5 seconds, I got 98 WebElementLocator errors. When I switched this to 7.5 seconds, driver.wait = WebDriverWait(driver, 60, 7.5) , I received only 36 errors. Less polling time causes more errors.
What I really find strange is that I would not expect the usual polling behavior (Selenium) to result in a log error anywhere (PhantomJS). I'm sorry that there was no other journal entry for the survey, the item is not ready yet ...