當前位置: 首頁>>代碼示例>>Python>>正文


Python Keys.BACK_SPACE屬性代碼示例

本文整理匯總了Python中selenium.webdriver.common.keys.Keys.BACK_SPACE屬性的典型用法代碼示例。如果您正苦於以下問題:Python Keys.BACK_SPACE屬性的具體用法?Python Keys.BACK_SPACE怎麽用?Python Keys.BACK_SPACE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在selenium.webdriver.common.keys.Keys的用法示例。


在下文中一共展示了Keys.BACK_SPACE屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: populate_lookup_field

# 需要導入模塊: from selenium.webdriver.common.keys import Keys [as 別名]
# 或者: from selenium.webdriver.common.keys.Keys import BACK_SPACE [as 別名]
def populate_lookup_field(self, name, value):
        """Enters a value into a lookup field.
        """
        input_locator = self._get_input_field_locator(name)
        menu_locator = lex_locators["object"]["field_lookup_link"].format(value)

        self._populate_field(input_locator, value)

        for x in range(3):
            self.wait_for_aura()
            try:
                self.selenium.get_webelement(menu_locator)
            except ElementNotFound:
                # Give indexing a chance to catch up
                time.sleep(2)
                field = self.selenium.get_webelement(input_locator)
                field.send_keys(Keys.BACK_SPACE)
            else:
                break
        self.selenium.set_focus_to_element(menu_locator)
        self._jsclick(menu_locator) 
開發者ID:SFDO-Tooling,項目名稱:CumulusCI,代碼行數:23,代碼來源:Salesforce.py

示例2: test_integer_buckets_total_open

# 需要導入模塊: from selenium.webdriver.common.keys import Keys [as 別名]
# 或者: from selenium.webdriver.common.keys.Keys import BACK_SPACE [as 別名]
def test_integer_buckets_total_open(self):
        survey_id = self.survey_with_branch('integer', '(,)')

        self.get('/enumerate/{}'.format(survey_id))
        self.wait_for_element('navigate-right', By.CLASS_NAME)
        self.click(self.drv.find_element_by_class_name('navigate-right'))
        (
            self.drv
            .find_element_by_tag_name('input')
            .send_keys('-999')
        )
        self.click(self.drv.find_element_by_class_name('navigate-right'))
        self.assertEqual(
            self.drv.find_element_by_tag_name('h3').text,
            'b0'
        )
        self.click(self.drv.find_element_by_class_name('page_nav__prev'))
        self.input_field().send_keys(Keys.BACK_SPACE * 4, '999')
        self.click(self.drv.find_element_by_class_name('navigate-right'))
        self.assertEqual(
            self.drv.find_element_by_tag_name('h3').text,
            'b0'
        ) 
開發者ID:SEL-Columbia,項目名稱:dokomoforms,代碼行數:25,代碼來源:test_selenium.py

示例3: test_decimal_buckets_total_open

# 需要導入模塊: from selenium.webdriver.common.keys import Keys [as 別名]
# 或者: from selenium.webdriver.common.keys.Keys import BACK_SPACE [as 別名]
def test_decimal_buckets_total_open(self):
        survey_id = self.survey_with_branch('decimal', '(,)')

        self.get('/enumerate/{}'.format(survey_id))
        self.wait_for_element('navigate-right', By.CLASS_NAME)
        self.click(self.drv.find_element_by_class_name('navigate-right'))
        (
            self.drv
            .find_element_by_tag_name('input')
            .send_keys('-999.1')
        )
        self.click(self.drv.find_element_by_class_name('navigate-right'))
        self.assertEqual(
            self.drv.find_element_by_tag_name('h3').text,
            'b0'
        )
        self.click(self.drv.find_element_by_class_name('page_nav__prev'))
        self.input_field().send_keys(Keys.BACK_SPACE * 6, '999.1')
        self.click(self.drv.find_element_by_class_name('navigate-right'))
        self.assertEqual(
            self.drv.find_element_by_tag_name('h3').text,
            'b0'
        ) 
開發者ID:SEL-Columbia,項目名稱:dokomoforms,代碼行數:25,代碼來源:test_selenium.py

示例4: login

