class BasePage(object): def __init__(self): self.d = Pyse('chrome') def url(self): self.d.open('http://zbox.imdsx.cn') def quit(self): self.d.quit()
class BasePage(object): def __init__(self): self.pyse = Pyse('chrome') def open(self, url): self.pyse.open(url) def close(self): self.pyse.close() def quit(self): self.pyse.quit()
class BasePage(): def __init__(self): self.d = Pyse('chrome') self.driver = self.d.driver def url(self): self.d.open("http://ui.imdsx.cn/uitester/") def top(self): self.d.js("window.scrollTo(0,0)") def quit(self): self.d.quit()
class BasePage(object): #初始化一个浏览器对象 def __init__(self): self.pyse = Pyse('chrome') #发送一个Http请求 def open(self, url): self.pyse.open(url) #关闭当前页面 def close(self): self.pyse.close() #关闭程序 def quit(self): self.pyse.quit()
class Common(object): #公共方法 #实例化pyse,并把浏览器最大化 def __init__(self): self.pyse = Pyse('chrome') self.pyse.max_window() self.log = nnlog.Logger(file_name=CASELOG) #适用于登录页面的手机号密码登录 def username(self):#获取用户名 css = 'css=>[name="username"]' text = Login_data.username() # print(text) self.pyse.type(css,text) # self.log.info('正在输入密码%s' % text + '....') # 获取密码 def pwd(self):#获取密码 css = 'css=>[name="password"]' text = Login_data.pwd() self.pyse.type(css,text) # self.log.info('正在输入密码%s' % text + '....') #点击登录 def login_btn(self): #点击登录安扭 css = "css=>[name='login-btn']" self.pyse.click(css) # self.log.info('点击登录...') # 点击退出 def check_logout(self,name):#查询到登出链接,判断是否登录成功 css = 'css=>#signOut' return self.pyse.wait_and_save_exception(css,name) #打开登录页面 #打开登录页 def open_login_url(self): self.pyse.open(Login_data.loginUrl()) self.log.debug('正在打开登录页面'+Login_data.loginUrl()) #打开汇桔网主页 def open_home_page(self): self.pyse.open(Url_Data.url()) self.pyse.max_window() self.log.debug("正在打开汇桔云主页"+Url_Data.url())
class Basepage(object): def __init__(self): self.pyse = Pyse('chrome') def open(self,url): self.pyse.open(url) def max_browser(self): self.pyse.max_window() def quit(self): self.pyse.quit() def close(self): self.pyse.close() def switch(self): self.pyse.open_new_window()
class BasePage(): def __init__(self): self.d = Pyse('chrome') self.driver = self.d.driver def add_cookies(self): cookies = '136a3d03-9748-4f83-a54f-9b2a93f979a0=1e348032-82cd-46e3-b419-4ef8acb912dc;' self.d.set_cookies(cookies) def url(self): self.d.open("https://testyyfax8446.yylending.com/web/user/index.html") def top(self): self.d.js("window.scrollTo(0,0)") def quit(self): self.d.quit() def close(self): self.d.close()