Auto-generate unique names for widgets to improve test automation
76
Views
10
Comments
New
Service Studio

Challenge: Currently, widgets in Service Studio don't have names by default. Developers typically only assign names when they need to manipulate widgets in business logic.

However, widget names are essential for test automation because when a name is defined, the generated HTML element ID includes a static part (based on the widget name) alongside the dynamic part. This static portion can be used as a reliable selector in test scripts.

Without named widgets, HTML element IDs are entirely dynamic, making test automation scripts fragile and prone to breaking whenever screen changes are made. This forces QA teams to constantly update test selectors.

Proposed Solution: Auto-generate unique default names for widgets within each screen (e.g., Button1, Button2, Input1, Table1). This would:

  • Provide stable HTML element IDs for test automation without requiring manual developer effort
  • Make test scripts more robust and maintainable
  • Reduce the time spent fixing broken tests after UI changes
  • Improve overall application testability out-of-the-box

Trade-offs: This would make the HTML slightly more verbose, but the impact would be minimal compared to the significant benefits for test automation and quality assurance workflows.

This is one of those Ideas, I am 100% sure it must exist already as it is so obvious to have this. Turns out nobody posted it before.

Thank you for the contribution, this is such a fundamental and essential point. I really hope it gets implemented. 

I am not a QA, but you idea caught my attention. 

I do find your idea valid, however, I think it is better to add a QA mode, so that the testers could using any automated scripts to test the application.

While, providing the developers with the current naming system, to customize the project to their needs.

Thanks for sharing this idea Luis. Hope it is implemented in the future.

Thanks for raising this idea!

I’m fully aligned with the suggestion — automatic naming conventions for UI widgets would bring consistency and clarity, especially in large applications with many elements.

Also, I believe this ties into a complementary idea: 

Auto-Generate Unique Names for Widgets to Improve Test Automation

 That one focuses specifically on test-automation, but together they reflect the same underlying need: making widgets easier to identify, manage and automate.

Looking forward to seeing both features implemented.

Merged this idea with 'Auto Naming Convention for UI Widgets in OutSystems' (created on 19 Nov 2025 06:25:34 by Peter Hieu)

When dragging and dropping widgets onto the screen in Service Studio, the platform currently gives generic names like Button1, Input1, TableRecords1, etc.

This idea proposes that OutSystems automatically generate meaningful names for UI widgets based on:

  • The widget type (e.g. Button, Input, ListRecords, Dropdown)

  • The label or placeholder text associated with the widget

  • A convention/prefix per widget type (e.g. btn_, inp_, list_, ddl_, etc.)

💡 Example:

  • A Button with label “Submit” → suggested name: btn_Submit

  • An Input with placeholder “Email” → inp_Email

  • A ListRecords showing products → list_Products

  • A Checkbox labeled "Accept Terms" → chk_AcceptTerms

✅ Benefits:

  • Saves time by reducing manual renaming

  • Improves consistency and code readability

  • Makes screen actions and widget references easier to understand and maintain

  • Helps enforce naming conventions across teams

  • Enhances developer productivity, especially in large teams or fast-paced projects


I am not sure about the necessity of this idea, as I do not usually need to name every element in the widget tree, and OutSystems do this to an extend with inputs for example, when binding the variable to it.

However, I think you should change your idea's category to "service studio", as it affects the developers while developing their application.

Hi @Mustafa Emad Shaker 

Thanks for the feedback!
You're right — this idea is more related to the developer experience inside Service Studio.
I agree the category would fit better under Service Studio, since the auto-naming convention directly impacts how developers work with widgets during application development. 

Please before posting check if an idea exist. Similar post was 2 days ago. I will merge your's in it.

Hi @Luís Rondão ,

I usually do it like this and the automated tests query by [data-test-id="x"]