# Variable ‘Keys’ is not defined for test case

**URL:** <https://forum.katalon.com/t/variable-keys-is-not-defined-for-test-case/8128>\
**Category:** Miscellaneous\
**Created:** [October 22, 2017, 1:19am UTC](https://forum.katalon.com/t/variable-keys-is-not-defined-for-test-case/8128 "2017-10-22T01:19:30Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wimpie\_Vermaak\_1](https://avatars.discourse-cdn.com/v4/letter/w/d9b06d/32.png) [@Wimpie\_Vermaak\_1](https://forum.katalon.com/u/Wimpie_Vermaak_1)\
**Post date:** [October 22, 2017, 1:19am UTC](https://forum.katalon.com/t/variable-keys-is-not-defined-for-test-case/8128/1 "2017-10-22T01:19:30Z")

</div>

I have the following line of code:

WebUI.sendKeys(findTestObject(‘Individual Sign Up/Personal Information/street’), Keys.chord(Keys.TAB))

When I run the program it returns the following error:

Variable ‘Keys’ is not defined for test case

I have added the following import:

import com.kms.katalon.core.webui.keyword.builtin.SendKeysKeyword as Keys

Then I got the following error:

Test Cases/New Account Fails/Fails Test FAILED because (of) Variable ‘TAB’ is not defined for test case.

I also changed the chord to be the same as in the Send Keys example in the documentation for WebUI ([https://docs.katalon.com/display/KD/[WebUI]+Send+Keys](https://docs.katalon.com/display/KD/%5BWebUI%5D+Send+Keys)) and then I got the following error:

Test Cases/New Account Fails/Fails Test FAILED because (of) Variable ‘CONTROL’ is not defined for test case.

Which library do I need to import to be able to use the Keys?

---

<div class="post-metadata">

**Author:** ![Ashwary\_Soni](https://avatars.discourse-cdn.com/v4/letter/a/71c47a/32.png) [@Ashwary\_Soni](https://forum.katalon.com/u/Ashwary_Soni)\
**Post date:** [July 31, 2017, 12:48pm UTC](https://forum.katalon.com/t/variable-keys-is-not-defined-for-test-case/8128/2 "2017-07-31T12:48:25Z")

</div>

import static com.kms.katalon.core.checkpoint.CheckpointFactory.findCheckpoint  
import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase  
import static com.kms.katalon.core.testdata.TestDataFactory.findTestData  
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject  
import com.kms.katalon.core.checkpoint.Checkpoint as Checkpoint  
import com.kms.katalon.core.checkpoint.CheckpointFactory as CheckpointFactory  
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as MobileBuiltInKeywords  
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile  
import com.kms.katalon.core.model.FailureHandling as FailureHandling  
import com.kms.katalon.core.testcase.TestCase as TestCase  
import com.kms.katalon.core.testcase.TestCaseFactory as TestCaseFactory  
import com.kms.katalon.core.testdata.TestData as TestData  
import com.kms.katalon.core.testdata.TestDataFactory as TestDataFactory  
import com.kms.katalon.core.testobject.ObjectRepository as ObjectRepository  
import com.kms.katalon.core.testobject.TestObject as TestObject  
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WSBuiltInKeywords  
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS  
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUiBuiltInKeywords  
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI  
import internal.GlobalVariable as GlobalVariable

import org.openqa.selenium.Keys as Keys

[//WebUI.click](https://WebUI.click)(findTestObject(‘Object Repository/ESSnESS\_login/Page\_ESS ESS (2)/span\_Land OwnerDeveloper’))  
WebUI.setText(findTestObject(‘Object Repository/ESSnESS\_login/Page\_ESS ESS/input\_email’), Username)

WebUI.setText(findTestObject(‘Object Repository/ESSnESS\_login/Page\_ESS ESS/input\_password’), Password)

WebUI.click(findTestObject(‘Object Repository/ESSnESS\_login/Page\_ESS ESS/button\_Submit’))

WebUI.acceptAlert()

WebUI.callTestCase(findTestCase(‘Main Test Cases/EssnEss\_1\_Create\_land\_owner’), [“Username”:‘admin@gmail.com’, “Password”:‘Sahaadmin123#’], FailureHandling.STOP\_ON\_FAILURE)

Error:-Test Cases/Common Test Cases/ESSnESS\_Login FAILED because (of) Variable ‘Username’ is not defined for test case.

---

<div class="post-metadata">

**Author:** ![Ashwary\_Soni](https://avatars.discourse-cdn.com/v4/letter/a/71c47a/32.png) [@Ashwary\_Soni](https://forum.katalon.com/u/Ashwary_Soni)\
**Post date:** [July 31, 2017, 12:45pm UTC](https://forum.katalon.com/t/variable-keys-is-not-defined-for-test-case/8128/3 "2017-07-31T12:45:56Z")

</div>

Same error i am also getting.

Test Cases/Common Test Cases/ESSnESS\_Login FAILED because (of) Variable ‘Username’ is not defined for test case.

---

<div class="post-metadata">

**Author:** ![Ha\_Nguyen](https://avatars.discourse-cdn.com/v4/letter/h/54ee81/32.png) [@Ha\_Nguyen](https://forum.katalon.com/u/Ha_Nguyen)\
**Post date:** [May 16, 2017, 8:35am UTC](https://forum.katalon.com/t/variable-keys-is-not-defined-for-test-case/8128/4 "2017-05-16T08:35:58Z")

</div>

Hi there,

What error message do you observe after using that package?

Thanks

---

<div class="post-metadata">

**Author:** ![swaroop\_kotme](https://avatars.discourse-cdn.com/v4/letter/s/9e8a1a/32.png) [@swaroop\_kotme](https://forum.katalon.com/u/swaroop_kotme)\
**Post date:** [May 16, 2017, 6:38am UTC](https://forum.katalon.com/t/variable-keys-is-not-defined-for-test-case/8128/5 "2017-05-16T06:38:02Z")

</div>

The above solution is also not working i tried to import package ,but still facing issue

---

<div class="post-metadata">

**Author:** ![Zarashima](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/zarashima/32/928_2.png) [@Zarashima](https://forum.katalon.com/u/Zarashima)\
**Post date:** [January 28, 2017, 8:54am UTC](https://forum.katalon.com/t/variable-keys-is-not-defined-for-test-case/8128/6 "2017-01-28T08:54:05Z")

</div>

Hi there,

Please use the following import package instead of 'com.kms.katalon.core.webui.keyword.builtin.SendKeysKeyword ':

> import org.openqa.selenium.Keys as Keys

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/katalon/original/3X/d/5/d55596ab02785a255798e87ede769734747b30c4.svg) [@system](https://forum.katalon.com/u/system)\
**Post date:** [July 1, 2022, 10:11pm UTC](https://forum.katalon.com/t/variable-keys-is-not-defined-for-test-case/8128/7 "2022-07-01T22:11:22Z")

</div>

Automatically bumped on July 1, 2022, 10:11pm UTC



---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [July 2, 2022, 12:43am UTC](https://forum.katalon.com/t/variable-keys-is-not-defined-for-test-case/8128/8 "2022-07-02T00:43:14Z")

</div>

Closed on July 2, 2022, 12:43am UTC


