I am having a issue with automating my desktop app. Here I am trying to click on a cell . steps are to first double click on the cell[Text] and then single click on the same cell[Text]. The problem I am facing is , the double click works fine , but for the single click the cursor moves to the top left and clicks.
Tried, turning off the cache, and waiting between the two clicks but didn't work.
Please note that the text box trying to access is not in the repo, the code looks like below:
Code: Select all
public static void editId(int iWay, string sPhase,string sId, int iSubId) {
IList<Unknown> items = ProDesign.Panel.Box.Children; // please note unknow here actually belongs to the element class
for(int i = 0; i< items.Count;i++) {
Element item = items[i];
Text cell2= item.FindSingle("//element[@automationid='Cell_"+i+"_2']/text");
Text cell3= item.FindSingle("//element[@automationid='Cell_"+i+"_3']/text");
Text cell4=item.FindSingle("//element[@automationid='Cell_"+i+"_4']/text");
if(iWay.ToString().Equals(cell2.TextValue) && sPhase.Equals(cell3.TextValue)) {
cell4.DoubleClick();
Delay.Milliseconds(1000);
cell4.Click();
break;
}
}
PopupHelper.editIdAndSubId(sId, iSubId);
}