I'm trying to write an automated messages. The issue is, it takes a bit longer to write the message and then it gets the StaleElementReference error.
the error happened when it is trying to clear the person_title. and I think this should have longer waiting time because when I cut the message short (taking out several important details), the automation had no issue. How to fix it?
# Locate search box through x_path search_box = '//*[@id="side"]/div[1]/div/div[2]/div[2]/div/div[1]/p' person_title = wait.until(lambda driver:driver.find_element(By.XPATH,search_box)) # Clear search box if any contact number is written in it person_title.clear()