We have a problem in Katalon Studio. Our customer is using Katalon Studio.
We have 3 buttons that have a unique id. But when I check the script mode all the 3 steps are clicking on the same button.
Why it i not taking the unique id? Instead it is taking the button text. And how can we solve this issue?
We don’t know anymore what to do. We also don’t have another option to select.
Here you can see the buttons from the development tools:
When I check the script mode he is given for every button:
WebUI.click(findTestObject(‘Object Repository/*** - _3c37a1/span_Opslaan’))
The *** to cover sensitive data
Katalon recorder do use everywhere the wrong XPATH as we think (when I check the settings locator tab).
(.//*[normalize-space(text()) and normalize-space(.)=‘Nee’])/following::span
When I check the tab attributes I have the choice between this:
I would recommend to your customer to stop using the Recorder & Spy tool. Because it is likely that the HTML of the target web page is coded in a way that makes the Katalon Recorder tool confused.
Please be advised that the Recorder & Spy tools are not necessarily capable of providing good TestObjects for you. It depends on the way how the target HTML source code is coded: whether it is coded friendly to the tools or not.
Your customer wants to create 3 Test Objects manually as follows:
In my humble opinion, provided that you are skilled enough for HTML and XPath/CSS Selector technologies, it is often easier to create test objects with appropriate locators manually than struggling with the tools. The tools can not automatically infer what you want them to do.
Please note that this button element has no child <span> elements. In this case, when you operate the Recorder, you will give a click event to the <button> element, and the tool will generate following locator:
However, actually your HTML has different structure as this:
Please note that a <span> element is contained in the <button> element. When you operate the Recorder tool, open the page in browser, you will give a click event to the <span>Opslaan</span> element, not to the parent <button> element.
The Recorder is designed, I think, to generate a locator which points the element that received your click event. So the generated locator will be like this:
The Recorder tool is not capable to generate a locator for the parent button element automatically & intelligently .
Your target HTML has a structure too difficult for the Recorder tool to generate a good locator (= a good Test Object) that you really want. The tool is tricked by the HTML structure of your target web page.
In this difficult case, you should create Test Objects manually. It is far easier than struggling to force the tool behave as you like.