from selenium.webdriver.common.by import Byfrom common.page_action import PageBasefrom elementlocator import mainlocator# 前台登录页class MainInput(PageBase): # 给页面对象类增加父类PageBase,继承其中的方法# 构造方法def __init__(self, driver):self.driver = driver# 打开该页def open(self):self.driver.get("http://www.baidu.com")# 点击输入框,输入并点击百度一下def input(self, value):self.clear_and_input_text(mainlocator.input, value)self.click(mainlocator.baidu)
