Does waiting for the parent tag ensures the complete loading of the child tag using Selenium? Does waiting for the parent tag ensures the complete loading of the child tag using Selenium? selenium selenium

Does waiting for the parent tag ensures the complete loading of the child tag using Selenium?


A bit of more information would have helped us to construct a more canonical answer. However, just like each test is based on a unique test aim, the target element must also be unique for each test / test aim.

So, if your target element is the <div> your test should be based on the <div> as follows:

WebDriverWait(self.web_driver, WEB_DRIVER_WAIT_TIME).until(        EC.presence_of_element_located((By.ID, "test")))

Incase, your target element is the <h1> your test should be based on the <h1> as follows:

WebDriverWait(self.web_driver, WEB_DRIVER_WAIT_TIME).until(        EC.presence_of_element_located((By.XPATH, "//div[@id='test']/h1[text()='Is this tag also loaded?']")))