Forum Discussion
YMinaev
Staff
16 years agoHi,
Let me interpret the situation you have. If I understand you correctly, you have two buttons with the same 'Import' caption, but with different WPFControlIndex values, and for some reason, you don't want to create a separate mapped object for the second Import button. So, you are trying to use the same mapped object for both buttons by changing the mapping criteria.
In this scenario, the best solution is to obtain the needed button from script using the FindChild method. Replace dummy values in angle brackets with actual values.
Let me interpret the situation you have. If I understand you correctly, you have two buttons with the same 'Import' caption, but with different WPFControlIndex values, and for some reason, you don't want to create a separate mapped object for the second Import button. So, you are trying to use the same mapped object for both buttons by changing the mapping criteria.
In this scenario, the best solution is to obtain the needed button from script using the FindChild method. Replace dummy values in angle brackets with actual values.
var PropArray, ValuesArray, p, w;
PropArray = new Array("NativeClrObject.Name", "WPFControlIndex");
ValuesArray = new Array(<the property value>, 1);
var btn = <parent form>.FindChild(PropArray, ValuesArray, 100);
btn.Click();