Forum Discussion
Hi,
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
- Adam16 years agoOccasional Contributor
Hello Alex,
Thanks for your reply. I found a solution with help from one of your collegues. When running TestComplete as administrator, it is possible to click on the buttons and execute the installer. So this would solve my problem.
Thanks for your help!
Kind regards, Arnout
- AlexKaras6 years agoChampion Level 3
Hi Arnout,
Thank you for the update of the thread and it is good to know that you already have a solution.
I am curious to find the explanation of the situation so could you answer these questions:
-- Is it correct that initially TestComplete was started on behalf of a regular user without any permissions elevation?
-- Is the tested installer started as a Tested Application (and thus it inherits permissions of TestComplete) or some other way?
-- Is UAC (User Access Control) window with the request to allow changes confirmation displayed on installer's start? Or UAC is disabled on this test system? If UAC is displayed, do you handle it manually or via some test code?
- Adam16 years agoOccasional Contributor
Hello Alex,
-- Is it correct that initially TestComplete was started on behalf of a regular user without any permissions elevation?
yes, that's correct
-- Is the tested installer started as a Tested Application (and thus it inherits permissions of TestComplete) or some other way?
yes, it's started as tested application
-- Is UAC (User Access Control) window with the request to allow changes confirmation displayed on installer's start? Or UAC is disabled on this test system? If UAC is displayed, do you handle it manually or via some test code?
UAC is disabled on this system. I don't know if this can be handled by TC
The answer that I get from your collegue:
"TestComplete likely needs additional permissions in order to automate actions over an installer. Installation of an application is not a standard task, additional security is implemented to prevent malicious applications from automatically installing applications.
Furthermore, I do not anticipate any conflicts executing your existing tests when running TestComplete as an administrator."Regards, Arnout
- AlexKaras6 years agoChampion Level 3
Hi Arnout,
Aha, thank you for your answers. They correspond to my idea and my current understanding is like this:
-- TestComplete was started with a regular set of permissions;
-- Installer was spawned with the same set of permissions;
-- While initializing, installer requested permissions elevation and got them automatically without any message been displayed because of disabled UAC;
-- The result of the above sequence is that TestComplete appeared to have lower level of permissions than the application it tried to control. This can result in different problems and your one well could be one of them. Some more description can be found here: https://support.smartbear.com/testcomplete/docs/general-info/configuring/testing-under-admin-account.html
Thank you for this case - I'll put it into my notes. :)
> UAC is disabled on this system. I don't know if this can be handled by TC
UAC has three levels - high, middle and low.
High level (default one) blocks display and cannot be handled using test automation tools.
Middle level will display a regular Windows dialog that TestComplete can handle.
Low level disables UAC and no message to the user is dislayed at all.
P.S.
> The answer that I get from your collegue
I am not employed by Smartbear as it is stated in my signature. I'm just a user of their products who like them and is willing to help others when I can. :)
- AlexKaras6 years agoChampion Level 3
Hi,
> If the button is transparent, how do I know this and how can I workaround this?
One of the possible cases is when the given button is overlapped by some other object that is either invisible or transparent. Considering that you are working with installer, I guess that the current button is overlapped with the identical button from the previous step.
To workaround this problem you may try to set the input focus to the button and then press a spacebar to click it.
Like this:
nextButton = w["Window"]("TNewButton", "&Next >", 1);
nextButton["SetFocus"]();nextButton["Keys"](" "); // space between quotes
Does this help?
- Adam16 years agoOccasional Contributor
From the license server installer that I am testing now separately this is the first step. I don't know how this button can be overlapped. I tried your workaround and the button got focus and there was keybord input, but this had no effect.
- AlexKaras6 years agoChampion Level 3
> the button got focus and there was keybord input, but this had no effect.
Hm-m-m... This is strange...
What if you try to execute the Alt-N keypress?
nextButton["SetFocus"]();
nextButton["Keys"]("~N");
P.S. You might need to wait until the button is enabled, before acting against it.
E.g.:
nextButton["WaitProperty"]("Enabled", true, 30000);
nextButton["SetFocus"]();
nextButton["Keys"]("~N");
P.P.S.
> From the license server installer that I am testing
Is the goal of your test to verify the UI of the installer? Or you just need to install the product? If the latter, then it is much faster and more reliably to do installation from the command line (via the WshShell.Run() call).
- Adam16 years agoOccasional Contributor
Unfortunately this also doesn't work.
The goal is testing the UI of the installer.
- AlexKaras6 years agoChampion Level 3
> Unfortunately this also doesn't work.
Any message in test log or on screen?
I would say this is more than starnge...
Out of curiosity, can you check that correct button object is addressed?
For example, assuming this test code:
nextButton = w["Window"]("TNewButton", "&Next >", 1); nextButton["SetFocus"](); nextButton["Keys"](" "); // space between quotes
can you set a breakpoint at the
nextButton["SetFocus"]();
line and when the execution stops on the breakpoint check the following:
-- Select installer's window and press Tab to move focus from Next button to some other control (guessing Cancel button);
-- Return to TestComplete and execute Step Over command;
-- Switch back to installer and check if the Next button got the focus;
-- If it does not, tehre are chances that wrong object is used. The quick check would be to execute this command from the Evaluate dialog: Sys.HighlightObject(nextButton). Upon execution, TestComplete should switch to installer and flash the button several times. Alternatively, you may use Object Spy and check current running properties of the button;
-- If the button gets the focus, try Step Over one more time and check if the button was clicked. If it is, it might be a timing issue and some delay may be required between setting focus to the button and clicking it.
Related Content
Recent Discussions
- 2 days agoGane195