cancel
Showing results for 
Search instead for 
Did you mean: 

TestComplete sees my application as a black window

Community Hero

Re: TestComplete sees my application as a black window

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?

 

 

Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Postings made by [Community Expert Group] members
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================
Occasional Contributor

Re: TestComplete sees my application as a black window

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.

Community Hero

Re: TestComplete sees my application as a black window

> 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).

 

Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Postings made by [Community Expert Group] members
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================
Occasional Contributor

Re: TestComplete sees my application as a black window

Unfortunately this also doesn't work.

The goal is testing the UI of the installer.

Community Hero

Re: TestComplete sees my application as a black window

> 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.

 

 

Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Postings made by [Community Expert Group] members
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================
Occasional Contributor

Re: TestComplete sees my application as a black window

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

Community Hero

Re: TestComplete sees my application as a black window

@Adam1:

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?

 

Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Postings made by [Community Expert Group] members
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================
Occasional Contributor

Re: TestComplete sees my application as a black window

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

Community Hero

Re: TestComplete sees my application as a black window

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...

 

Thank you for this case - I'll put it into my notes. Smiley Happy

 

> 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. Smiley Happy

 

Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Postings made by [Community Expert Group] members
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================
2018 NEWS
Top Kudoed Authors