class Selenium_WebElement(): def __init__(self): self.driver = BrowserConfig().driver def Element_id(self, revID): Element_id = self.driver.find_element_by_id(revID) return Element_id def Element_name(self, revName): Element_name = self.driver.find_element_by_name(revName) return Element_name def Element_class(self, revClass): Element_class = self.driver.find_element_by_class_name(revClass) return Element_class def Element_Xpath(self, revXpath): Element_Xpath = self.driver.find_element_by_xpath(revXpath) return Element_Xpath def Element_Text(self, revText): Element_Text = self.driver.find_element_by_link_text(revText) return Element_Text def ELement_xpath(self, revXpath): ELement_xpath = self.ELement_xpath(revXpath) return ELement_xpath
def setUp(self): BrowserConfig().BrowserGetUrl(self.URL)
def tearDownClass(cls): #真正结束清理代码段 BrowserConfig().BrowserQuit()
def setUpClass(self): #真正实例化代码段 self.URL = "http://192.168.0.23/tiny/" #类的实例化,调用输入URL方法,并传递域名 BrowserConfig().BrowserGetUrl(self.URL)
def __init__(self): self.driver = BrowserConfig().driver
def tearDown(self): BrowserConfig().BrowserQuit()
def setUp(self): BrowserConfig().BrowserGetUrl(self.URL) #self.Url = 'test-lsm.51zhongzi.com:7010/pos' #BrowserConfig().GetUrl(URl) BrowserConfig().BrowserMax()
def setUpClass(self): #self.URL = 'http://localhost:7012/pos' self.URL = 'http:192.168.0.115:7090/cold' BrowserConfig().BrowserGetUrl(self.URL)