# 需要導入模塊: from selenium.webdriver.common.keys import Keys [as 別名]
# 或者: from selenium.webdriver.common.keys.Keys import BACK_SPACE [as 別名]
def login(self):
        if self.logged_in:
            return
        logger.info('Initiating log in')
        url = "https://onlinebanking.usbank.com/Auth/Login"
        self.driver.get(url)

        (username, password), = self.wait_and_return(
            self.find_username_and_password_in_any_frame)
        logger.info('Entering username and password')
        # In case of autofill
        for i in range(50):
            username.send_keys(Keys.BACK_SPACE)
            password.send_keys(Keys.BACK_SPACE)
        username.send_keys(self.credentials['username'])
        password.send_keys(self.credentials['password'])
        with self.wait_for_page_load(timeout = 30):
            password.send_keys(Keys.ENTER)
        logger.info('Logged in')
        self.logged_in = True 
開發者ID:jbms,項目名稱:finance-dl,代碼行數:22,代碼來源:usbank.py

示例5: login

# 需要導入模塊: from selenium.webdriver.common.keys import Keys [as 別名]
# 或者: from selenium.webdriver.common.keys.Keys import BACK_SPACE [as 別名]
def login(self):
        if self.logged_in:
            return
        logger.info('Initiating log in')
        url = "https://banking.radiusbank.com/login"
        self.driver.get(url)

        (username, password), = self.wait_and_return(
            self.find_username_and_password_in_any_frame)
        logger.info('Entering username and password')
        # In case of autofill
        for i in range(50):
            username.send_keys(Keys.BACK_SPACE)
            password.send_keys(Keys.BACK_SPACE)
        username.send_keys(self.credentials['username'])
        password.send_keys(self.credentials['password'])
        with self.wait_for_page_load(timeout = 30):
            password.send_keys(Keys.ENTER)
        logger.info('Logged in')
        self.logged_in = True 
開發者ID:jbms,項目名稱:finance-dl,代碼行數:22,代碼來源:radiusbank.py

示例6: test_integer_buckets

# 需要導入模塊: from selenium.webdriver.common.keys import Keys [as 別名]
# 或者: from selenium.webdriver.common.keys.Keys import BACK_SPACE [as 別名]
def test_integer_buckets(self):
        survey_id = self.survey_with_branch('integer', '(1, 3)', '[4, 5]')

        self.get('/enumerate/{}'.format(survey_id))
        self.wait_for_element('navigate-right', By.CLASS_NAME)
        self.click(self.drv.find_element_by_class_name('navigate-right'))
        (
            self.drv
            .find_element_by_tag_name('input')
            .send_keys('2')
        )
        self.click(self.drv.find_element_by_class_name('navigate-right'))
        self.assertEqual(
            self.drv.find_element_by_tag_name('h3').text,
            'b0'
        )
        self.click(self.drv.find_element_by_class_name('page_nav__prev'))
        self.input_field().send_keys(Keys.BACK_SPACE, '4')
        self.click(self.drv.find_element_by_class_name('navigate-right'))
        self.assertEqual(
            self.drv.find_element_by_tag_name('h3').text,
            'b1'
        )
        self.click(self.drv.find_element_by_class_name('page_nav__prev'))
        self.input_field().send_keys(Keys.BACK_SPACE, '1')
        self.click(self.drv.find_element_by_class_name('navigate-right'))
        self.assertEqual(
            self.drv.find_element_by_tag_name('h3').text,
            'last question'
        ) 
開發者ID:SEL-Columbia,項目名稱:dokomoforms,代碼行數:32,代碼來源:test_selenium.py

示例7: test_integer_buckets_open_ranges

