def setUpClass(cls): super(CountdownTestCase, cls).setUpClass() driver = test_core.TestCore.driver try: url = WEB_SITE+ARTICLES[random.randint(0, len(ARTICLES)-1)] print(url) driver.get(url) except Exception as e: driver.quit() raise e
search_field.click() print("The webpage is redirect to join github page") else: print("The webpage is not redirecting to join github page") #To search the text "Create your personal account" in join github page text_contain = driver.find_element_by_xpath( "//h2[contains(.,'Create your personal account')]") #print(text_contain.text) if text_contain.text == 'Create your personal account': print("join github page contains the text: Create your personal account") else: print( "join github page does not contain the text: Create your personal account" ) #To check the entered email id is existing exiting_email = driver.find_element_by_id("user_email") exiting_email.send_keys("*****@*****.**") time.sleep(2) exiting_email1 = driver.find_element_by_xpath( "//p[contains(.,'Email is invalid or already taken')]") if exiting_email1.text == "Email is invalid or already taken": print( "Create an account button is grayed when an existing email address is inserted in join github page" ) else: print("The inserted email id is not existing earlier") driver.quit()