text: from selenium.webdriver.support.ui import Select
  
  class ContactHelper:
  
      def __init__(self, app):
          self.app = app
  
      def return_to_home_page(self):
          wd = self.app.wd
          wd.find_element_by_link_text("home").click()
  
      def create(self, contact):
          wd = self.app.wd
          # init new contact
          wd.find_element_by_link_text("add new").click()
          # fill contact
          wd.find_element_by_name("firstname").click()
          wd.find_element_by_name("firstname").clear()
          wd.find_element_by_name("firstname").send_keys(contact.firstname)
          wd.find_element_by_name("lastname").click()
          wd.find_element_by_name("lastname").clear()
          wd.find_element_by_name("lastname").send_keys(contact.lastname)
          wd.find_element_by_name("nickname").click()
          wd.find_element_by_name("nickname").clear()
          wd.find_element_by_name("nickname").send_keys(contact.nickname)
          wd.find_element_by_name("address").click()
          wd.find_element_by_name("company").click()
          wd.find_element_by_name("company").clear()
          wd.find_element_by_name("company").send_keys(contact.company)
          wd.find_element_by_name("mobile").click()
          wd.find_element_by_name("mobile").click()
          wd.find_element_by_name("mobile").clear()
          wd.find_element_by_name("mobile").send_keys(contact.mobile)
          wd.find_element_by_name("email").click()
          wd.find_element_by_name("email").clear()
          wd.find_element_by_name("email").send_keys(contact.email)
          wd.find_element_by_name("bday").click()
          Select(wd.find_element_by_name("bday")).select_by_visible_text(contact.bday)
          wd.find_element_by_name("bday").click()
          wd.find_element_by_name("bmonth").click()
          Select(wd.find_element_by_name("bmonth")).select_by_visible_text(contact.bmonth)
          wd.find_element_by_name("bmonth").click()
          wd.find_element_by_name("byear").click()
          wd.find_element_by_name("byear").clear()
          wd.find_element_by_name("byear").send_keys(contact.byears)
          # submit new contact
          wd.find_element_by_xpath("(//input[@name='submit'])[2]").click()
          self.return_to_home_page()
  
      def delete_first_contact(self):
          wd = self.app.wd
          self.app.wd.find_element_by_name("searchstring")
          # select first contact
          wd.find_element_by_name("selected[]").click()
          # submit deletion
          wd.find_element_by_name("delete").click()