tools/perf/page_sets/login_helpers/linkedin_login.py
def LoginDesktopAccount(action_runner, credential,
                 credentials_path=login_utils.DEFAULT_CREDENTIAL_PATH):
  """Logs in into a Linkedin account.

  This function navigates the tab into Linkedin's login page and logs in a user
  using credentials in |credential| part of the |credentials_path| file.

  Args:
    action_runner: Action runner responsible for running actions on the page.
    credential: The credential to retrieve from the credentials file (string).
    credentials_path: The path to credential file (string).

  Raises:
    exceptions.Error: See ExecuteJavaScript()
    for a detailed list of possible exceptions.
  """
  account_name, password = login_utils.GetAccountNameAndPassword(
      credential, credentials_path=credentials_path)

  action_runner.Navigate('https://www.linkedin.com/uas/login')
  action_runner.Wait(1) # Error page happens if this wait is not here.
  login_utils.InputWithSelector(
      action_runner, '%s@gmail.com' % account_name, 'input[type=text]')
  login_utils.InputWithSelector(
      action_runner, password, 'input[type=password]')

  login_button_function = (
      '''document.querySelectorAll("[aria-label^='Sign in']")[0]''')
  action_runner.WaitForElement(element_function=login_button_function)
  action_runner.ClickElement(element_function=login_button_function)

  action_runner.Wait(2)
  # This reload is needed for opening desktop page on mobile device
  action_runner.ReloadPage()

  search_bar_function = (
      "document.getElementById('extended-nav-search')")
  action_runner.WaitForElement(element_function=search_bar_function)
Logs in into a Linkedin account.

  This function navigates the tab into Linkedin's login page and logs in a user
  using credentials in |credential| part of the |credentials_path| file.

  Args:
    action_runner: Action runner responsible for running actions on the page.
    credential: The credential to retrieve from the credentials file (string).
    credentials_path: The path to credential file (string).

  Raises:
    exceptions.Error: See ExecuteJavaScript()
    for a detailed list of possible exceptions.
  
Logs in into a Linkedin account.
This function navigates the tab into Linkedin's login page and logs in a user
using credentials in |credential| part of the |credentials_path| file.

Action runner responsible for running actions on the page.
credential: The credential to retrieve from the credentials file (string).
credentials_path: The path to credential file (string).

exceptions.Error: See ExecuteJavaScript()
for a detailed list of possible exceptions.
Logs in into a Linkedin account . This function navigates the tab into Linkedin ' s login page and logs in a user using credentials in |credential| part of the |credentials_path| file . Action runner responsible for running actions on the page . credential : The credential to retrieve from the credentials file ( string ) . credentials_path : The path to credential file ( string ) . exceptions . Error : See ExecuteJavaScript () for a detailed list of possible exceptions .
def LoginDesktopAccount(action_runner, credential,
                 credentials_path=login_utils.DEFAULT_CREDENTIAL_PATH):
  account_name, password = login_utils.GetAccountNameAndPassword(
      credential, credentials_path=credentials_path)
  action_runner.Navigate('https://www.linkedin.com/uas/login')
  action_runner.Wait(1) 
  login_utils.InputWithSelector(
      action_runner, '%s@gmail.com' % account_name, 'input[type=text]')
  login_utils.InputWithSelector(
      action_runner, password, 'input[type=password]')
  login_button_function = (
      '''document.querySelectorAll("[aria-label^='Sign in']")[0]''')
  action_runner.WaitForElement(element_function=login_button_function)
  action_runner.ClickElement(element_function=login_button_function)
  action_runner.Wait(2)
  action_runner.ReloadPage()
  search_bar_function = (
      "document.getElementById('extended-nav-search')")
  action_runner.WaitForElement(element_function=search_bar_function)
def LoginDesktopAccount ( action_runner , credential , credentials_path = login_utils . DEFAULT_CREDENTIAL_PATH ) : account_name , password = login_utils . GetAccountNameAndPassword ( credential , credentials_path = credentials_path ) action_runner . Navigate ( 'https://www.linkedin.com/uas/login' ) action_runner . Wait ( 1 ) login_utils . InputWithSelector ( action_runner , '%s@gmail.com' % account_name , 'input[type=text]' ) login_utils . InputWithSelector ( action_runner , password , 'input[type=password]' ) login_button_function = ( '''document.querySelectorAll("[aria-label^='Sign in']")[0]''' ) action_runner . WaitForElement ( element_function = login_button_function ) action_runner . ClickElement ( element_function = login_button_function ) action_runner . Wait ( 2 ) action_runner . ReloadPage ( ) search_bar_function = ( "document.getElementById('extended-nav-search')" ) action_runner . WaitForElement ( element_function = search_bar_function )
Logs in into a Linkedin account.
Logs in into a Linkedin account .
"""Logs in into a Linkedin account.

  This function navigates the tab into Linkedin's login page and logs in a user
  using credentials in |credential| part of the |credentials_path| file.

  Args:
    action_runner: Action runner responsible for running actions on the page.
    credential: The credential to retrieve from the credentials file (string).
    credentials_path: The path to credential file (string).

  Raises:
    exceptions.Error: See ExecuteJavaScript()
    for a detailed list of possible exceptions.
  """ # Error page happens if this wait is not here. # This reload is needed for opening desktop page on mobile device
action_runner
credential
credentials_path