Update sample.py

This commit is contained in:
Waylon Walker 2020-07-24 23:33:07 -05:00 committed by GitHub
parent 4c58dd1cca
commit 5863bd70d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,9 +4,11 @@ if __name__ == "__main__":
driver = webdriver.Chrome()
driver.get("https://waylonwalker.com/")
passed = driver.find_element_by_css_selector(".about").is_displayed()
headers = driver.find_elements_by_tag_name("h2")
passed = headers[0].is_displayed()
print('number of headers: ', len(headers))
print("Test passed") if passed else print("Test failed")
driver.quit()