# 需要導入模塊: from selenium.webdriver.common.keys import Keys [as 別名]
# 或者: from selenium.webdriver.common.keys.Keys import BACK_SPACE [as 別名]
def test_integer_buckets_open_ranges(self):
        survey_id = self.survey_with_branch('integer', '(, 0)', '[10,)')

        self.get('/enumerate/{}'.format(survey_id))
        self.wait_for_element('navigate-right', By.CLASS_NAME)
        self.click(self.drv.find_element_by_class_name('navigate-right'))
        (
            self.drv
            .find_element_by_tag_name('input')
            .send_keys('-5')
        )
        self.click(self.drv.find_element_by_class_name('navigate-right'))
        self.assertEqual(
            self.drv.find_element_by_tag_name('h3').text,
            'b0'
        )
        self.click(self.drv.find_element_by_class_name('page_nav__prev'))
        self.input_field().send_keys(Keys.BACK_SPACE * 2, '15')
        self.click(self.drv.find_element_by_class_name('navigate-right'))
        self.assertEqual(
            self.drv.find_element_by_tag_name('h3').text,
            'b1'
        )
        self.click(self.drv.find_element_by_class_name('page_nav__prev'))
        self.input_field().send_keys(Keys.BACK_SPACE * 2, '5')
        self.click(self.drv.find_element_by_class_name('navigate-right'))
        self.assertEqual(
            self.drv.find_element_by_tag_name('h3').text,
            'last question'
        ) 
開發者ID:SEL-Columbia,項目名稱:dokomoforms,代碼行數:32,代碼來源:test_selenium.py

示例8: test_decimal_buckets

# 需要導入模塊: from selenium.webdriver.common.keys import Keys [as 別名]
# 或者: from selenium.webdriver.common.keys.Keys import BACK_SPACE [as 別名]
def test_decimal_buckets(self):
        survey_id = self.survey_with_branch(
            'decimal',
            '(1.2, 3.2)',
            '[4.2, 5.2]'
        )

        self.get('/enumerate/{}'.format(survey_id))
        self.wait_for_element('navigate-right', By.CLASS_NAME)
        self.click(self.drv.find_element_by_class_name('navigate-right'))
        (
            self.drv
            .find_element_by_tag_name('input')
            .send_keys('1.3')
        )
        self.click(self.drv.find_element_by_class_name('navigate-right'))
        self.assertEqual(
            self.drv.find_element_by_tag_name('h3').text,
            'b0'
        )
        self.click(self.drv.find_element_by_class_name('page_nav__prev'))
        self.input_field().send_keys(Keys.BACK_SPACE * 3, '4.2')
        self.click(self.drv.find_element_by_class_name('navigate-right'))
        self.assertEqual(
            self.drv.find_element_by_tag_name('h3').text,
            'b1'
        )
        self.click(self.drv.find_element_by_class_name('page_nav__prev'))
        self.input_field().send_keys(Keys.BACK_SPACE * 3, '1.2')
        self.click(self.drv.find_element_by_class_name('navigate-right'))
        self.assertEqual(
            self.drv.find_element_by_tag_name('h3').text,
            'last question'
        ) 
開發者ID:SEL-Columbia,項目名稱:dokomoforms,代碼行數:36,代碼來源:test_selenium.py

示例9: test_date_buckets

# 需要導入模塊: from selenium.webdriver.common.keys import Keys [as 別名]
# 或者: from selenium.webdriver.common.keys.Keys import BACK_SPACE [as 別名]
def test_date_buckets(self):
        survey_id = self.survey_with_branch(
            'date',
            '(2015-01-01, 2015-01-03)',
            '[2015-01-04, 2015-01-05]'
        )

        self.get('/enumerate/{}'.format(survey_id))
        self.wait_for_element('navigate-right', By.CLASS_NAME)
        self.click(self.drv.find_element_by_class_name('navigate-right'))
        self.enter_date(
            self.drv.find_element_by_tag_name('input'),
            '2015', '01', '02'
        )
        self.click(self.drv.find_element_by_class_name('navigate-right'))
        self.assertEqual(
            self.drv.find_element_by_tag_name('h3').text,
            'b0'
        )
        self.click(self.drv.find_element_by_class_name('page_nav__prev'))
        self.input_field().send_keys(Keys.BACK_SPACE * 10)
        self.enter_date(
            self.drv.find_element_by_tag_name('input'),
            '2015', '01', '04'
        )
        self.click(self.drv.find_element_by_class_name('navigate-right'))
        self.assertEqual(
            self.drv.find_element_by_tag_name('h3').text,
            'b1'
        )
        self.click(self.drv.find_element_by_class_name('page_nav__prev'))
        self.input_field().send_keys(Keys.BACK_SPACE * 10)
        self.enter_date(
            self.drv.find_element_by_tag_name('input'),
            '2015', '01', '01'
        )
        self.click(self.drv.find_element_by_class_name('navigate-right'))
        self.assertEqual(
            self.drv.find_element_by_tag_name('h3').text,
            'last question'
        ) 
