Forum Discussion
The error indicates that the object wasn't ready for interaction at the time the action was attempted. The test log often includes a screenshot, which can provide helpful visual context on the state of the UI at the failure point. https://support.smartbear.com/testcomplete/docs/testing-with/running/handling-errors/searching-for-cause.html
Here are a few targeted suggestions:
- Use VisibleOnScreen and Enabled Together along with Width and Height
if (obj.VisibleOnScreen && obj.Enabled && obj.Width > 0 && obj.Height > 0) {
obj.Click();
} else {
Log.Error("Object is not intractable at this time.");
}
You can also configure https://support.smartbear.com/testcomplete/docs/working-with/managing-projects/properties/visualizer.html or https://support.smartbear.com/testcomplete/docs/reference/test-objects/controls/misc/options/index.html Visualizer to capture object info
// Set the option to "Capture images and test object info"
Options.Visualizer.CollectMode = vcmImg;
🤖 AI-assisted response.
💬 Found the answer helpful? Give it a Kudos by clicking Like!
✅ Got your issue resolved? Click Mark as Solution so others can find it quickly.
Hi Hassan,
Thank you for you reply. I tried the following code as you suggested:
function test2()
{
var WA = Sys["Process"]("AXISEL")["WinFormsObject"]("MainForm")["WinFormsObject"]("splitContainer1")["WinFormsObject"]("SplitterPanel", "", 1)["WinFormsObject"]("NavigationBar")["WinFormsObject"]("WorkAreaView")["WinFormsObject"]("TV")["OutlineItem"]("TestComplete Work Area 1*");
WA["Refresh"]();
Delay(1000);
Log["Event"](WA.VisibleOnScreen);
Log["Event"](WA.Enabled);
Log["Event"](WA.Width);
Log["Event"](WA.Height);
WA["WaitProperty"]("VisibleOnScreen","True",2000);
if (WA.VisibleOnScreen && WA.Enabled && WA.Width > 0 && WA.Height > 0)
WA.Click();
else
Log.Error("Object is not interactable at this time.");
}
So at the time of clicking the object, the width and height is 0 and the property VisibleOnScreen is False, even though I can see the object on screen. After using Refresh method on the object multiple times, I can click the object. I tried using WaitProperty method as shown above in the code, but no use.