I often need to wait for an AJAX call to add text to an element on my pages after the download is complete. I understand how to use WebDriverWait to wait for a certain text to be present in an element, but I do not see how to wait until any text appears. I am trying to avoid a while loop that continues to check the text of a non == '' element.
Here I use to find specific text:
try: WebDriverWait(self.driver, 10).until(EC.text_to_be_present_in_element((By.ID, 'myElem'), 'foo')) except TimeoutException: raise Exception('Unable to find text in this element after waiting 10 seconds')
Is there any way to check any text or non-empty string?
source share