開發者ID:SEL-Columbia,項目名稱:dokomoforms,代碼行數:43,代碼來源:test_selenium.py

示例10: test_date_buckets_open_ranges

# 需要導入模塊: from selenium.webdriver.common.keys import Keys [as 別名]
# 或者: from selenium.webdriver.common.keys.Keys import BACK_SPACE [as 別名]
def test_date_buckets_open_ranges(self):
        survey_id = self.survey_with_branch(
            'date',
            '(, 2015-01-01)',
            '[2015-01-10,]'
        )

        self.get('/enumerate/{}'.format(survey_id))
        self.wait_for_element('navigate-right', By.CLASS_NAME)
        self.click(self.drv.find_element_by_class_name('navigate-right'))
        self.enter_date(
            self.drv.find_element_by_tag_name('input'),
            '2014', '11', '22'
        )
        self.click(self.drv.find_element_by_class_name('navigate-right'))
        self.assertEqual(
            self.drv.find_element_by_tag_name('h3').text,
            'b0'
        )
        self.click(self.drv.find_element_by_class_name('page_nav__prev'))
        self.input_field().send_keys(Keys.BACK_SPACE * 10)
        self.enter_date(
            self.drv.find_element_by_tag_name('input'),
            '2015', '11', '22'
        )
        self.click(self.drv.find_element_by_class_name('navigate-right'))
        self.assertEqual(
            self.drv.find_element_by_tag_name('h3').text,
            'b1'
        )
        self.click(self.drv.find_element_by_class_name('page_nav__prev'))
        self.input_field().send_keys(Keys.BACK_SPACE * 10)
        self.enter_date(
            self.drv.find_element_by_tag_name('input'),
            '2015', '01', '05'
        )
        self.click(self.drv.find_element_by_class_name('navigate-right'))
        self.assertEqual(
            self.drv.find_element_by_tag_name('h3').text,
            'last question'
        ) 
開發者ID:SEL-Columbia,項目名稱:dokomoforms,代碼行數:43,代碼來源:test_selenium.py

示例11: test_date_buckets_total_open

# 需要導入模塊: from selenium.webdriver.common.keys import Keys [as 別名]
# 或者: from selenium.webdriver.common.keys.Keys import BACK_SPACE [as 別名]
def test_date_buckets_total_open(self):
        survey_id = self.survey_with_branch('date', '(,)')

        self.get('/enumerate/{}'.format(survey_id))
        self.wait_for_element('navigate-right', By.CLASS_NAME)
        self.click(self.drv.find_element_by_class_name('navigate-right'))
        self.enter_date(
            self.drv.find_element_by_tag_name('input'),
            '1970', '01', '05'
        )
        self.click(self.drv.find_element_by_class_name('navigate-right'))
        self.assertEqual(
            self.drv.find_element_by_tag_name('h3').text,
            'b0'
        )
        self.click(self.drv.find_element_by_class_name('page_nav__prev'))
        self.input_field().send_keys(Keys.BACK_SPACE * 10)
        self.enter_date(
            self.drv.find_element_by_tag_name('input'),
            '2070', '01', '05'
        )
        self.click(self.drv.find_element_by_class_name('navigate-right'))
        self.assertEqual(
            self.drv.find_element_by_tag_name('h3').text,
            'b0'
        ) 
開發者ID:SEL-Columbia,項目名稱:dokomoforms,代碼行數:28,代碼來源:test_selenium.py

示例12: test_timestamp_buckets

