Iterating through the ContextMenu to GetValues
Posted: Mon Mar 26, 2018 3:43 pm
Hi,
I am trying to iterate through the ContextMenu and too read out Text values from the items and to store them. So far I have managed this:
IList<Ranorex.ContextMenu> contextList = contextRepoItem.CreateAdapters<Ranorex.ContextMenu>();
foreach(Ranorex.ContextMenu item in contextList)
{
string captionString = item.Element.GetAttributeValueText("Text");
//write new line to csv
propTableRowsCSV.Add(new string[]{captionString});
item.MoveTo();
Ranorex.Report.Screenshot(item);
Ranorex.Report.Info(captionString);
Ranorex.Delay.Milliseconds(200);
}
//save CSV connector to file
csvConnector.StoreData(propTableColumnsCSV, propTableRowsCSV);
}
It opens ContextMenu which contains five elemnts inside but no value is taken and it does not iterate through the list. In the end I get only screenshot from the ContextMenu ( list ). And yes not even the first value is stored to the CSV. Any assistance would be appreciated
I am trying to iterate through the ContextMenu and too read out Text values from the items and to store them. So far I have managed this:
IList<Ranorex.ContextMenu> contextList = contextRepoItem.CreateAdapters<Ranorex.ContextMenu>();
foreach(Ranorex.ContextMenu item in contextList)
{
string captionString = item.Element.GetAttributeValueText("Text");
//write new line to csv
propTableRowsCSV.Add(new string[]{captionString});
item.MoveTo();
Ranorex.Report.Screenshot(item);
Ranorex.Report.Info(captionString);
Ranorex.Delay.Milliseconds(200);
}
//save CSV connector to file
csvConnector.StoreData(propTableColumnsCSV, propTableRowsCSV);
}
It opens ContextMenu which contains five elemnts inside but no value is taken and it does not iterate through the list. In the end I get only screenshot from the ContextMenu ( list ). And yes not even the first value is stored to the CSV. Any assistance would be appreciated