How to capture the click event on the RadzenTab


We are testing the waters using Blazor vs Angular for one of our internal products - we want to change to Blazor. Anyway, one of the processes in our development is creating manual & automated testing on the app.
One of the tests we have requires clicking a tab from the automated test. In the Angular version there is a href="#" exposed in the html (using the dev tool of the browser F12) that can be captured and clicked (for the lack of a better term) in the automated test . We don't seem to have the option from what we can see. Is there a way to expose/capture/invoke a click event that can be used in our test apps? We are using Selenium & c# for manual testing and Highlander for automation testing.

Thanks for any help.

Hi @simsj,

There is still a however with href="javascript: void(0)":

Hello enchev,

I did notice the href="javascript: void(0)", however, all the tabs have the same href. There doesn't appear to be anything that differentiates them from each other and clicking the href doesn't seem to do anything. How do we do testing on the control? We will need to do unit testing on any of the other controls we use as well.


You can use other attributes to distinguish tabs. You can check the actual code what will happen if you click the tab:

I noticed the aria-selected attribute just before you responded this last time. I tried manually changing the selected one to false and the second tab to true it in the DevTools window of the browser but it had no effect. I also tried changing the class to "" on the one and to "rz-view-selected" on the other and while that does change the tab it doesn't change the page.

This is the RadzenTab structure we've implemented...

I’m afraid that this is not how you supposed to test the component - you should initiate browser click on the A element exactly as the user:

Thanks for your help enchev!