# 需要導入模塊: from selenium.webdriver.common.keys import Keys [as 別名]
# 或者: from selenium.webdriver.common.keys.Keys import BACK_SPACE [as 別名]
def test_timestamp_buckets(self):
        survey_id = self.survey_with_branch(
            'timestamp',
            '(2015-01-01T12:00:00Z, 2015-01-03T12:00:00Z)',
            '[2015-01-04T12:00:00Z, 2015-01-05T12:00:00Z]'
        )

        self.get('/enumerate/{}'.format(survey_id))
        self.wait_for_element('navigate-right', By.CLASS_NAME)
        self.click(self.drv.find_element_by_class_name('navigate-right'))
        self.enter_timestamp(
            self.drv.find_element_by_tag_name('input'),
            '2015-01-02T12:00:00'
        )
        self.click(self.drv.find_element_by_class_name('navigate-right'))
        self.assertEqual(
            self.drv.find_element_by_tag_name('h3').text,
            'b0'
        )
        self.click(self.drv.find_element_by_class_name('page_nav__prev'))
        self.input_field().send_keys(Keys.RIGHT * 30, Keys.BACK_SPACE * 30)
        self.enter_timestamp(
            self.drv.find_element_by_tag_name('input'),
            '2015-01-04T12:00:00'
        )
        self.click(self.drv.find_element_by_class_name('navigate-right'))
        self.assertEqual(
            self.drv.find_element_by_tag_name('h3').text,
            'b1'
        )
        self.click(self.drv.find_element_by_class_name('page_nav__prev'))
        self.input_field().send_keys(Keys.RIGHT * 30, Keys.BACK_SPACE * 30)
        self.enter_timestamp(
            self.drv.find_element_by_tag_name('input'),
            '2015-01-01T12:00:00'
        )
        self.click(self.drv.find_element_by_class_name('navigate-right'))
        self.assertEqual(
            self.drv.find_element_by_tag_name('h3').text,
            'last question'
        ) 
開發者ID:SEL-Columbia,項目名稱:dokomoforms,代碼行數:43,代碼來源:test_selenium.py

示例13: test_timestamp_buckets_total_open

# 需要導入模塊: from selenium.webdriver.common.keys import Keys [as 別名]
# 或者: from selenium.webdriver.common.keys.Keys import BACK_SPACE [as 別名]
def test_timestamp_buckets_total_open(self):
        survey_id = self.survey_with_branch('timestamp', '(,)')

        self.get('/enumerate/{}'.format(survey_id))
        self.wait_for_element('navigate-right', By.CLASS_NAME)
        self.click(self.drv.find_element_by_class_name('navigate-right'))
        self.enter_timestamp(
            self.drv.find_element_by_tag_name('input'),
            '1970-01-05T01:00:00'
        )
        self.click(self.drv.find_element_by_class_name('navigate-right'))
        self.assertEqual(
            self.drv.find_element_by_tag_name('h3').text,
            'b0'
        )
        self.click(self.drv.find_element_by_class_name('page_nav__prev'))
        self.input_field().send_keys(Keys.RIGHT * 30, Keys.BACK_SPACE * 30)
        self.enter_timestamp(
            self.drv.find_element_by_tag_name('input'),
            '2070-01-05T01:00:00'
        )
        self.click(self.drv.find_element_by_class_name('navigate-right'))
        self.assertEqual(
            self.drv.find_element_by_tag_name('h3').text,
            'b0'
        ) 
開發者ID:SEL-Columbia,項目名稱:dokomoforms,代碼行數:28,代碼來源:test_selenium.py

示例14: change_date

# 需要導入模塊: from selenium.webdriver.common.keys import Keys [as 別名]
# 或者: from selenium.webdriver.common.keys.Keys import BACK_SPACE [as 別名]
def change_date(_step, new_date):
    button_css = 'div.post-preview a.edit-button'
    world.css_click(button_css)
    date_css = 'input.date'
    date = world.css_find(date_css)
    for i in range(len(date.value)):
        date._element.send_keys(Keys.END, Keys.BACK_SPACE)
    date._element.send_keys(new_date)
    save_css = 'a.save-button'
    world.css_click(save_css) 
開發者ID:jruiperezv,項目名稱:ANALYSE,代碼行數:12,代碼來源:course-updates.py

示例15: clear

# 需要導入模塊: from selenium.webdriver.common.keys import Keys [as 別名]
# 或者: from selenium.webdriver.common.keys.Keys import BACK_SPACE [as 別名]
def clear(self, element):
        # Selenium's clear command doesn't work
        value = element.get_attribute("value")
        for character in value:
            element.send_keys(Keys.BACK_SPACE) 
開發者ID:overshard,項目名稱:timestrap,代碼行數:7,代碼來源:__init__.py


注:本文中的selenium.webdriver.common.keys.Keys.BACK_SPACE屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。