Forum Discussion
tristaanogre
16 years agoEsteemed Contributor
The problem is that you're checking for the value of a property on an object that may not exist yet. So, you should be checking for Exists AND VisibleOnScreen. Additionally, I'm not sure the context of your code, but it looks like you're calling BtnConfirmOverWriteYes and the other buttons without making a call to say what the button is. For example, I was expecting to see something like (pseudocode)
Without the reference to the parent component, that may also be contributing to the "object not found".
There are help topics on how to check for the existence of an object in the TC help but essentially, what you'll do is like this (DelphScript... I don't write Java.. yet)
Hope this helps point you in the right direction.
Set MyTestApp = Sys.Process('MyApp');
Set MyTestForm = MyTestApp.MyForm;
if MyTestForm.BtnConfirmOverWriteYes;
Without the reference to the parent component, that may also be contributing to the "object not found".
There are help topics on how to check for the existence of an object in the TC help but essentially, what you'll do is like this (DelphScript... I don't write Java.. yet)
procedure Test1;
var
MyTestApp;
MyTestForm;
TestButton;
begin
MyTestApp := Sys.Process('MyApp');
MyTestForm := MyTestApp.MyForm;
TestButton := MyTestForm.WaitVCLObject('BtnConformOverWriteYes', 10000);
if TestButton.Exists and TestButton.VisibleOnScreen then
TestButton.ClickButton;
end;
Hope this helps point you in the right direction.