def setUp(self): print("每条case执行之前") self.file_path = "/Users/qing.li/PycharmProjects/hm/selenium_/imooc/image/imooc_code_%s.png" % (time.time()) self.driver = webdriver.Chrome() self.driver.get("http://www.5itest.cn/register") self.driver.maximize_window() self.register = RegisterBusiness(self.driver) # self.register_function = RegisterFunction(self.driver, self.file_path) self.register_code = GetCode(self.driver, self.file_path)
def send_user_code(self, file_name): get_code_text = GetCode(self.driver) code = get_code_text.code_online(file_name) self.find_element.get_element('code_text').send_keys(code)
def __init__(self, driver): self.base = Base(driver) self.read_config = ReadConfig( r'F:\xw\example\web_projrct\Config\el.ini', 'Register') self.getcode = GetCode(driver)
def send_user_code(self, file_name): #self.register_p.get_code_element().send_keys(file_name) get_code_text = GetCode(self.driver) code = get_code_text.code_online(file_name) self.register_p.get_code_element().send_keys(code)
def send_user_code(self, code_text): get_code_image = GetCode(self.driver) code_image = get_code_image.get_code_image() self.register_p.get_code_text_element().send_keys(code_text)
def get_code_num(self, key, filename): element = self.get_element(key) get_c = GetCode(self.driver) get_c.get_code_image(element, filename) text = get_c.get_code_num(filename) return text
def send_register_captcha(self, file_name): get_code_text = GetCode(self.driver) captcha = get_code_text.discern_captcha_image(file_name) self.rp.get_captcha_code().send_keys(captcha)
def __init__(self, driver): self.driver = driver self.get_code_text = GetCode(self.driver) self.register_p = RegisterPage(self.driver)
def send_user_code(self, file_name): get_code_text = GetCode(self.driver) self.loger.info("huoqu yanzhengma qian :") code = get_code_text.code_online(file_name) self.register_p.get_code_element().send_keys(code) self.loger.info("huoqu yanz ma hou ")
def __init__(self, driver): self.registerp = RegisterPage(driver) self.registerg = GetCode(driver)
def send_user_code(self, file_path): get_code_text = GetCode(self.driver, file_path) code = get_code_text.get_code_picture() self.register_p.get_code_element().send_keys(code)
def send_user_code(self,file_name): get_code_text = GetCode(self.fd) code = get_code_text.code_online(file_name) self.send_value("code_image", code, "注册页面_输入验证码")
def __init__(self, driver): self.driver = driver self.register_page = RegisterPage(self.driver) self.get_c = GetCode(self.driver)
def get_code_text(self): get_code = GetCode(self.driver) time.sleep(5) file_name = "F:\\myfile\\python\\code\\seleniumpython\\Image\\test001.png" code = get_code.code_online(file_name) print(code)
def send_login_captcha(self, file_name): get_code_text = GetCode(self.driver) #captcha = get_code_text.discern_captcha_image(file_name) self.lp.get_login_captcha_code().send_keys('1212')