Forum Discussion
Hi Philip,
As far as I understand, you are using Developer Express grid controls. We created a similar application which uses two lookup controls and reproduced the problem on our side. The problem is that there are two lookup grid controls on the same level of objects hierarchy, and therefore, TestComplete is using an index to identify them. However, the grid control which was activated last gets index 1 assigned due to the controls' implementation. Therefore, the new lookup grid is identified as the old one. Here is the script which demonstrates how you can avoid the problem:
function Test5()
{
var TestApp;
var gridControl;
var gridControl2;
TestApp = Aliases.TestApp;
gridControl = TestApp.MainForm.xtraTabControl.XtraTabPage.AddRemoveModifyMapContents.gridMapContents;
gridControl.ClickCellXY(0, "ArticleType", 104, 13);
TestApp.PopupGridLookUpEditForm.RefreshMappingInfo(); // IMPORTANT
gridControl2 = TestApp.PopupGridLookUpEditForm.GridControl;
gridControl2.ClickCellXY(1, "Type Name", 67, 6);
gridControl.ClickCellXY(0, "Product", 59, 11);
TestApp.PopupGridLookUpEditForm.RefreshMappingInfo(); // IMPORTANT
gridControl2.ClickCellXY(0, "Product Name", 69, 10);
}
Note that you need to call the RefreshMappingInfo method before retrieving each of the lookup grid controls - this will make TestComplete refresh the reference.
Related Content
Recent Discussions
- 2 days agoGane195