While recording the script the recorder is identifying the object by the text displayed in the object (like values in the dropdown).
There is a method “selectOptionByValue”. If there is something to choose by ID then it will be helpful.
Please find the Recorded Script -highlighted object identification Name
In my application, I will be loading dropdowns based on values from database and not all the time the same text will appear.
So please let me know if I can make the recorder to take only ID and NAME attributes of the HTML elements and not text value inside the elements.
You can eliminate the text attribute from attributes that the recorder will use to identify objects.
Project → Settings → Test Design → Web Locators.
Under Attributes option, you can check/uncheck attributes that are appropriate for your testing purposes.
Is this what you’re looking for ?
No, My Actual problem is generated Object Repository name .
For our requirement , we need generated object Repository name should be a based on the id attributes.
In attached screenshot , Please find the highlighted(default generated ) object Repository name-select_–Select–AC-Maintanenc for select Dropdown field.
- The mentioned naming convention is risky to identify for us, because in my application screen , we are handling with multiple drop down fields. So, we need object Repository Name should be generate based up on id attribute
Expected Object Repository Name:select-Ddl_Category
FYR, Please find the screenshot:
Actual Object Repository Name(By Katalon):select_–Select–AC-Maintanenc
Kindly , suggest me how to handle this in Real time.
Unfortunately the naming convention of Katalon Studio isn’t customizable, I have added into our back log and we will discuss among our team.
Thanks for your suggestion. we are looking forward for your Response to achieve the same.
Can you let us know why you want test objects to be named like that (by ID or Name)?
At this moment, do you manually rename your test objects or just let it be?
Thanks and Best regards,
I am loading the values to my control dynamically from Database. The value will not be same while recording and while playback. I may use the same script for different databases with different values.
If any object is identified only by value then it will not work for other database.
Please let me know if there are any means to record the object using attributes like ID or NAME.
With Thanks and Regards,
Please let us know if there is any possibilities or update for above posted query?
Hi @YoungNgo and @ThanhTo,
Ability to configure the names of the objects would be very useful feature because right now, Katalon names the objects based on their texts. However, this is causing us not to be able to differentiate the objects easily. As a result, we get duplications of the same object in different test cases. This makes the maintenance of the test case more time consuming. Let’s say if some attributes of an element are changed, we currently have to go and find all duplications of the same object and update the object in the object repository. However, if we were able to use IDs in the object name, finding the object would be much easier and everyone in the team would be using the same naming convention. As a result, it would take us much less time to maintain the test cases.
I see that the GitHub bug is closed. Have you decided not to implement this feature? Should we expect to get this feature in the coming releases or not?
Thanks in advance,
Hi @YoungNgo and @ThanhTo,
I have quite same need than miman,
I have a simple example with my web application.
I have a lot of screens having a button ok which is named by default “button_ok.tc” by Web recorder.
The problem is that web recorder automatically merge objects having same name , and so when I record a second use case on another screen which also click on an OK button, it proposes to merge my ok button which have totally different xpath, even if their html id is different.
So my older use cases are broken because Katalon changes xpath of “ok_button.ts”
So be able to name object with their ID would allow me to save the time I take to rename objects manually, just in order to to prevent recorder to merge it with another one.
And furthermore, html ID would be much more usefull for me to recognise object than default names as : button_OK, button_cancel, div_0, div_1, …
It is unfortunate that you cannot configure this.
I am creating test cases for different pages and they use the same process:
- Navigate to URL
Click link in left nav
When I customize the object names for the login page, eg: Button - Login, Input Box - Username, Input Box - Password, how do we keep it when creating new test cases?
My main goal would be to have the names generate how I want it to: -|
Example: HTML Type = Input, ID = Password, then Object name should be: “Input - Password”