Send Keys

How can I pass keys for below:

  1. ENTER (1 key)
  2. CTRL + A ( 2 keys)
  3. CTRL + SHIFT + S (3 keys)

Hi,

  1. WebUI.sendKeys(findTestObject(‘yourTestobject’), Keys.ENTER)
    2.) WebUI.sendKeys(findTestObject(‘yourTestobject’), Keys.chord(Keys.CONTROL, ‘a’))
    3.) WebUI.sendKeys(findTestObject(‘yourTestobject’), Keys.chord(Keys.CONTROL,Keys.SHIFT, ‘S’))
4 Likes

How to press enter key in mobile keyboard?

1 Like

hamza farooq said:

How to press enter key in mobile keyboard?

hi hamza,

try this command.

Mobile.tapAtPosition(1075, 1900, FailureHandling.OPTIONAL)

i’m damm sure it will work though it is alternative way.

Hello All -
I need to key press without identifying a test object. Does anyone know how I can accomplish this? Thanks in advance!

1 Like

May be its works : WebUI.sendKeys(findTestObject(null)

1 Like
import org.openqa.selenium.By
import org.openqa.selenium.Keys
import com.kms.katalon.core.webui.driver.DriverFactory

DriverFactory.getWebDriver().findElement(By.xpath("//body")).sendKeys(Keys.ENTER);
3 Likes

Forgot to reply back. This was the method I tried and it worked. Great minds! Thanks again

1 Like

Hey,
SendKeys adds me an ASCII Null in the end of string or instead of Enter or other commands. Any ideas?

Thanks in advance!

0

Update: Tried both on Chrome and Firefox, in Manual and Skript modes. The same output.That weird symbol is still there:

Update: It finally works perfectly on Chrome. Any ideas, what can be changed in Firefox confs?

Hi!
I was able to get this to work and did not see a NULL at the end of the command.

WebUI.sendKeys(findTestObject(‘RepositoryItem’), Keys.chord(Keys.ENTER))
For the input, Choose a Value Type “Keys”. The value will default to ENTER but if you dropdown the VALUE menu, other key options will be displayed.

Hope this helps!

2 Likes

The same result… What browser do you use?

We’re using Chrome and Firefox. Latest and greatest. You could take the body element and assign it to a repository item. Have you tried this?

No, can you please give me more details, how to do that?

Create new Test Object with “/html/body” as the xpath. Use this test object as the element that will receive the Send Keys.

Don’t get, how could it help me…

Is there a reason for why you are attempting to intput a string using send keys? Why not just use set text

Tried it as well, and it works fine. However I need to manipulate with pop-up menu later, which can’t be accessed without using Keys.ENTER and Keys.ARROW_DOWN

Here happens the same in Firefox. In Chrome this works perfectly

This doesn’t work for me, do you know if it have another way to send keys without pass object?

working fine on Chrome but having issues while executing same in firefox. please help

1 Like