I want to select the time 08:00 which is not visible, we need to scroll down:
I followed the below steps:
- clicked on select time box (after which the drop down list appears)
2.Scroll down to element (in this case to the time 08:00) used xpath //ul[@id=option-list-01]/descendant::div[text()=‘08:00’]
3.click 08:00 again same xpath
But I am unable to select the time. Could you please help me here.

Hello,
can you show script you using? are you using WebUI.scrollTo() to get element to view?
what error are you getting?
@Andrej_Podhajsky
WebUI.click(findTestObject(‘Scheduler/SelectTime’))
WebUI.scrollToElement(findTestObject(‘Scheduler/Time’), 0)
WebUI.click(findTestObject(‘Scheduler/Time’), FailureHandling.STOP_ON_FAILURE)
Error:
eason:
com.kms.katalon.core.exception.StepFailedException: Unable to scroll to object ‘Object Repository/Scheduler/Time’
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.stepFailed(WebUIKeywordMain.groovy:64)
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:26)
at com.kms.katalon.core.webui.keyword.builtin.ScrollToElementKeyword.scrollToElement(ScrollToElementKeyword.groovy:88)
at com.kms.katalon.core.webui.keyword.builtin.ScrollToElementKeyword.execute(ScrollToElementKeyword.groovy:68)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:72)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.scrollToElement(WebUiBuiltInKeywords.groovy:2975)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$scrollToElement$0.call(Unknown Source)
at Enroll Patient.run(Enroll Patient:197)
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.RawTestScriptExecutor.runScript(RawTestScriptExecutor.java:34)
at com.kms.katalon.core.main.RawTestScriptExecutor.doExecute(RawTestScriptExecutor.java:29)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:307)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:299)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:233)
at com.kms.katalon.core.main.TestCaseMain.runTestCaseRawScript(TestCaseMain.java:151)
at com.kms.katalon.core.main.TestCaseMain$runTestCaseRawScript$0.call(Unknown Source)
at TempTestCase1599727774945.run(TempTestCase1599727774945.groovy:224)
Caused by: com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id: ‘Object Repository/Scheduler/Time’ located by ‘By.xpath: //ul[@id=option-list-01]/descendant::div[text()=‘08:00’]’ not found
at com.kms.katalon.core.webui.common.WebUiCommonHelper.findWebElement(WebUiCommonHelper.java:1154)
at com.kms.katalon.core.webui.keyword.internal.WebUIAbstractKeyword.findWebElement(WebUIAbstractKeyword.groovy:27)
Hi,
set this field ReadOnly value to false and fill 8:00 direct to it
like
WebUI.executeJavaScript("document.getElementById(‘someId’).readOnly = false;
please try change xpath
//id('option-list-01')//div[contains(text(),'08:00')]
i would use this as last resort since you are changing behavior of page … that’s not what an user can do…
@Andrej_Podhajsky I changed the xpath, but still getting the same error.
hello,
if this is tested in test env then it’s ok to change readonly value to get test work, that’s my opinion
should not do in production env
i guess that he/she is not testing dropdown functionality
@Timo_Kuisma1 Hi,
I am not allowed to do that, cause the scripts need to run across multiple environments so cannot change the page behaviour.