new_contents: # -*- coding: utf-8 -*-
  from selenium.webdriver.firefox.webdriver import WebDriver
  from selenium.webdriver.common.action_chains import ActionChains
  import time, unittest
  
  def is_alert_present(wd):
      try:
          wd.switch_to_alert().text
          return True
      except:
          return False
  
  class test_add_new_contact(unittest.TestCase):
      def setUp(self):
          self.wd = WebDriver()
          self.wd.implicitly_wait(60)
      
      def test_test_add_new_contact(self):
          success = True
          wd = self.wd
          wd.get("http://localhost/addressbook/")
          wd.find_element_by_name("user").click()
          wd.find_element_by_name("user").clear()
          wd.find_element_by_name("user").send_keys("admin")
          wd.find_element_by_name("pass").click()
          wd.find_element_by_name("pass").clear()
          wd.find_element_by_name("pass").send_keys("secret")
          wd.find_element_by_xpath("//form[@id='LoginForm']/input[3]").click()
          wd.find_element_by_link_text("add new").click()
          wd.find_element_by_name("firstname").click()
          wd.find_element_by_name("firstname").clear()
          wd.find_element_by_name("firstname").send_keys("basia")
          wd.find_element_by_name("lastname").click()
          wd.find_element_by_name("lastname").clear()
          wd.find_element_by_name("lastname").send_keys("kowalska")
          wd.find_element_by_name("address").click()
          wd.find_element_by_name("address").clear()
          wd.find_element_by_name("address").send_keys("adres")
          wd.find_element_by_name("home").click()
          wd.find_element_by_name("home").clear()
          wd.find_element_by_name("home").send_keys("12345")
          wd.find_element_by_name("email").click()
          wd.find_element_by_name("email").clear()
          wd.find_element_by_name("email").send_keys("basia@kowalska.pl")
          wd.find_element_by_name("submit").click()
          wd.find_element_by_link_text("Logout").click()
          self.assertTrue(success)
      
      def tearDown(self):
          self.wd.quit()
  
  if __name__ == '__main__':
      unittest.main()
  
subject: add new contact recorded