I have a selenium script (python) that clicks a reply button to make the class anonemail appear. The time it takes for the class anonemail to appear varies. Because of that
You can use waits. Check for more info on this link: selenium waits
On the example bellow we are waiting 10 seconds for the element to be visible, using the function visibility_of_element_located.
driver = webdriver.Firefox()
driver.get("http://somedomain/url_that_delays_loading")
try:
element = WebDriverWait(driver, 10).until(
EC.visibility_of_element_located((By.ID, "myDynamicElement"))
)
finally:
driver.quit()