tools/perf/page_sets/login_helpers/login_utils.py
def InputWithSelector(action_runner, input_text, input_selector):
  """Sets the text value of an input field in a form on the page.

  Waits until the input element exists on the page. Then executes JS to populate
  the value property of the element with |input_text|.

  Args:
    action_runner: ActionRunner instance to execute JS to populate form fields.
    input_text: Text string to populate the input field with.
    input_selector: The selector of the input element.


  Raises:
    exceptions.TimeoutException: If waiting to find the element times out.
    exceptions.Error: See ExecuteJavaScript() for a detailed list of
      possible exceptions.
  """
  action_runner.WaitForElement(selector=input_selector)
  action_runner.Wait(0.5)
  # Focus the requested element first and then enter text using single
  # Keyboard events to bypass certain restrictions on websites.
  action_runner.ExecuteJavaScript(
      'document.querySelector({{selector}}).focus()', selector=input_selector)
  # Wait a bit to make sure the focus is properly set, otherwise we'll end up
  # losing some characters.
  action_runner.Wait(0.5)
  action_runner.EnterText(input_text)
Sets the text value of an input field in a form on the page.

  Waits until the input element exists on the page. Then executes JS to populate
  the value property of the element with |input_text|.

  Args:
    action_runner: ActionRunner instance to execute JS to populate form fields.
    input_text: Text string to populate the input field with.
    input_selector: The selector of the input element.


  Raises:
    exceptions.TimeoutException: If waiting to find the element times out.
    exceptions.Error: See ExecuteJavaScript() for a detailed list of
      possible exceptions.
  
Sets the text value of an input field in a form on the page.
Waits until the input element exists on the page. Then executes JS to populate
the value property of the element with |input_text|.
Sets the text value of an input field in a form on the page . Waits until the input element exists on the page . Then executes JS to populate the value property of the element with |input_text| .
def InputWithSelector(action_runner, input_text, input_selector):
  action_runner.WaitForElement(selector=input_selector)
  action_runner.Wait(0.5)
  action_runner.ExecuteJavaScript(
      'document.querySelector({{selector}}).focus()', selector=input_selector)
  action_runner.Wait(0.5)
  action_runner.EnterText(input_text)
def InputWithSelector ( action_runner , input_text , input_selector ) : action_runner . WaitForElement ( selector = input_selector ) action_runner . Wait ( 0.5 ) action_runner . ExecuteJavaScript ( 'document.querySelector({{selector}}).focus()' , selector = input_selector ) action_runner . Wait ( 0.5 ) action_runner . EnterText ( input_text )
Sets the text value of an input field in a form on the page.
Sets the text value of an input field in a form on the page .
"""Sets the text value of an input field in a form on the page.

  Waits until the input element exists on the page. Then executes JS to populate
  the value property of the element with |input_text|.

  Args:
    action_runner: ActionRunner instance to execute JS to populate form fields.
    input_text: Text string to populate the input field with.
    input_selector: The selector of the input element.


  Raises:
    exceptions.TimeoutException: If waiting to find the element times out.
    exceptions.Error: See ExecuteJavaScript() for a detailed list of
      possible exceptions.
  """ # Focus the requested element first and then enter text using single # Keyboard events to bypass certain restrictions on websites. # Wait a bit to make sure the focus is properly set, otherwise we'll end up # losing some characters.
If waiting to find the element times out.
If waiting to find the element times out .
exceptions.TimeoutException
See ExecuteJavaScript() for a detailed list of
possible exceptions.
See ExecuteJavaScript () for a detailed list of possible exceptions .
exceptions.Error
action_runner
ActionRunner instance to execute JS to populate form fields.
ActionRunner instance to execute JS to populate form fields .
input_text
Text string to populate the input field with.
Text string to populate the input field with .
input_selector
The selector of the input element.
The selector of the input element .