I have encountered a problem with Test Complete and an application under test. The window I am attempting to perform actions in is displayed as a black screen when using Object spy.
If I attempt to record a test in this window no actions are recorded by TestComplete. I have written a script to click on screen co-ordinates within the window, and even though the co-ordinates are correct the click action does not appear to be carried out in the window.
I have managed to OCR the button I am attempting to click on using a Script and TestComplete does return the correct text, so it must be able to see the screen when doing this.
Have any of you ever encountered a window that TestComplete cannot perform actions on and how did you work around this?
Thanks in advance
The "black window" is not related to being unable to find the object. Basically, if the component is obscured on screen by some other window or scrolled off the screen, in the Object Browser, the preview of the object will show as a black box.
Some more information will be useful:
1) What kind of application/window is this?
2) Can we have screenshots of the screen in question?
3) Can we have screenshots of the object browser displaying the properties of the object in question?
I have the same problem. My tested application is displayed in object tree as a black window. As far as I can see the component is not obscured on screen by some other window or scrolled off the screen. Testcomplete is not able to click on this window.
The application is a TApplication. I don't know if this has to do with it, but maybe worth mentioning.
Have any of you encountered this problem?
Thanks in advance.
> My tested application is displayed in object tree as a black window.
Can you post a screenshot that demonstrates the problem?
What you're experiencing is correct... when TestComplete is in the foreground and your application is behind it, TestComplete cannot get an "image" of your control so it shows up black. When you move your application to the foreground, sure it shows up, but now TestComplete does not have focus so the Object Browser doesn't refresh.
If you were using two monitors and had TestComplete in one monitor and your application in another, this will work.
Truthfully, the image in the Object Browser has no functional effect on your tests. It's simply there to allow you to be able to visually verify the componet.
Thanks for your reply. However, my application is in the foreground, but testcomplete is still waiting till the window is activated and/or the window is overlapped, and is unable to click on the windowbutton. I tried this with two monitors, also tried to activate the window, but without success.
var p, w; p = Sys["Process"]("rsoft_scl_install", 4); w = p["Window"]("TWizardForm", "Setup - Synopsys Photonic Solutions Licensing Version 2018.12", 1);
w["Click"](320, 370); //click somewhere on the window, works
nextButton = w["Window"]("TNewButton", "&Next >", 1);
nextButton["Click"](); //does not work
That is not related to it showing as "black". What you've described is a windows recognition error. The object in question (the Next button) is not available to be clicked on. Something needs to be done better in identifying your objects in your code so that you can properly wait for them.
I see that the process has an index of "4". That's pretty strange. Here's my guess.... that because there are multiple processes for the install shield, that the windows are "jumping". The index on a process is not "static". It will shift and change, in my experience. So, while you are starting your code with the process with index 4, when you get to where the button is, that process may no longer be the one that has focus on the screen.
I would look into using "WaitWindow" for identifying the button... make sure that it is present and available for clicking. But, generally, that's your problem. Has nothing to do with it being "black" in the object browser.
I would also look into utilizing NameMapping. As I indicate above, you're using a pretty old methodolgy for defining your process and your windows. NameMapping has some better recognition features, some abilities to do a more refined object identification, and has some built in "wait" functionality for timing issues.
In addition to Robert's reply:
> nextButton["Click"](); //does not work
What exactly does not work? Any error in test log? If yes, what is the text of the error message?
If there is no error in the test log, then do you see mouse pointer been hovered over the button during test run?
Thanks for your reply. You are right, there are 4 processes with the same name. But the window is always part of the process with index 4, I have checked.
I tried the waitwindow method, but that did not help. I have checked that the window is visible, also the next button is visible and enabled, but cannot be clicked. I got the following error message: “There was an attempt to perform an action at point (37, 11) which is transparent or out of the window bounds.” If the button is transparent, how do I know this and how can I workaround this?
I also noticed that testcomplete was waiting until the overlapped window became visible.
You said that I am using an old methodology for defining my process and windows. Is this a problem in this case? Can you tell me how long this methodology will be supported? Is it recommended to change this in my tests?
Thanks in advance