selenium webdriver - Display property of a object -
on login page of stackoverflow, clicking on "log in using stack exchange" link makes "forgot password" link invisible display property changes block none
forgot password
changes
forgot password
how verify using getattributes() method.
thanks
you may improve utilize wait expected conditions, using python
:
from selenium import webdriver selenium.webdriver.support.ui import webdriverwait selenium.webdriver.common.by import selenium.webdriver.support import expected_conditions ec driver = webdriver.chrome() driver.get("https://stackoverflow.com/users/login") #find , click button stack_exchange_button = driver.find_element_by_xpath("//span[text()='log in using stack exchange']") stack_exchange_button.click() #let's wait 10 seconds forgot link invisible webdriverwait(driver, 10).until(ec.invisibility_of_element_located((by.css_selector, "a[id='forgot-password']"))) print "link invisible"
well, if still don't want utilize waits expected condition, can check next element exists: //a[@id='forgot-password'][contains(@style,'display: none')]
selenium-webdriver
No comments:
Post a Comment