Send Keys


#1

How can I pass keys for below:

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

#2

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’))

#3

How to press enter key in mobile keyboard?


#4

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.


#5

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


#6

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


#7
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);

#8

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


#9

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?


#10

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!


#11

The same result… What browser do you use?


#12

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?


#13

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


#14

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


#15

Don’t get, how could it help me…


#16

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


#17

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


#18

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


#19

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


#20

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