Date of Birth Text Field won't accept Set Text

Hi All

first post after spending plenty of time trying to find a solution.
I just cannot get a Date of Birth field to populate with text. I am avoiding the date picker and just setting the text as it should be in the format dd/mm/yyyy but every test run just stalls at this input.

If I disable this input the test run goes without issue so it is only this one sticking point.
Any suggestions?

Below is a copy of the error message.

01-21-2019 06:30:24 PM setText(findTestObject(“Credit Check/input_DateOfBirthApplicant”), DateOfBirthApplicant)

Elapsed time: 31.222s

setText(findTestObject(“Credit Check/input_DateOfBirthApplicant”), DateOfBirthApplicant) FAILED.

Reason:

com.kms.katalon.core.exception.StepFailedException: Unable to set text ‘02/02/1975’ of object ‘Object Repository/Credit Check/input_DateOfBirthApplicant’ (Root cause: com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id: ‘Object Repository/Credit Check/input_DateOfBirthApplicant’ located by ‘By.xpath: //input[@id=‘dp1548092088255’]’ not found)

at com.kms.katalon.core.keyword.internal.KeywordMain.stepFailed(KeywordMain.groovy:36)

at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.stepFailed(WebUIKeywordMain.groovy:65)

at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:27)

at com.kms.katalon.core.webui.keyword.builtin.SetTextKeyword.setText(SetTextKeyword.groovy:65)

at com.kms.katalon.core.webui.keyword.builtin.SetTextKeyword.execute(SetTextKeyword.groovy:37)

at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:53)

at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.setText(WebUiBuiltInKeywords.groovy:950)

at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$setText$2.call(Unknown Source)

at Credit Check.run(Credit Check:44)

at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)

at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)

at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:328)

at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:319)

at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:298)

at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:290)

at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:224)

at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:106)

at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:97)

at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)

at TempTestCase1548095416581.run(TempTestCase1548095416581.groovy:22)

Hi Vincent,

Your XPath is invalid. Isn’t it generated dynamically?

Edit: Yup, that number is unix timestamp from today. See few tips for using XPaths:

https://docs.katalon.com/katalon-studio/tutorials/xpath_katalon_studio_tips.html

The error specifies that the element can’t be found with the xpath you are using. Can you share the HTML of the DOB field?

I couldn’t find it. There appears to be a div that says ‘wholewebpage’ or something like that.
Strange how this is the only entry that is affected.

Hmmmm I have a sneaking suspicion that you were using the Web Recorder and ended up grabbing a dynamic element as @Marek_Melocik mentioned .

Are you familiar with your browser’s inspector tool? Try right-clicking on the DOB field, and click “Inspect”. What you want is likely an <input> element for the field (that’s what the xpath from your error would suggest). If you can find this element and post a screenshot of the HTML for it, we can probably suggest a custom xpath to solve your problem!

I did use the recorder. I will do as you suggest and post what I get here.

Thanks