How Do You Use Send keys in Katalon?

Ross Jackman | March 6, 2023

How Do You Use Sendkeys in Katalon?

Automating doesn't just involve navigating and clicking through links. It's useful for switching tabs, finding broken links, and even dragging and dropping. The passing of values to text fields is one of the most important aspects of test automation. By using the sendKeys() method, we'll learn how this helps us pass values to text fields.

The sendKeys() method in Katalon is used to enter editable text and password content during the execution of tests. Locators such as name, class, and id are used to identify these fields. A web element provides this method. The sendKeys() method does not replace existing text in any text box. sendKeys() can also be used to click the buttons automatically. sendKeys() provides the facility to simulate keystroke events on the specified element in software testing services.

Following are the steps for using Send Keys in Katalon:

  1. From the menu, select File → New → Keyword
  2. As a result, a new keyword is created in the package
  3. Click on the above file to open it
  4. Under the items column, enter a new 'Web UI Keyword'
  5. Click on 'Send Keys'
  6. Tap twice on the object column. The new model will appear with other columns
  7. Replace the value type 'String' with 'Keys'
  8. Tap twice on the column value. A second modal will appear, and the user can tap the keys directly to the keyboard or select it from the list
  9. When you're done, save the Keyword file

A simple example is WebUI.sendKeys(findTestObject(‘Object location’), Keys.chord(Keys.ENTER))

Disclaimer

This publication is for informational purposes only, and nothing contained in it should be considered legal advice. We expressly disclaim any warranty or responsibility for damages arising out of this information and encourage you to consult with legal counsel regarding your specific needs. We do not undertake any duty to update previously posted materials.

Post a Comment

Categories