from selenium_learn import webdriver dr = webdriver.Firefox() # 绝对路径 dr.find_element_by_xpath("/html/body/div/div/") # 相对路劲 dr.find_element_by_xpath("//input[]")
def setUp(self): self.driver = webdriver.Firefox() self.driver.implicitly_wait(30) self.driver.maximize_window() self.driver.get("file://C:\\Users\\55077\\Desktop\\test.html")
def setUp(self): self.driver = webdriver.Firefox() self.driver.get("")
def setUp(self): self.driver = webdriver.Firefox() self.driver.implicitly_wait(30) self.driver.maximize_window() self.driver.get("http://www.baidu.com")
def setUp(self): self.driver = webdriver.Firefox() self.driver.implicitly_wait(30) self.driver.maximize_window() # navigate to the application home page self.driver.get("http://demo.magentocommerce.com")
def setUp(self): self.driver = webdriver.Firefox() self.driver.get("http://demo.magentocommerce.com/")