0

I have a problem with a unit test. Use Katalon and find all the fields LESS the datepicker ... in them it falls and it gives an error when I select a from a datepicker

09-08-2018 05:58:36 PM - [FAILED] - Unable to click on object 'Object Repository/Page_Escritorio Acepta/span_Prev' (Root cause: com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id: 'Object Repository/Page_Escritorio Acepta/span_Prev' located by 'By.xpath: //div[@id='ui-datepicker-div']/div/a/span' not found)

In other words, you can not click on the date (selected day)


This is my datepicker script from a demo web:

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.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW
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.testdata.TestData as TestData
import com.kms.katalon.core.testobject.TestObject as TestObject
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import internal.GlobalVariable as GlobalVariable
import org.openqa.selenium.Keys as Keys

WebUI.openBrowser('')

WebUI.navigateToUrl('https://jqueryui.com/datepicker/')

WebUI.click(findTestObject('Object Repository/pruebasRamdon/Page_Datepicker  jQuery UI/span_Prev'))

WebUI.click(findTestObject('Object Repository/pruebasRamdon/Page_Datepicker  jQuery UI/a_1'))

WebUI.closeBrowser()
  • Code please!!!!!! – Sudhansu Choudhary Sep 08 '18 at 19:27
  • I made a test from a ramdom web to discard it was my web.... But I could take the datepicker value WebUI.openBrowser('') WebUI.navigateToUrl('https://fengyuanchen.github.io/datepicker/') WebUI.click(findTestObject('Object Repository/pruebaDatePicker/Page_Datepicker/i_Demo_fa fa-calendar')) WebUI.click(findTestObject('Object Repository/pruebaDatePicker/Page_Datepicker/li_12')) WebUI.click(findTestObject('Object Repository/pruebaDatePicker/Page_Datepicker/span_startDate')) – Paola Godoy Sep 08 '18 at 20:52
  • The error message is saying that the element is not found. Maybe the xpath is wrong, but it's impossible to tell without the HTML code of your AUT. – Mate Mrše Sep 10 '18 at 06:22
  • How is `findTestObject('Object Repository/pruebasRamdon/Page_Datepicker jQuery UI/span_Prev')` defined? – Mate Mrše Nov 23 '18 at 11:55

0 Answers0