Unable to do Keys.enter at Website

Getting below error

03-03-2018 05:27:38 PM - [ERROR] - Test Cases/tumblr FAILED because (of) groovy.lang.MissingMethodException: No signature of method: static com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.sendKeys() is applicable for argument types: (com.kms.katalon.core.testobject.TestObject, org.openqa.selenium.Keys) values: [TestObject - ‘Object Repository/Login/Tags’, ]

Possible solutions: sendKeys(com.kms.katalon.core.testobject.TestObject, java.lang.String), sendKeys(com.kms.katalon.core.testobject.TestObject, java.lang.String, com.kms.katalon.core.model.FailureHandling)

Here is code:-

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.openBrowser(‘Tumblr’)

WebUI.maximizeWindow(FailureHandling.CONTINUE_ON_FAILURE)

WebUI.waitForElementPresent(findTestObject(‘Login/Login’), 2)

WebUI.doubleClick(findTestObject(‘Login/Login’))

WebUI.waitForElementPresent(findTestObject(‘Login/email’), 5)

WebUI.sendKeys(findTestObject(‘Login/email’), ‘some@gmail.com’)

WebUI.waitForElementPresent(findTestObject(‘Login/next’), 5)

WebUI.doubleClick(findTestObject(‘Login/next’))

WebUI.waitForElementPresent(findTestObject(‘Login/password’), 5)

WebUI.sendKeys(findTestObject(‘Login/password’), ‘somepassword’)

WebUI.doubleClick(findTestObject(‘Login/loginbtn’))

WebUI.waitForElementPresent(findTestObject(‘PhotoLink/Photo’), 5)

WebUI.doubleClick(findTestObject(‘PhotoLink/Photo’))

WebUI.waitForElementPresent(findTestObject(‘PhotoLink/UploadPhotos’), 5)

WebUI.doubleClick(findTestObject(‘PhotoLink/UploadPhotos’), FailureHandling.CONTINUE_ON_FAILURE)

Thread.sleep(30000)

WebUI.waitForElementPresent(findTestObject(‘Login/Tags’), 5)

WebUI.focus(findTestObject(‘Login/Tags’))

WebUI.sendKeys(findTestObject(‘Login/Tags’), findTestData(‘Excel/tumblr’).getValue(1, 1))

WebUI.sendKeys(findTestObject(‘Login/Tags’), Keys.ENTER)

for (def index : (2…10)) {

WebUI.waitForElementPresent(findTestObject('Login/Tags2'), 5)



WebUI.focus(findTestObject('Login/Tags2'))



WebUI.sendKeys(findTestObject('Login/Tags2'), findTestData('Excel/tumblr').getValue(1, index))



WebUI.sendKeys(findTestObject('Login/Tags2'), Keys.ENTER)

}

WebUI.closeBrowser()

Try this?

WebUI.sendKeys(findTestObject(‘Login/Tags2’), ((Keys.ENTER) as String))

1 Like

Thanks