示例#1
0
 def test_element_not_found(self):
     self.driver.get("http://www.google.com")
     with self.assertRaises(exceptions.NoSuchElementException):
         WebElement(self.driver,
                    [Locator(by=By.CLASS_NAME, value="q")]).click()
示例#2
0
 def test_one_locator(self):
     self.driver.get("http://www.google.com")
     locators = [Locator(by=By.NAME, value="q")]
     WebElement(self.driver, locators).send_keys("something")