def open_mail_attachment(self, drvr):
     gmail_po = GmailLoginPageObjectsClass(drvr)
     commonutil = CommonUtilsClass()
     ca1 = CommonActionsClass(self.driver)
     timestamp = commonutil.last_user_created()
     time.sleep(5)
     mail_attachment_element = gmail_po.mail_attachment_loc(timestamp)
     ca1.hover_over_an_element_and_click(mail_attachment_element)
     logger.info(
         "Hovered and clicked on the mail attachment with name containing "
         + timestamp)
     time.sleep(2)
     return self.driver
 def copy_attachment_content_to_textfile(self, drvr, target_filepath):
     gmail_po = GmailLoginPageObjectsClass(drvr)
     ca1 = CommonActionsClass(self.driver)
     commonutil = CommonUtilsClass()
     time_stamp = commonutil.last_user_created()
     attachment_message_element = gmail_po.mail_attachment_message_loc(
         time_stamp)
     attachment_message_data = attachment_message_element.text
     commonutil.write_data_into_file(target_filepath,
                                     attachment_message_data)
     mail_attachment_message_close_element = gmail_po.mail_attachment_message_close_loc(
     )
     ca1.hover_over_an_element_and_click(
         mail_attachment_message_close_element)
     logger.info("Copied and pasted the error message in " +
                 target_filepath + " file")
     return self.driver