I have checked all previous similar issues, they are not applicable to my case.
try:
element = wait.until(
EC.presence_of_element_located((By.
A few words about the solution:
presence_of_element_located()
relates to an expectation for checking that an element is present on the DOM of a page. This does not necessarily mean that the element is visible. The locator used to find the element returns the WebElement once it is located. Hence we have to change the clause from presence_of_element_located()
to visibility_of_element_located()
which relates to an expectation for checking that an element, known to be present on the DOM of a page, is visible. Visibility means that the element is not only displayed but also has a height and width that is greater than 0. element is the WebElement returns the (same) WebElement once it is visible.click()
method for the WebElement. So instead of presence_of_element_located()
we will use the element_to_be_clickable()
clause.Here is your own code with minor changes :
try:
element = wait.until(EC.element_to_be_clickable((By.XPATH, "//*[@id='_ariaId_73.folder'] | //*[@id='_ariaId_133.folder']")))
except:
print "403 : Monitoring Not Found"
element.click()