microsoft / EasyRepro

Automated UI testing API for Dynamics 365
MIT License
514 stars 286 forks source link

Get grid items not working in case more than one grid is on the page #113

Closed mariana58 closed 6 years ago

mariana58 commented 6 years ago

get grid items should be handled by grid id, it gets the items of the first grid

TYLEROL commented 6 years ago

Hello @mariana58 - Could you share a sample of your code / test steps in which you are using to call the GetGridItems() method?

I'll review the scenario and report back accordingly.

Thanks! Tyler

MDendura commented 6 years ago

It would be useful to be able to select a subgrid from the form by name, as I'm facing the same problem on the default System User form.

Here's the form I'm testing with: systemuser form

You can see there's a couple of subgrids on this form.

And here's the code from one of my tests:

[TestMethod]
public void Verify_UserQueues()
{
    using (var xrmBrowser = new Browser(BrowserOptions))
    {
        xrmBrowser.Navigation.OpenSubArea("Settings", "Security", 1000);

        xrmBrowser.Administration.OpenFeature("Users");

        xrmBrowser.Grid.Search("Matt Dendura");

        xrmBrowser.Grid.OpenRecord(0, 1000);

        xrmBrowser.Entity.SelectSubgridLookup("PrivateQueuesSubGrid");

        // BUG: This next line gets me back items from the teams grid, rather than the queues one.
        IEnumerable<string> queueNames = xrmBrowser.Grid.GetGridItems().Value.Select(q => q.GetAttribute<string>("name")).ToList();

        CollectionAssert.AreEquivalent(queueNames, this.ExpectedQueues);
    }
}

Perhaps there is a way to select the queues subgrid by name that I have missed.

EDIT: Also worth nothing that I'm testing against Dynamics 365 Online Version 1612 (9.0.2.449) (DB 9.0.2.438)

TYLEROL commented 5 years ago

@mariana58 - After reviewing @MDendura's related issue posting, we believe we have a better understanding of your issue which is a missing feature enhancement.

I've added an item to our backlog to add this feature enhancmenet which would allow usage of GetGridItems with subgrids on an entity form. The current intended design of the GetGridItems() method is for use with an entity grid (the stage prior to open a record form).

If we've misunderstood, please let me know and we're happy to re-evaluate your scenario.

Best Regards, Tyler