def test_1(self): sleep(2) FindElement.configsplit(self,Login,'loginindex').click() sleep(2) self.driver.back() sleep(2) # 关闭浏览器 self.driver.close()
class AutoBuild(object): def __init__(self, driver): self.find_e = FindElement(driver) def search_input(self): return self.find_e.get_elemnet('Search_input') def search_button(self): return self.find_e.get_elemnet('Search_button')
class AutoBuitFile_Page(): def __init__(self,driver): self.driver=driver self.find_e=FindElement(driver,file_name=None,node='Auto_service') #搜索输入框 def search_input(self): return self.find_e.get_elemnet('Search_input') #搜索按钮 def search_button(self): return self.find_e.get_elemnet('Search_button') #文件类型 def get_file_type(self,n): return self.driver.find_element_by_id('tab-%s'%(n)) #详细合同 def detail_file(self,n,m): return self.driver.find_element_by_css_selector('#pane-1 > ul:nth-child(%d) > li > div:nth-child(2) > ol:nth-child(%d) > li'%(n,m)) #去生成按钮 def generate_button(self): return self.find_e.get_elemnet('generate_button') #我已阅读复选框 def read_button(self): return self.find_e.get_elemnet('read_button') #下一步 def next_button(self): return self.find_e.get_elemnet('next_button')[1] #选项ABCD def option_ABCD_button(self): return self.find_e.get_elemnet('option_ABCD_button') #选项下一步 def option_next_button(self): return self.find_e.get_elemnet('option_next_button') #拖动滚动条 def drag_scroll(self): self.find_e.get_elemnet('drag_scroll')
class login_H5_page(object): def __init__(self, driver): self.get_ele = FindElement(driver) def get_login_element(self): return self.get_ele.configsplit('HaitouLogin', 'loginindex') def get_useremail_element(self): return self.get_ele.configsplit('HaitouLogin', 'useremail') def get_usermobile_element(self): return self.get_ele.configsplit('HaitouLogin', 'usermobile') def get_emailpass_element(self): return self.get_ele.configsplit('HaitouLogin', 'emailpass') def get_mobilepass_element(self): return self.get_ele.configsplit('HaitouLogin', 'mobilepass') def get_btn_emailelement(self): return self.get_ele.configsplit('HaitouLogin', 'loginbtnemail') def get_btn_mobileelement(self): return self.get_ele.configsplit('HaitouLogin', 'loginbtnmobile') def get_mobileclick_element(self): return self.get_ele.configsplit('HaitouLogin', 'user_mobileclick')
class MY_Page(object): def __init__(self, driver): self.driver = driver self.find_e = FindElement(driver, file_name=None, node='my_page') #头像标签 def Head_portrait(self): return self.find_e.get_elemnet('Head_portrait') #退出标签 def quit_button(self): return self.find_e.get_elemnet('quit_button') #我的订单 def my_order(self): return self.find_e.get_elemnet('my_order')[1] #筛选条件 def filter_condition(self): return self.find_e.get_elemnet('filter') #状态条件 def status_condition(self): return self.find_e.get_elemnet('status') #代付款条件 def waiting_payment(self): return self.find_e.get_elemnet('waiting_payment') #搜索条件提交按钮 def submit_condition(self): return self.find_e.get_elemnet('submit')
import time from selenium import webdriver from base.findelement import FindElement from page.autoBuitFile_page import AutoBuitFile_Page driver=webdriver.Chrome() driver.get('http://www.uelaw.cn:8002/') driver.implicitly_wait(20) get_ele=FindElement(driver) time.sleep(2) #取消体验金 get_ele.get_elemnet('test_mk')[0].click() time.sleep(2) #点击按钮弹出登录输出框 get_ele.get_elemnet('login_img').click() #输入手机号 get_ele.get_elemnet('login_ss')[0].send_keys('18311135605') #输入密码 get_ele.get_elemnet('login_ss')[1].send_keys('asdf123') #点击登录按钮 get_ele.get_elemnet('login_button').click() time.sleep(2) #点击UE服务 get_ele.get_elemnet('UEServise').click() time.sleep(1) #选择自动生成 get_ele.get_elemnet('auto_build')[1].click() time.sleep(2) #输入搜索框 # d=AutoBuitFile_Page(driver)
def __init__(self, driver): self.driver = driver self.find_e = FindElement(driver, file_name=None, node='my_page')
def __init__(self, driver): self.get_ele = FindElement(driver)
def __init__(self, driver): self.find_e = FindElement(driver)
def __init__(self,driver): self.driver=driver self.find_e=FindElement(driver,file_name=None,node='Auto_service')