# 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 ->&#x20;

     ```
     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 ->&#x20;

     ```
     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 ->&#x20;

     ```
     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 ->&#x20;

     ```
     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 ->&#x20;

     ```
     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 ->&#x20;

     ```
     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 ->&#x20;

     ```
     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 -> <br>

     ```
     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.

     <figure><img src="/files/C1LqEOiZEKUCVBKEBnlc" alt=""><figcaption></figcaption></figure>
   * 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

     <figure><img src="/files/2fMk1hPlwwOXJ3vQhV5I" alt=""><figcaption></figcaption></figure>
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 -> <br>

      ```
      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.&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.precisiontestautomation.in/scriptlessautomation/automation-platforms/scriptlessweb-automation/web-automation-key-phrases/send_keys.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
