Type first 2 characters then forced to pick from dropdown list

Hi
I am new to Katalon so sorry if this has been asked before.
I am trying to automate the picking of a company name. The site requires that you type at least 2 characters into a text box then you MUST choose from a kendo dropdown list.

I have tried this:
WebUI.setText(findTestObject(‘Object Repository/Page_CompanyName - Business Application Form/input_Legal Name’),
‘test1’)

((DriverFactory.getWebDriver()) as JavascriptExecutor).executeScript(’$("#ContactInformationCompany_CompanyLegalName").data(“kendoDropDownList”).select(1);’)

and this is the error I get
10-09-2019 04:54:28 PM Test Cases/ApplicationBusinessLoan

Elapsed time: 11.976s

Test Cases/ApplicationBusinessLoan FAILED.
Reason:
org.openqa.selenium.JavascriptException: TypeError: $(…).data(…) is undefined

I have imported all suggestions on this forum and was wondering if anyone could help me?

Would using JavaScript for both steps make any difference?

Many thanks, A Newbie :slight_smile:

Hi Emma

Depends. It looks as though you’re trying to use jQuery (the JavaScript code contains $(...) which usually indicates jQuery). So first, please confirm jQuery is present on the page.

How to Verify jQuery Present
Bring up the Browser DevTools Console[1] and type this in the console and hit ENTER:

jQuery

You should see something like this:
image
Let me know what you find.

Either way, please post a screenshot of the HTML used to construct the dropdown.


[1]

Thank you Russ this is what i got from the console

When i asked about the sample code, I was told its not a thing because of the client so they have put one of their developers onto it to help me out. Sorry and thank you Emma