def get_random_rescources(self, old_num): if old_num > 10: old_num = 10 from tools.utility import Utility old_num = Utility.get_random_num(1, old_num) self.driver.find_element_by_xpath( f'//*[@id="transmit-table"]/tbody/tr[{old_num}]/td[1]/input' ).click()
def do_edit_recource(self,old_num,edit_recource_info): if old_num >10: old_num=10 num=Utility.get_random_num(1,old_num) self.driver.find_element_by_xpath(f'//*[@id="personal-table"]/tbody/tr[{num}]/td[15]/button[2]').click() self.edit_name(edit_recource_info['edit_name']) self.edit_status(edit_recource_info['edit_status']) self.edit_tel(edit_recource_info['edit_tel']) self.edit_source(edit_recource_info['edit_source']) self.click_edit_button()
def click_track_resource_button(self,old_num): old_num=int(old_num) if old_num > 10: old_num=10 num_random=Utility.get_random_num(1,old_num) self.driver.find_element_by_xpath(f'//*[@id="personal-table"]/tbody/tr[{num_random}]/td[15]/button[1]').click() #获取跟踪资源的电话号码 time.sleep(3) return self.driver.find_element_by_xpath('//*[@id="resumeDivId"]/div[2]/blockquote/p[1]/span').text
def discard_resource(self,old_num): #1-10的随机数 old_num=int(old_num) if old_num > 10: old_num=10 num_random=Utility.get_random_num(1,old_num) #勾选资源 self.driver.find_element_by_xpath(f'//*[@id="personal-table"]/tbody/tr[{num_random}]/td[1]/input').click() #点击废弃 self.driver.find_element_by_xpath('//*[@id="abandon"]').click() #点击确认 self.driver.find_element_by_xpath('/html/body/div[13]/div/div/div[3]/button[2]').click() self.driver.refresh()
def do_week_mark(self, logging__info): Service.open_module(self.driver, "周考成绩") self.click_query_button() time.sleep(2) student_total = self.get_student_total() if int(student_total) >= 10: student_total = 10 num = Utility.get_random_num(1, student_total) self.driver.find_element_by_xpath( f'//*[@id="pe-result"]/tbody/tr[{num}]/td[9]/button').click() self.select_class_stu(logging__info["s_sclass"]) self.select_stage(logging__info["stage"]) self.select_week(logging__info["week"]) self.input_score(logging__info["score"]) self.click_keep_button()
def do_edit_student(self, edit_student_info): Service.open_module(self.driver, "学员信息") self.click_query_button() time.sleep(2) student_total = self.get_student_total() if int(student_total) >= 10: student_total = 10 num = Utility.get_random_num(1, student_total) self.driver.find_element_by_xpath( f'/html/body/div[8]/div[2]/div/div/div/div[2]/div[2]/div[2]/table/tbody/tr[{num}]/td[12]/button[2]' ).click() self.edit_name(edit_student_info['edit_name']) self.edit_state_stu(edit_student_info['edit_state']) self.edit_tel(edit_student_info['edit_tel']) self.edit_source(edit_student_info['edit_source']) self.click_edit_button() self.click_cofirm()