def set_position(self, position): try: publicPage = PublicPage(self.driver) input_loc = self.driver.find_element_by_xpath(position_elem) publicPage.set_value(input_loc, position) except Exception as e: print('[AddStuffPage] There was an exception when set_position=>', str(e))
def set_phone(self, phone_num): """ :param phone_num: 手机号 :return:输入手机号 """ publicPage = PublicPage(self.driver) input_loc = self.driver.find_element_by_xpath(phone_input_elem) publicPage.set_value(input_loc, phone_num)
def set_address(self, address): try: publicPage = PublicPage(self.driver) input_loc = self.driver.find_element_by_xpath(address_elem) publicPage.set_value(input_loc, address) except Exception as e: print('[AddStuffPage] There was an exception when set_address=>', str(e))
def set_old_password( self , old_password ): """ 输入原密码 :param old_password: 原密码 """ publicPage = PublicPage( self.driver ) input_loc = self.driver.find_element_by_name( old_password_elem ) publicPage.set_value( input_loc , old_password )
def set_confirm_password( self , confirm_password ): """ 设置确认密码 :param confirm_password: 确认密码 """ publicPage = PublicPage( self.driver ) input_loc = self.driver.find_element_by_name( confirm_password_elem ) publicPage.set_value( input_loc , confirm_password )
def set_bank_num(self, bank_num): try: publicPage = PublicPage(self.driver) input_loc = self.driver.find_element_by_xpath(bank_num_elem) publicPage.set_value(input_loc, bank_num) except Exception as e: print('[AddStuffPage] There was an exception when set_bank_num=>', str(e))
def set_email(self, email): try: publicPage = PublicPage(self.driver) input_loc = self.driver.find_element_by_xpath(email_elem) publicPage.set_value(input_loc, email) except Exception as e: print('[AddStuffPage] There was an exception when set_email=>', str(e))
def select_health(self, health): try: publicPage = PublicPage(self.driver) drop_loc = self.driver.find_element_by_xpath(health_drop_elem) publicPage.set_value(drop_loc, health) except Exception as e: print('[AddStuffPage] There was an exception when select_health=>', str(e))
def set_name(self, name): """ :param name: 姓名 :return:输入姓名 """ publicPage = PublicPage(self.driver) input_loc = self.driver.find_element_by_xpath(name_input_elem) publicPage.set_value(input_loc, name)
def set_new_password( self , new_password ): """ 设置新密码 :param new_password: 新密码 """ publicPage = PublicPage( self.driver ) input_loc = self.driver.find_element_by_name( new_password_elem ) publicPage.set_value( input_loc , new_password )
def set_comp_medicare(self, comp_medicare): try: publicPage = PublicPage(self.driver) input_loc = self.driver.find_element_by_xpath(comp_medicare_elem) publicPage.set_value(input_loc, comp_medicare) except Exception as e: print( '[AddStuffPage] There was an exception when set_comp_medicare=>', str(e))
def set_actual_salary(self, actual_salary): try: publicPage = PublicPage(self.driver) input_loc = self.driver.find_element_by_xpath(actual_salary_elem) publicPage.set_value(input_loc, actual_salary) except Exception as e: print( '[AddStuffPage] There was an exception when set_actual_salary=>', str(e))
def select_registered_type(self, registered_type): try: publicPage = PublicPage(self.driver) input_loc = self.driver.find_element_by_xpath(registered_drop_elem) publicPage.set_value(input_loc, registered_type) except Exception as e: print( '[AddStuffPage] There was an exception when select_registered_type=>', str(e))
def set_partnerset_name(self, partnerset_name): try: publicPage = PublicPage(self.driver) input_loc = self.driver.find_element_by_xpath(partner_name_elem) publicPage.set_value(input_loc, partnerset_name) except Exception as e: print('[PartnerSetPage]set_partnerset_name--设置股东名称 失败--失败原因是=>', str(e)) exit()
def set_actual_paid(self, amount): try: publicPage = PublicPage(self.driver) input_loc = self.driver.find_element_by_xpath(actual_paid_elem) publicPage.set_value(input_loc, amount) except Exception as e: print('[PartnerSetPage]set_actual_paid--设置实缴金额 失败--失败原因是=>', str(e)) exit()
def set_pers_public_reserve_fund(self, public_reserve_fund): try: publicPage = PublicPage(self.driver) input_loc = self.driver.find_element_by_xpath( pers_public_reserve_fund_elem) publicPage.set_value(input_loc, pers_public_reserve_fund) except Exception as e: print( '[AddStuffPage] There was an exception when set_pers_public_reserve_fund=>', str(e))
def set_pers_unemploy_insurance(self, pers_unemploy): try: publicPage = PublicPage(self.driver) input_loc = self.driver.find_element_by_xpath( pers_unemploy_insurance_elem) publicPage.set_value(input_loc, pers_unemploy) except Exception as e: print( '[AddStuffPage] There was an exception when set_pers_unemploy_insurance=>', str(e))
def set_contact(self, contact): """ :param contact: 联系人名称 """ try: publicPage = PublicPage(self.driver) input_loc = self.driver.find_element_by_id(contact_elem) publicPage.set_value(input_loc, contact) except Exception as e: print('[ContactPage]set_contact--设置联系人失败--失败原因是=>', str(e))
def set_account_name(self, account_name): """ :param account_name: 账户名称 """ try: publicPage = PublicPage(self.driver) input_loc = self.driver.find_element_by_id(account_name_elem) publicPage.set_value(input_loc, account_name) except Exception as e: print('[ContactPage]set_account_name--设置账户名称失败--失败原因是=>', str(e))
def set_account_num(self, account_num): """ :param account_num: 帐号 """ try: publicPage = PublicPage(self.driver) input_loc = self.driver.find_element_by_id(account_num_elem) publicPage.set_value(input_loc, account_num) except Exception as e: print('[ContactPage]set_account_num--设置帐号失败--失败原因是=>', str(e))
def set_phone_num(self, phone_num): """ :param phone_num: 手机号 """ try: publicPage = PublicPage(self.driver) input_loc = self.driver.find_element_by_id(phone_num_elem) publicPage.set_value(input_loc, phone_num) except Exception as e: print('[ContactPage]set_phone_num--设置手机号失败--失败原因是=>', str(e))
def set_comp_name(self, comp_name): """ :param comp_name: 帐套名称; """ try: publicPage = PublicPage(self.driver) comp_name_loc = self.driver.find_element_by_name(comp_name_elem) publicPage.set_value(comp_name_loc, comp_name) except NoSuchElementException as e: logging.error('查找的页面元素不存在,异常堆栈信息:' + str(traceback.format_exc())) except Exception as e: print('[CompBillingPage]set_comp_name---设置帐套名称失败,失败原因是是=>', str(e))
def set_comp_name(self, comp_name): """ :param comp_name:帐套名称 """ publicPage = PublicPage(self.driver) if comp_name == '': name = comp_name else: name = publicPage.random_num(10000) + comp_name comp_name_input_loc = self.driver.find_element_by_xpath( comp_name_input_elem) publicPage.set_value(comp_name_input_loc, name)
def set_tax_num(self, num): """ :param num: 纳税人识别号 """ try: publicPage = PublicPage(self.driver) tax_num_loc = self.driver.find_element_by_name(tax_number_name) publicPage.set_value(tax_num_loc, num) except Exception as e: print( '[CompBillingPage] There was an exception when set_tax_num= %s', str(e))
def set_legal_person_name( self, legal_person_name ): """ :param legal_person_name: 9,法人代表名字 """ public_page = PublicPage(self.driver) random_num = public_page.random_num(10000) input_loc = self.driver.find_element_by_xpath(legal_person_name_elem) if legal_person_name == '' or legal_person_name == '空校验': name = '' else: name = legal_person_name + str(random_num) public_page.set_value(input_loc, str(name))
def set_registered_capital( self, registered_capital ): """ :param registered_capital: 注册资本(string) """ public_page = PublicPage(self.driver) random_num = public_page.random_num(10000) input_loc = self.driver.find_element_by_name(registered_capital_elem) if registered_capital == '' or registered_capital == '空校验': capital = '' else: capital = registered_capital + str(random_num) public_page.set_value(input_loc, str(capital))
def set_tax_num( self, tax_num ): """ :param tax_num: 税号(string) """ public_page = PublicPage(self.driver) input_loc = self.driver.find_element_by_xpath(tax_num_elem) random_num = public_page.random_num(1000000) if tax_num == '' or tax_num == '空校验': num = '' else: num = tax_num + str(random_num) public_page.set_value(input_loc, str(num))
def set_address(self, address_name): """ :param address_name: 详细地址 """ try: publicPage = PublicPage(self.driver) address_name_loc = self.driver.find_element_by_name( addr_input_name) publicPage.set_value(address_name_loc, address_name) except Exception as e: print( '[CompBillingPage] There was an exception when set_address= %s', str(e))
def set_registered_capital(self, registered_num): """ :param registered_num: 注册资本 """ try: publicPage = PublicPage(self.driver) registered_capital_loc = self.driver.find_element_by_name( registered_capital_name) publicPage.set_value(registered_capital_loc, registered_num) except NoSuchElementException as e: logging.error('查找的页面元素不存在,异常堆栈信息:' + str(traceback.format_exc())) except Exception as e: print('[CompBillingPage]set_registered_capital---填写注册资本失败,失败原因是=>', str(e))
def set_legal_person_name(self, legal_person_name): """ :param legal_person_name: 法定代表人名称 """ try: publicPage = PublicPage(self.driver) legal_person_name_loc = self.driver.find_element_by_name( legal_person_name_name) publicPage.set_value(legal_person_name_loc, legal_person_name) except NoSuchElementException as e: logging.error('查找的页面元素不存在,异常堆栈信息:' + str(traceback.format_exc())) except Exception as e: print( '[CompBillingPage]set_legal_person_name---设置法定代表人失败,失败原因是=> %s', str(e))