Key_Enter from Recorder to Studio?

Hello!

I’m Completly new to Kalaton and to automation testing, i recorder a Script using the Recorder on Chrome and Firefox, its a Simple Script that opens google, writes a random word and press enter, here comes the fun part, when importing it to Katalon Studio, this Part:

**_selenium.sendKeys(“id=lst-ib”, “${KEY_ENTER}”)

_**Gives:

Test Cases/New Test Case FAILED because (of) Variable ‘KEY_ENTER’ is not defined for test case.

Tried importing org.openqa.selenium as Keys and that did not work, so…

What can i do to Add the variable KEY_ENTER to the project?

Regards~

zahocutuna said:

Hello!

I’m Completly new to Kalaton and to automation testing, i recorder a Script using the Recorder on Chrome and Firefox, its a Simple Script that opens google, writes a random word and press enter, here comes the fun part, when importing it to Katalon Studio, this Part:

**_selenium.sendKeys(“id=lst-ib”, “${KEY_ENTER}”)

_**Gives:

Test Cases/New Test Case FAILED because (of) Variable ‘KEY_ENTER’ is not defined for test case.

Tried importing org.openqa.selenium as Keys and that did not work, so…

What can i do to Add the variable KEY_ENTER to the project?

Regards~

Hi zahocutuna,

Thank you for choosing Katalon tools set. There are several ways to simulate key Enter.


1. selenium.keyPressNative("10")
2. driver.findElement(ById.id('lst-ib')).sendKeys(Keys.RETURN)

Feel free to post in the forum in case of further issues.

Best,

Liam

Thanks!

Will sure do with this nice community!

I have a similar case where I am unable to Press Return on the Recorder. I know Keys.ENTER translates to ${KEY_ENTER}. What does Keys.Return translate to?

Scenario: A listbox dropdown where I need to press down, enter the desired string in the search box that appears (the dropdown will show a matching entry) and press Return or Enter to have the entry chosen.