Date picker Web Testing

Hi,
My script cant seem to handle my date picker, i keep getting the same error, im new to katalon so if anyone could help would be much appreciated, ive looked at some posts but all seem to lead me to writing javascript, is there anyway around this or does the code need to be changed ?

com.kms.katalon.core.exception.StepFailedException: Unable to click on object ‘Object Repository/New employee/Page_CIPHR Self Service 9.0.3/a_1’ (Root cause: com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id: ‘Object Repository/New employee/Page_CIPHR Self Service 9.0.3/a_1’ located by ‘By.xpath: //div[@id=‘05378500-202e-4bfb-99e0-52786c54e4ab’]/table/tbody/tr/td[6]/a’ 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.ClickKeyword.click(ClickKeyword.groovy:86)
at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword.execute(ClickKeyword.groovy:67)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:53)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.click(WebUiBuiltInKeywords.groovy:616)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$click$4.call(Unknown Source)
at New employee - HR.run(New employee - HR:63)
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 TempTestCase1549539751174.run(TempTestCase1549539751174.groovy:22)

1 Like

The error is saying the xpath above does not work.

I’m guessing that id is dynamic (changes each time the page is executed). You might try modifying the xpath to not use the id.

2 Likes

Thanks for getting back to me Russ - Ill take on board your help and look into it :slight_smile:

2 Likes

For what it’s worth, I was successful using the following JavaScript command to set a date in my datepicker field, since the Click command was not working.

Execute JavaScript | | document.getElementById(“edit-sales-funnel-widget-field-graduation-month-and-year-und-0-value-date”).value = “08/2017”;

My date field is just mm/yyyy, but you could adjust this to fit your date format. Hope this helps.

2 Likes

Yea ive seen that answer a lot, if I cant get it working with changing the xpath then I will just result to javascript command - Thanks Jeff

2 Likes