I often need to wait for an AJAX call to add text to an element on my pages after they finish loading. I understand how to use WebDriverWait to wait for specific text to be present in the element, but I don't see how to wait until there is ANY text present. I'm trying to avoid a while loop that keeps checking the element's text isn't == ''.
Here's what 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 a way to check for any text or a non-empty string?