def test_find_anonymous_element_by_attribute(self):
        el = Wait(self.marionette).until(element_present(By.ID, "dia"))
        self.assertEquals(HTMLElement, type(el.find_element(By.ANON_ATTRIBUTE, {"anonid": "buttons"})))
        self.assertEquals(1, len(el.find_elements(By.ANON_ATTRIBUTE, {"anonid": "buttons"})))

        with self.assertRaises(NoSuchElementException):
            el.find_element(By.ANON_ATTRIBUTE, {"anonid": "nonexistent"})
        self.assertEquals([], el.find_elements(By.ANON_ATTRIBUTE, {"anonid": "nonexistent"}))
示例#2
0
    def test_find_anonymous_children(self):
        el = Wait(self.marionette).until(element_present(By.ID, "dia"))
        self.assertEquals(HTMLElement, type(el.find_element(By.ANON, None)))
        self.assertEquals(2, len(el.find_elements(By.ANON, None)))

        el = self.marionette.find_element(By.ID, "framebox")
        with self.assertRaises(NoSuchElementException):
            el.find_element(By.ANON, None)
        self.assertEquals([], el.find_elements(By.ANON, None))
    def test_find_anonymous_children(self):
        el = Wait(self.marionette).until(element_present(By.ID, "dia"))
        self.assertEquals(HTMLElement, type(el.find_element(By.ANON, None)))
        self.assertEquals(2, len(el.find_elements(By.ANON, None)))

        el = self.marionette.find_element(By.ID, "framebox")
        with self.assertRaises(NoSuchElementException):
            el.find_element(By.ANON, None)
        self.assertEquals([], el.find_elements(By.ANON, None))
示例#4
0
    def test_find_anonymous_element_by_attribute(self):
        el = Wait(self.marionette).until(element_present(By.ID, "dia"))
        self.assertEquals(
            HTMLElement,
            type(el.find_element(By.ANON_ATTRIBUTE, {"anonid": "buttons"})))
        self.assertEquals(
            1, len(el.find_elements(By.ANON_ATTRIBUTE, {"anonid": "buttons"})))

        with self.assertRaises(NoSuchElementException):
            el.find_element(By.ANON_ATTRIBUTE, {"anonid": "nonexistent"})
        self.assertEquals([],
                          el.find_elements(By.ANON_ATTRIBUTE,
                                           {"anonid": "nonexistent"}))