Issue with Recording Span Arrow in Katalon Studio

Dear Katalon Community,

I’m facing a challenge while using Katalon Studio to automate a test case. The issue arises when trying to record a test step involving clicking on a span arrow within a box text element. Below are the error log:


=============== ROOT CAUSE =====================
Caused by: com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id: 'Object Repository/new cawangan/Page_Pengurusan Kes - NVIS  Jabatan Penilai_3e51c8/span_BBP-02-02-00-26 - LEMBAGA HASIL DALAM _80baf0' located by '//div[@id='a0e338d943d0-2']/span' not found
...

Additional Error Message:

Unable to find the element located by 'By.xpath: //div[@id='a0e338d943d0-2']/span'. Please recheck the object's properties to confirm the desired element is located.

Any insights or suggestions on how to successfully record the span arrow within the box text element would be highly appreciated.

Thank you!

1 Like

You need to look into the HTML source code of the target web page.

You need to check if the HTML source contains the <span> element which can be selected by the xpath //div[@id='a0e338d943d0-2']/span.

If you do not know how to see the HTML source code, then you should learn how to use the DevTool. See

Just I guess that the id attribute’s value: "a0e338d943d0-2" changes dynamically everytime the page is reloaded. If so, the xpath expression could never be valid.

Then how @nsyahirahzmi can solve his problem? How can he select the <span> element?

There could some alternatives. In oder to find his way, he needs to look at the HTML source and analyze it. The Recorder and Spy tools are helpless. These tools are not capable to give you any magical solution. It is only you, @nsyahirahzmi, who can solve your problem, as you haven’t shared the HTML of the target page to others.

In addition to @kazurayam’s discussion about identifying the element, there may be an issue of your script being too fast for your browser, especially if you are “recording”. For this, you need to add wait and maybe verify statements to your code to “stabilize” it from WebElementNotFoundException.

1 Like