Is it possible to add an id='' or an attribute to a gridRow or a menu item element

1 Answer 38 Views
Grid
Amthony
Top achievements
Rank 1
Amthony asked on 21 Nov 2023, 03:52 PM

We use data-testids (an attribute) for our test automation.  It looks like on an internal component like buttons in popup boxes and rows in a grid that we can no longer add these.  Is there some way in KendoUI that we can add these tags for our automation testing.  KendoMenu items  is an example where we like to add them for each menu item that it seems like we can't

Thank You,
Anthony Rizzolo

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Konstantin Dikov
Telerik team
answered on 24 Nov 2023, 07:49 AM

Hello Anthony,

Currently it is not possible to set and id for the Menu items through the Menu nor the MenuItems configuration. Following is a full list of the supported item properties:

One thing that we can suggest is changing the rendering of the items and add an inner element containing the "data-testids" attribute:

The same applies to the Grid's rows, where you can override the row rendering and add the attribute in question:

Please note that the solution might differ per component and some components might not provide option for overriding the rendering, in which case a pure JavaScript solution after the rendering might be required.

Hope this helps.

 

Regards,
Konstantin Dikov
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Kendo family, check out our getting started resources

Amthony
Top achievements
Rank 1
commented on 27 Nov 2023, 01:53 PM

Thank you for the response and the suggestion...I will have the developers look at doing the inner-element to contain the data-testids...

 

Amthony
Top achievements
Rank 1
commented on 01 Dec 2023, 04:11 PM

Just wondering if it would be possible to add the ability to add attributes and id's to these elements for testing at some time in the future.  Thanks. 

Konstantin Dikov
Telerik team
commented on 05 Dec 2023, 06:19 AM

Hi Amthony,

You can log feature requests in our public feedback portal where other developers can vote for them and increase their priority:

Tags
Grid
Asked by
Amthony
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or