text: class ContactHelper:
  
      def __init__(self, app):
          self.app = app
  
      def open_add_contact_page(self):
          # open add creation new contact
          wd = self.app.wd
          wd.find_element_by_link_text("add new").click()
  
      def fill_form(self, contact):
          # fill contacts form
          wd = self.app.wd
          self.open_add_contact_page()
          wd.find_element_by_name("firstname").click()
          wd.find_element_by_name("firstname").clear()
          wd.find_element_by_name("firstname").send_keys(contact.first_name)
          wd.find_element_by_name("lastname").click()
          wd.find_element_by_name("lastname").clear()
          wd.find_element_by_name("lastname").send_keys(contact.last_name)
          wd.find_element_by_name("nickname").click()
          wd.find_element_by_name("nickname").clear()
          wd.find_element_by_name("nickname").send_keys(contact.nick)
          wd.find_element_by_name("home").click()
          wd.find_element_by_name("home").clear()
          wd.find_element_by_name("home").send_keys(contact.home_phone)
          wd.find_element_by_name("mobile").click()
          wd.find_element_by_name("mobile").clear()
          wd.find_element_by_name("mobile").send_keys(contact.mobile_phone)
          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_xpath("//div[@id='content']/form/input[21]").click()
          self.back_to_contacts_list()
  
  
      def modification_first_contact(self, contact):
          wd = self.app.wd
          self.select_first_contact(wd)
          # find edit button
          wd.find_element_by_xpath("//table[@id='maintable']/tbody/tr[2]/td[8]/a/img").click()
          wd.find_element_by_name("firstname").click()
          wd.find_element_by_name("firstname").clear()
          wd.find_element_by_name("firstname").send_keys(contact.first_name)
          wd.find_element_by_name("lastname").click()
          wd.find_element_by_name("lastname").clear()
          wd.find_element_by_name("lastname").send_keys(contact.last_name)
          wd.find_element_by_name("nickname").click()
          wd.find_element_by_name("nickname").clear()
          wd.find_element_by_name("nickname").send_keys(contact.nick)
          wd.find_element_by_name("home").click()
          wd.find_element_by_name("home").clear()
          wd.find_element_by_name("home").send_keys(contact.home_phone)
          wd.find_element_by_name("mobile").click()
          wd.find_element_by_name("mobile").clear()
          wd.find_element_by_name("mobile").send_keys(contact.mobile_phone)
          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("update").click()
          self.back_to_contacts_list()
  
  
      def delete_first_contact(self):
          wd = self.app.wd
          self.select_first_contact(wd)
          # find button delete
          wd.find_element_by_xpath("//div[@id='content']/form[2]/div[2]/input").click()
          wd.switch_to_alert().accept()
          self.back_to_contacts_list()
  
      def select_first_contact(self, wd):
          wd.find_element_by_name("selected[]").click()
  
      def back_to_contacts_list(self):
          wd = self.app.wd
          wd.find_element_by_link_text("home").click()