Skip to main content
All docs
V24.2
.NET Framework 4.6.2+

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

IEasyTestGrid.GetRows(String[]) Method

Returns a dictionary that contains all visible grid records and their indexes.

Namespace: DevExpress.EasyTest.Framework

Assembly: DevExpress.EasyTest.v24.2.dll

NuGet Package: DevExpress.EasyTest

#Declaration

IReadOnlyDictionary<int, string[]> GetRows(
    params string[] columnNames
)

#Parameters

Name Type Description
columnNames String[]

Names of columns whose values are returned.

#Returns

Type Description
IReadOnlyDictionary<Int32, String[]>

Row values across with their indexes.

#Remarks

Example:

using System;
using System.Linq;
using DevExpress.EasyTest.Framework;
using Xunit;

[assembly: CollectionBehavior(DisableTestParallelization = true)]

namespace MainDemo.E2E.Tests {
    public class MainDemoTests : IDisposable {
        const string BlazorAppName = "MainDemoBlazor";
        const string WinAppName = "MainDemoWin";
        const string MainDemoDBName = "MainDemo";
        EasyTestFixtureContext FixtureContext { get; } = new EasyTestFixtureContext();

        public MainDemoTests() {
            FixtureContext.RegisterApplications(
                new BlazorApplicationOptions(BlazorAppName, 
                    @$"{Environment.CurrentDirectory}\..\..\..\..\MainDemo.Blazor.Server"),
                new WinApplicationOptions(WinAppName, 
                    @$"{Environment.CurrentDirectory}\..\..\..\..\MainDemo.Win\bin\EasyTest\MainDemo.Win.exe")
            );
            FixtureContext.RegisterDatabases(
                new DatabaseOptions(MainDemoDBName, "MainDemoDB", server: "(localdb)\\mssqllocaldb"));
        }
        public void Dispose() {
            FixtureContext.CloseRunningApplications();
        }

        [Theory]
        [InlineData(BlazorAppName)]
        [InlineData(WinAppName)]
        public void EditGridData(string applicationName) {
            FixtureContext.DropDB(MainDemoDBName);
            var appContext = FixtureContext.CreateApplicationContext(applicationName);
            appContext.RunApplication();
            appContext.GetForm().FillForm(("User Name", "Sam"));
            appContext.GetAction("Log In").Execute();

            appContext.Navigate("Tasks");
            var allRows = appContext.GetGrid().GetRows("Subject", "Status", "Priority");
            Assert.Equal(4, allRows.Count);
            Assert.Equal(new string[] { "Fix breakfast", "Completed", "Low" }, allRows[0]);
            Assert.Equal(new string[] { "Review reports", "In progress", "High" }, allRows[1]);
            Assert.Equal(new string[] { "Task1", "Completed", "High" }, allRows[2]);
            Assert.Equal(new string[] { "Task2", "Completed", "Low" }, allRows[3]);
        }
    }
}
See Also