Skip to content

[BUG] Sub-grid command is not found when it is in the overflow menu #980

Description

@ewingjm

Bug Report

EasyRepro Version

  • Microsoft Dynamics 365 Online Version 9.1 (9.1.x) (DB 9.1.x) online

UCI or Classic Web

  • UCI (XrmApp)

Online or On Premise

  • Online

Browser

  • Chrome

Describe the bug

When a sub-grid command is in the overflow menu, ClickSubGridCommand() is unable to find it.

Code to reproduce

XrmApp.Entity.SubGrid.ClickCommand(subGridName, commandName);

-->

Expected behaviour

The sub-grid overflow menu button should be clicked followed by the command in the overflow menu.

Screenshots

image

Attempting to click a command other than the three shown will result in the exception:

No command with the name '' exists inside of '' CommandBar.

Additional context

I believe the following code to be the issue -

//Is the button in More Commands Overflow?
if (items.Any(x => x.GetAttribute("aria-label").Equals("More Commands", StringComparison.OrdinalIgnoreCase)))
{
    //Click More Commands
    items.FirstOrDefault(x => x.GetAttribute("aria-label").Equals("More Commands", StringComparison.OrdinalIgnoreCase)).Click(true);
    driver.WaitForTransaction();
...

When I inspected the HTML for the sub-grid, the aria-label attribute value was More commands for <entity display name> rather than More Commands. Perhaps More Commands is for a control that isn't a standard read-only grid? I would suggest changing this to a StartsWith check to avoid a breaking change.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions