Example #1
0
 def clear_input(self,element_info):
     element=self.find_element(element_info)
     logger.info('[%s]元素输入框操作清空' % (element_info['element_name']))
     element.clear()
Example #2
0
 def input(self, element_info, content):
     element = self.find_element(element_info)
     element.send_keys(content)
     logger.info('[%s]元素输入内容:%s' % (element_info['element_name'], content))
 def click_save_project_button(self):
     self.scroll_to_element(self.project_save_button)
     self.click(self.project_save_button)
     logger.info("点击保存项目按钮")
Example #4
0
 def set_browser_min(self):
     self.driver.minimize_window()
     logger.info('设置浏览器最小化')
Example #5
0
 def get_title(self):
     value = self.driver.title
     logger.info('获取网页标题,标题是%s' % value)
     return value
Example #6
0
 def get_row_count(self):
     row_count = self.sheet_data.nrows
     logger.info("Excel有:%s行" % row_count)
     return row_count
Example #7
0
 def open_url(self, url):
     self.driver.get(url)
     logger.info('打开url地址 %s ' % url)
Example #8
0
 def switch_window_by_url(self,url):
     for handle in self.driver.window_handles:
         self.driver.switch_to.window(handle)
         if self.driver.current_url.__contains__(url):
             break
     logger.info('切换到URL为[%s]的句柄成功!' % url)
Example #9
0
 def close_tab(self):
     self.driver.close()
     logger.info('关闭当前的tab页签')
Example #10
0
 def open_url(self,url):
     self.driver.get(url)
     logger.info('打开URL地址%s;'%url)
Example #11
0
 def switch_window_by_title(self,title):
     for handle in self.driver.window_handles:
         self.driver.switch_to.window(handle)
         if self.driver.title.__contains__(title):
             break
     logger.info('切换到网页标题为[%s]的句柄成功!'%title)
Example #12
0
 def switch_to_frame_by_element(self,element_info):
     element = self.find_element(element_info)
     self.driver.switch_to.frame(element)
     logger.info('[%s]frame元素切换成功' % (element_info["element_name"]))
Example #13
0
 def ctrl_v(self,element_info):
     element=self.find_element(element_info)
     logger.info('[%s]元素输入框内容进行粘贴操作' % (element_info['element_name']))
     element.send_keys(Keys.CONTROL, 'v')
Example #14
0
 def enter(self,element_info):
     element=self.find_element(element_info)
     logger.info('[%s]元素进行回车键操作' % (element_info['element_name']))
     element.send_keys(Keys.ENTER)
Example #15
0
 def tearDown(self) -> None:
     self.session.close()
     logger.info('---------用户管理执行完毕-----------')
Example #16
0
 def set_brower_min(self):
     self.driver.minimize_window()
     logger.info("设置浏览器的最小化")
 def click_login(self):
     self.click(self.login_button)
     logger.info('点击登录')
Example #18
0
 def brower_refresh(self):
     self.driver.refresh()
     logger.info("浏览器的刷新操作")
Example #19
0
 def get_col_count(self):
     col_count = self.sheet_data.ncols
     logger.info("Excel有:%s列" % col_count)
     return col_count
Example #20
0
 def get_title(self):
     value=self.driver.title
     logger.info("获取网页的标题为:%s"%value)
     return value
Example #21
0
 def set_browser_max(self):
     self.driver.maximize_window()
     logger.info('设置浏览器最大化')
Example #22
0
 def quit_brower(self):
     self.driver.quit()
     logger.info("关闭浏览器")
Example #23
0
 def refresh(self):
     self.driver.refresh()
     logger.info('浏览器刷新操作')
Example #24
0
 def get_element_attribute(self,element_info,attribute_name):
     element=self.find_element(element_info)
     value=element.get_attribute(attribute_name)
     logger.info('[%s]元素的%s的值为:%s'%(element_info['element_name'],attribute_name,value))
     return  value
Example #25
0
 def click(self, element_info):
     element = self.find_element(element_info)
     element.click()
     logger.info('[%s]元素进行点击操作' % element_info['element_name'])
Example #26
0
 def get_text(self,element_info):
     text=self.find_element(element_info).text
     logger.info('[%s]元素的text值为:%s'%(element_info['element_name'],text))
     return  text
 def input_start_end_date(self):
     self.click(self.start_end_date)
     logger.info("选择起始日期=一星期")
Example #28
0
 def setUp(self) -> None:
     self.hosts = config.HOSTS  # 方式一
     self.session = requests.session()
     logger.info('---------用户管理开始执行-----------')
 def click_add_task_button(self):
     self.click(self.add_task_button)
     logger.info("点击新增任务按钮")
Example #30
0
 def back_space(self,element_info):
     element=self.find_element(element_info)
     logger.info('[%s]元素操作back_space' % (element_info['element_name']))
     element.send_keys(Keys.BACK_SPACE)