Script: yesterday ok, today not

Hi folks,
I have this script, yesterday the test works without problems, today the script is the same and doesn’t work, it returns this error. why does it not work overnight?

“Unable to click on object 'Object Repository/SS - Crea da modello/Page_C S/button_modello 3”

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 com.kms.katalon.core.webui.common.WebUiCommonHelper as WebUiCommonHelper
import org.openqa.selenium.WebElement as WebElement
import internal.GlobalVariable as GlobalVariable

WebUI.openBrowser(’…’)

WebUI.setText(findTestObject(‘Page_C/input_Ho dimenticato la password_username’), ‘user@users.com’)

WebUI.setEncryptedText(findTestObject(‘Page_C/input_Ho dimenticato la password_password’), ‘IHAN0FZoCZUE6vb15qGNUQ==’)

WebUI.click(findTestObject(‘Page_C/button_Entra’))

WebUI.click(findTestObject(‘SS - Crea da Modello/Page_C S/button_Modelli’))

WebUI.click(findTestObject(‘SS - Crea da Modello/Page_C S/button_modello 3’))

WebUI.click(findTestObject(‘SS - Crea da Modello/Page_C S/button_Crea spedizione’))

WebUI.click(findTestObject(‘SS - Crea da Modello/Page_C S/button_OK’))

Hello,

we don’t know your AUT, but I’d advice to add few waitForElementClickable/Present keywords.

Hi, i’d tried but doesn’t work, the error is the same and yesterday work ok

during the execution, katalon click a different element, why?

If its clicking on a different element, use JS to perform the click or check your locators are correct (xpath, css etc)

import com.kms.katalon.core.webui.common.WebUiCommonHelper
 
WebElement element = WebUiCommonHelper.findWebElement(findTestObject('your/object'),30)
WebUI.executeJavaScript("arguments[0].click", Arrays.asList(element))
1 Like

thanks, bu now “java.lang.NullPointerException”

Do you know if this element is OK?

Can you show the html page (in the button part) and the Object Repository value for this Object?