WPF: Testing a Context Menu

1 Answer 24 Views
Test Recording WPF Testing
Richard
Top achievements
Rank 2
Iron
Veteran
Iron
Richard asked on 08 Dec 2023, 02:47 PM

When trying to record a test, interacting with the Context menu doesn’t seem to be captured in the record steps. Are there any tips for testing Context Menu options?

 Thanks,
Richard

Elena
Telerik team
commented on 11 Dec 2023, 11:45 AM

Hello Richard,  

When saying that the steps are not captured do you mean you tried to click over the elements from the context menu, or you attempted to use the highlighting menu and add steps through it? 

Thank you for your cooperation in advance.

Richard
Top achievements
Rank 2
Iron
Veteran
Iron
commented on 11 Dec 2023, 12:17 PM | edited

Hi Elena, thank you for responding. 

I have attached an example recording. Here the right click is captured and the final click is captured but the navigation through the sub-menus of the context menu is not. 

When this test is replayed it doesn't navigate the context menu to click the relevant actions.

I can't seem to upload .mp4 files,  I have attached it as a zip

Thanks,

Richard

1 Answer, 1 is accepted

Sort by
0
Elena
Telerik team
answered on 11 Dec 2023, 03:55 PM

Hello Richard,

Thanks for sharing the video - that was really helpful for me. 

So, the click actions on the items in the context menu are captured as expected. The rest of the actions are to hover over an element from the menu so that the next sub-menu appears. One option to try will be to enable the element highlighting in recording mode and try to add that step through the quick steps menu.

I have to say, though, that this might not work out of the box depending on the specific context menu - if it disappears when it is not on focus, once you enable the highlighting you will not be able to interact with the context menu because of the tested application, because the recorder quick menu takes the focus. 

If this is the case then you will need to use a workaround which is as follows:

  1. In recording mode open the context menu - the right click gets recorded, so no changes here.
  2. Then click on the option from the menu which opens the desired submenu - this adds a click step and the element into the project.
  3. That element now can be used to add a step from the Step Builder - the Hover over step is under the Mouse Actions submenu. 
  4. Once you added the Hover over step, you can delete the recorded click one.
  5. I will recommend to also insert a wait for visible step before the Hover Over one - this type of step is under the Verification section. And you might need to change its role to wait. That way you ensure that the option is highlighted when it is visible on screen. 
  6. Step 2. to 5. needs to be repeated for all options from the context menu which are hovered until you get to the option to click on. 

I hope that these notes will help you adjust the steps in the test. Let me know if you need additional assistance on the case.

Thank you for your cooperation once again.

Regards,
Elena
Progress Telerik

Virtual Classroom is the free self-paced technical training portal that gets you up to speed with Telerik and Kendo UI products including Telerik Test Studio! Check it out at https://learn.telerik.com/.
Tags
Test Recording WPF Testing
Asked by
Richard
Top achievements
Rank 2
Iron
Veteran
Iron
Answers by
Elena
Telerik team
Share this question
or