⌨️SEND_KEYS

The SEND_KEYS action is a multi-purpose section in web automation it serves as a supporting action for various commands by providing necessary values or parameters.

Associated Commands

SEND_KEYS can be associated with the following commands to support their actions:

  1. SEND_KEYS

    • KeyStroke on the element

    • Syntax ->

      PAGE_NAME,WAIT_TYPE,SCROLL_TYPE,ELEMENT_NAME,ACTIONS,SEND_KEYS,VALIDATION,VALIDATION_TYPE
      SwagLabs,VISIBILITY,NONE,password,SEND_KEYS,testpassword,NONE,NONE
  2. LOAD_URL

    • Provides the URL to be loaded in the browser.

    • Syntax ->

      PAGE_NAME,WAIT_TYPE,SCROLL_TYPE,ELEMENT_NAME,ACTIONS,SEND_KEYS,VALIDATION,VALIDATION_TYPE
      NONE,NONE,NONE,NONE,LOAD_URL,https://www.saucedemo.com/,NONE,NONE
  3. DEPENDANT_TEST_CASE

    • Specifies the name of the test case to be executed as a dependency.

    • Syntax ->

      PAGE_NAME,WAIT_TYPE,SCROLL_TYPE,ELEMENT_NAME,ACTIONS,SEND_KEYS,VALIDATION,VALIDATION_TYPE
      NONE,NONE,NONE,NONE,DEPENDANT_TEST_CASE,search,NONE,NONE
  4. PERFORM_PRE_FLOWS

    • Indicates the specific pre-flow steps to be executed before the main test actions.

    • Syntax ->

      PAGE_NAME,WAIT_TYPE,SCROLL_TYPE,ELEMENT_NAME,ACTIONS,SEND_KEYS,VALIDATION,VALIDATION_TYPE
      NONE,NONE,NONE,NONE,PERFORM_PRE_FLOWS,FIRST_NAME,NONE,NONE
      SwagLabs,VISIBILITY,NONE,userName,SEND_KEYS,GlobalVariables:FIRST_NAME,NONE,NONE
  5. HARD_WAIT

    • Defines the duration of the pause in the test execution, typically given in seconds or milliseconds.

    • Syntax ->

      PAGE_NAME,WAIT_TYPE,SCROLL_TYPE,ELEMENT_NAME,ACTIONS,SEND_KEYS,VALIDATION,VALIDATION_TYPE
      NONE,NONE,NONE,NONE,DEPENDANT_TEST_CASE,search,NONE,NONE
      NONE,NONE,NONE,NONE,HARD_WAIT,3,NONE,NONE
  6. API_EXECUTOR

    • Sends necessary parameters for the API call being executed within the test.

    • Syntax ->

      PAGE_NAME,WAIT_TYPE,SCROLL_TYPE,ELEMENT_NAME,ACTIONS,SEND_KEYS,VALIDATION,VALIDATION_TYPE
      NONE,NONE,NONE,NONE,API_EXECUTOR,POST,NONE,NONE
      NONE,NONE,NONE,NONE,LOAD_URL,https://www.saucedemo.com/,NONE,NONE
  7. CUSTOM

    • Passes custom values or scripts that are required for a custom-defined action.

    • Syntax ->

      PAGE_NAME,WAIT_TYPE,SCROLL_TYPE,ELEMENT_NAME,ACTIONS,SEND_KEYS,VALIDATION,VALIDATION_TYPE
      NONE,NONE,NONE,NONE,CUSTOM,CustomClass:LoadString,NONE,NONE
    • Here CustomClass -> class name and MethodName -> LoadString

  8. FETCH_GMAIL_SUBJECT

    • Provides a filter or condition to retrieve the subject line of an email from Gmail.

    • To get gmail body , syntax ->

      PAGE_NAME,WAIT_TYPE,SCROLL_TYPE,ELEMENT_NAME,ACTIONS,SEND_KEYS,VALIDATION,VALIDATION_TYPE
      NONE,NONE,NONE,NONE,FETCH_GMAIL_SUBJECT,TestSubject&&30|TestName,NONE,NONE
      NONE,NONE,NONE,NONE,CUSTOM,CustomClass:fetchBody,NONE,NONE
    • Here TestSubject -> is gmail subject , 30 -> time difference in minutes and TestName -> is by the name with body is stored in globalvariables.

    • To get Specific String from mail body, syntax ->

      PAGE_NAME,WAIT_TYPE,SCROLL_TYPE,ELEMENT_NAME,ACTIONS,SEND_KEYS,VALIDATION,VALIDATION_TYPE
      NONE,NONE,NONE,NONE,FETCH_GMAIL_SUBJECT,testSubject1&&5&&suffix&&prefix|TestName1,NONE,NONE
      NONE,NONE,NONE,NONE,CUSTOM,CustomClass:fetchBody,NONE,NONE
    • Here testSubject1 -> is gmail subject , 5 -> time difference in minutes , suffix -> Suffix of the mail body, prefix -> prefix of the mail body, TestName1 -> is by the name with body is stored in globalvariables

  9. EXPLICIT_WAIT_TEXT_PRESENT

    • Specifies the text for which the automation should wait until it is present on the element.

    • Syntax ->

      PAGE_NAME,WAIT_TYPE,SCROLL_TYPE,ELEMENT_NAME,ACTIONS,SEND_KEYS,VALIDATION,VALIDATION_TYPE
      SwagLabs,VISIBILITY,NONE,errorMessage,EXPLICIT_WAIT_TEXT_PRESENT,Epic sadface: Username and password do not match any user in this service&&10,NONE,NONE
    • In sendkeys -> TextToBeWait&&TimeOut

  10. SAVE

    • Can be used to specify the name or key under which to save element text during the test for later use.

    • Syntax ->

      PAGE_NAME,WAIT_TYPE,SCROLL_TYPE,ELEMENT_NAME,ACTIONS,SEND_KEYS,VALIDATION,VALIDATION_TYPE
      SwagLabs,VISIBILITY,NONE,errorMessage,SAVE,errormessagename,NONE,NONE
    • SendKeys have the name with which element text is saved in global variables.

Last updated

Was this helpful?