Unable to set text ‘test’ of object ‘Object Repository/New Folder/Page_New Case DIR Salesforce/input_71029a’

Hello, I am new to Katalon and I am getting this message when I try to enter the text in text box:

Unable to set text ‘test’ of object ‘Object Repository/New Folder/Page_New Case DIR Salesforce/input_71029a’ (Root cause: com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id: ‘Object Repository/New Folder/Page_New Case DIR Salesforce/input_71029a’ located by ‘By.xpath: id(“7:1029;a”)[count(. | //input[@type = ‘text’ and @id = ‘7:1029;a’]) = count(//input[@type = ‘text’ and @id = ‘7:1029;a’])]’ not found)

12-06-2018 12:35:35 PM - [FAILED] - Test Cases/New Test Case FAILED because (of) Unable to set text ‘test’ of object ‘Object Repository/New Folder/Page_New Case DIR Salesforce/input_71029a’ (Root cause: com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id: ‘Object Repository/New Folder/Page_New Case DIR Salesforce/input_71029a’ located by ‘By.xpath: id(“7:1029;a”)[count(. | //input[@type = ‘text’ and @id = ‘7:1029;a’]) = count(//input[@type = ‘text’ and @id = ‘7:1029;a’])]’ not found)

Here is my Script:
WebUI.click(findTestObject(‘New Folder/Page_Login Salesforce/input_Login’))

WebUI.click(findTestObject(‘New Folder/Page_Recently Viewed Cases Salesf/div_New’))

WebUI.setText(findTestObject(‘New Folder/Page_New Case DIR Salesforce/input_71029a’), ‘test’)

WebUI.setText(findTestObject(‘New Folder/Page_New Case DIR Salesforce/textarea_271029a’), ‘test’)

WebUI.click(findTestObject(‘New Folder/Page_New Case DIR Salesforce/html_New Case DIR Salesforce’))

WebUI.click(findTestObject(‘New Folder/Page_New Case DIR Salesforce/a_–None–’))

WebUI.click(findTestObject(‘New Folder/Page_New Case DIR Salesforce/span_Save’))

WebUI.closeBrowser()

Please try:

WebUI.click(findTestObject(‘New Folder/Page_Login Salesforce/input_Login’))
WebUI.click(findTestObject(‘New Folder/Page_Recently Viewed Cases Salesf/div_New’))

/* INSERT THIS LINE */
WebUI.verifyElementPresent(
    findTestObject(‘New Folder/Page_New Case DIR Salesforce/input_71029a’),
    10)

WebUI.setText(findTestObject(‘New Folder/Page_New Case DIR Salesforce/input_71029a’), ‘test’)
...

You should wait for new page to load before trying setting text into a field in the new page.

1 Like

Thank you for your response, Didn’t work.
Value/ID “input_71029a” is changing in run time to a dynamic number.
Can you help how to fix in object repository
image

If the value of @id is changing, then you should not rely on the @id to identify the element.

You need to find alternative way.

  1. Does has any attributes which is suitable for identifying itself? — seems not.
  2. Look at ancestor elements of the . Is there any ancestor elements which you can find a way to identify it firmly (with static @id, with static text(), etc)
  3. Look at preceding-sibling element of the . Is there any preceding-sibling elements which you can find a way to identify it firmly?

Simply saying, you need to look at wider range of HTML code, not just the element in question.