I have an automation project in C# that works with Microsoft Excel using WinAppDriver Release Candidate 1.2.
I have a case where I am attempting to get the number of rows that have been populated on a sheet with the code below.
public string GetLastCellBelowStartRange(string sheetName, string startRange)
{
var sheet = FindSheet(sheetName);
var nameBox = this.GetNameBox();
nameBox.SendKeys($"{sheetName}!{startRange}{Keys.Enter}");
this.excel.SendKeys($"{Keys.Control}{Keys.ArrowDown}");
var endCellRange = nameBox.GetAttribute("LegacyIAccessible.Value");
return endCellRange;
}
The code successfully goes to the last cell in the workbook and nameBox is known as well as the excel driver (i.e. this.excel).
I cannot determine how to get the contents of the current cell which Inspect shows in both Value.Value and LegacyIAccessible.Value.
Does anybody know of a way to do this?