Refer the article New Selenium IDE – Commands (Selenese), for the complete list of Selenium IDE commands and their practical demonstrations.
send keys is one of the commands in Selenium IDE.
The purpose of the send keys command is to press the required keyboard key using any of the below-specified keyboard keycodes:
[su_table alternate=”no”]
Key Code | Function |
---|---|
KEY_LEFT | Navigation Left |
KEY_UP | Navigation Up |
KEY_RIGHT | Navigation Right |
KEY_DOWN | Navigation Down |
KEY_PGUP or KEY_PAGE_UP | Page up |
KEY_PGDN or KEY_PAGE_DOWN | Page down |
KEY_BKSP or KEY_BACKSPACE | Backspace |
KEY_DEL or KEY_DELETE | Delete |
KEY_ENTER | Enter |
KEY_TAB | Tab |
[/su_table]
In this article, I am going to practically demonstrate send keys command in Selenium IDE to press any required keyboard key as shown below:
Let’s get started.
New Selenium IDE – Using ‘send keys’ command
Follow the below steps for practicing send keys command in Selenium IDE along with me:
1) Let’s write the below code in Selenium IDE to press any required key say ‘Enter’ keyboard key as shown below:
[su_table alternate=”no”]
Command | Target | Value |
---|---|---|
open | http://omayo.blogspot.com/ | |
type | name=q | qafox.com |
send keys | name=q | ${KEY_ENTER} |
[/su_table]
After incorporating the commands in the above table, our Selenium IDE should look like below:
2) Run the test and observe that the qafox.com text will be entered into the search box field and the search will be performed as the Enter keyboard key will be pressed as shown below:
Here concludes the practical demonstration of send keys command in Selenium IDE for pressing the ‘Enter’ keyboard key.
In the next article, I will practically demonstrate another Selenium IDE command.
Next Steps:
- > Check complete Selenium Tutorial Contents here (Click here)
Please leave your questions/comments/feedback below.
Happy Learning ?
On a mission to contribute to the Software Testing Community in all possible ways.
Refer the article New Selenium IDE – Commands (Selenese), for the complete list of Selenium IDE commands and their practical demonstrations.