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()
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")