本文整理汇总了Python中marionette_driver.Wait.send_keys方法的典型用法代码示例。如果您正苦于以下问题:Python Wait.send_keys方法的具体用法?Python Wait.send_keys怎么用?Python Wait.send_keys使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类marionette_driver.Wait
的用法示例。
在下文中一共展示了Wait.send_keys方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: write_and_save_note
# 需要导入模块: from marionette_driver import Wait [as 别名]
# 或者: from marionette_driver.Wait import send_keys [as 别名]
def write_and_save_note(self, text):
note_content = Wait(self.marionette).until(expected.element_present(*self._note_content_locator))
Wait(self.marionette).until(expected.element_displayed(note_content))
note_content.tap()
note_content.send_keys(text)
self.marionette.find_element(*self._save_note).tap()
return NotesMainMenu(self.marionette)
示例2: search
# 需要导入模块: from marionette_driver import Wait [as 别名]
# 或者: from marionette_driver.Wait import send_keys [as 别名]
def search(self, term):
iframe = Wait(self.marionette).until(
expected.element_present(*self._marketplace_iframe_locator))
Wait(self.marionette).until(expected.element_displayed(iframe))
self.marionette.switch_to_frame(iframe)
# This sleep seems necessary, otherwise on device we get timeout failure on display search_box sometimes, see bug 1136791
import time
time.sleep(10)
search_toggle = Wait(self.marionette).until(
expected.element_present(*self._search_toggle_locator))
Wait(self.marionette).until(expected.element_displayed(search_toggle))
search_toggle.tap()
search_box = Wait(self.marionette).until(
expected.element_present(*self._search_locator))
Wait(self.marionette).until(expected.element_displayed(search_box))
# This sleep is necessary, otherwise the search results are not shown on desktop b2g
import time
time.sleep(0.5)
# search for the app
search_box.send_keys(term)
search_box.send_keys(Keys.RETURN)
return SearchResults(self.marionette)
示例3: email
# 需要导入模块: from marionette_driver import Wait [as 别名]
# 或者: from marionette_driver.Wait import send_keys [as 别名]
def email(self, value):
"""Set the value of the email field."""
email = Wait(self.driver, self.timeout).until(
expected.element_present(*self._email_input_locator))
Wait(self.driver, self.timeout).until(
expected.element_displayed(email))
email.clear()
email.send_keys(value)
示例4: gmail_login
# 需要导入模块: from marionette_driver import Wait [as 别名]
# 或者: from marionette_driver.Wait import send_keys [as 别名]
def gmail_login(self, user, passwd):
email = Wait(self.marionette).until(
expected.element_present(*self._email_locator))
Wait(self.marionette).until(expected.element_displayed(email))
email.tap()
email.send_keys(user)
password = self.marionette.find_element(*self._password_locator)
password.tap()
password.send_keys(passwd)
self.keyboard.dismiss()
self.marionette.find_element(*self._sign_in_locator).tap()
示例5: a11y_connect_to_wifi
# 需要导入模块: from marionette_driver import Wait [as 别名]
# 或者: from marionette_driver.Wait import send_keys [as 别名]
def a11y_connect_to_wifi(self, network_ssid, password, key_management=None):
wifi_network = self.find_wifi_network(network_ssid)
self.accessibility.click(wifi_network)
# This is in the event we are using a Wifi Network that requires a password
# We cannot be sure of this thus need the logic
if key_management:
password_element = Wait(self.marionette).until(
expected.element_present(*self._password_input_locator))
Wait(self.marionette).until(expected.element_displayed(password_element))
password_element.send_keys(password)
self.accessibility.click(self.marionette.find_element(*self._join_network_locator))
示例6: enter_password
# 需要导入模块: from marionette_driver import Wait [as 别名]
# 或者: from marionette_driver.Wait import send_keys [as 别名]
def enter_password(self, password=None):
self._switch_to_fxa_iframe()
passwd_field = Wait(self.marionette, timeout=60).until(
expected.element_present(*self._password_locator))
passwd_field.send_keys(password)
# Wait until the keyboard is completely displayed, otherwise tapping
# the next button is unreliable
self.marionette.switch_to_frame()
Wait(self.marionette).until(lambda m: self.keyboard.is_keyboard_displayed)
self._switch_to_fxa_iframe()
self.marionette.find_element(*self._next_locator).tap()
示例7: select_when_use_is_above_unit_and_value
# 需要导入模块: from marionette_driver import Wait [as 别名]
# 或者: from marionette_driver.Wait import send_keys [as 别名]
def select_when_use_is_above_unit_and_value(self, unit, value):
when_use_is_above_button = self.marionette.find_element(*self._when_use_is_above_button_locator)
Wait(self.marionette).until(lambda m: when_use_is_above_button.get_attribute('disabled') == 'false')
when_use_is_above_button.tap()
current_unit = Wait(self.marionette).until(
expected.element_present(*self._unit_button_locator))
Wait(self.marionette).until(expected.element_displayed(current_unit))
if current_unit.text != unit:
current_unit.tap()
# We need to wait for the javascript to do its stuff
Wait(self.marionette).until(lambda m: current_unit.text == unit)
# clear the original assigned value and set it to the new value
size = Wait(self.marionette).until(expected.element_present(*self._size_input_locator))
Wait(self.marionette).until(expected.element_displayed(size))
size.clear()
size.send_keys(value)
self.marionette.find_element(*self._usage_done_button_locator).tap()
示例8: enter_email
# 需要导入模块: from marionette_driver import Wait [as 别名]
# 或者: from marionette_driver.Wait import send_keys [as 别名]
def enter_email(self, email=None):
self.marionette.switch_to_frame()
iframe = Wait(self.marionette, timeout=60).until(
expected.element_present(*self._iframe_locator))
Wait(self.marionette).until(expected.element_displayed(iframe))
Wait(self.marionette, timeout=60).until(lambda m: iframe.get_attribute('data-url') != 'about:blank')
self.marionette.switch_to_frame(iframe)
input = Wait(self.marionette, timeout=60).until(
expected.element_present(*self._input_locator))
Wait(self.marionette).until(expected.element_displayed(input))
input.send_keys(email)
# Wait until the keyboard is completely displayed, otherwise tapping
# the next button is unreliable
self.marionette.switch_to_frame()
Wait(self.marionette).until(lambda m: self.keyboard.is_keyboard_displayed)
self.marionette.switch_to_frame(iframe)
self.marionette.find_element(*self._next_locator).tap()
示例9: _type_in_field
# 需要导入模块: from marionette_driver import Wait [as 别名]
# 或者: from marionette_driver.Wait import send_keys [as 别名]
def _type_in_field(self, add_locator, field_locator, value):
Wait(self.marionette).until(expected.element_present(*add_locator)).tap()
element = Wait(self.marionette).until(expected.element_present(*field_locator))
Wait(self.marionette).until(expected.element_displayed(element))
element.clear()
element.send_keys(value)
示例10: type_password
# 需要导入模块: from marionette_driver import Wait [as 别名]
# 或者: from marionette_driver.Wait import send_keys [as 别名]
def type_password(self, password):
element = Wait(self.marionette).until(expected.element_present(*self._password_locator))
Wait(self.marionette).until(expected.element_displayed(element))
element.send_keys(password)