The online community for software testing & quality assurance professionals
 
 
Calendar   Today's Topics
Sponsors:
Lost Password?

Home
BetaSoft
Blogs
Jobs
Training
News
Links
Downloads



Testing Tools >> AutomatedQA / SmartBear TestComplete

Pages: 1
atoy
Newbie


Reged: 10/04/06
Posts: 7
"window is invisible and cannot be activated"
      #353010 - 01/16/07 10:52 AM

Recently upgraded from TC4 to TC5 and now receive the above error when clicking a button that is indeed visible and active. In fact, it is clicked via the same method earlier in my code (C#). There are multiple buttons of the same name on my form (only one is visible) but I am using the overloaded WinFormsObjectMethod to get it:
["WinFormsObject"]("ClrClassName", "WndCaption", index)
TC gets the right index but still attempts to click the wrong button (the invisible one).

Any ideas? Thank you.

Edited by atoy (01/16/07 12:55 PM)


Post Extras: Print Post   Remind Me!   Notify Moderator  
David_SmartBear
Junior Member


Reged: 05/12/04
Posts: 1203
Re: "window is invisible and cannot be activated" [Re: atoy]
      #353121 - 01/16/07 10:47 PM

Hi Atoy,

Could you please post the problematic code here? Also, please double-click the error in the log. TestComplete will open the script editor and highlight the exact line that produces the problem. Please point to this line in the script for me.

--------------------
Best regards,
David - SmartBear Support


Post Extras: Print Post   Remind Me!   Notify Moderator  
atoy
Newbie


Reged: 10/04/06
Posts: 7
Re: "window is invisible and cannot be activated" [Re: David_SmartBear]
      #353204 - 01/17/07 06:26 AM

Here are the two variations:

Sys["Process"]......("ButtonPanel")["LoginButton3"]["ClickButton"]();

Sys["Process"]......("ButtonPanel")["WinFormsObject"]("LoginButton", username, index)["ClickButton"]();

ClrClassName = LoginButton
WndCaption = username

Both variations worked in TC4 but give the same error in TC5

Thanks

Edited by atoy (01/17/07 06:27 AM)


Post Extras: Print Post   Remind Me!   Notify Moderator  
David_SmartBear
Junior Member


Reged: 05/12/04
Posts: 1203
Re: "window is invisible and cannot be activated" [Re: atoy]
      #353480 - 01/18/07 02:01 AM

Hi Atoy,

Unfortunately, this information cannot help us find the cause of the problem. Could you please send us the problematic application at support@automatedqa.com so we can reproduce the problem here and fix it?

--------------------
Best regards,
David - SmartBear Support


Post Extras: Print Post   Remind Me!   Notify Moderator  
atoy
Newbie


Reged: 10/04/06
Posts: 7
Re: "window is invisible and cannot be activated" [Re: David_SmartBear]
      #354803 - 01/24/07 09:17 AM

Thank you but that is unfortunately not possible. TC is either not reading the correct property value for the button or neglecting the 'index' argument in ["WinFormsObject"]("ClrClassName", "WndCaption", index) and clicking the wrong (invisible) button. As a workaround, I now re-enter the form to re-establish each object's properties.

Post Extras: Print Post   Remind Me!   Notify Moderator  
David_SmartBear
Junior Member


Reged: 05/12/04
Posts: 1203
Re: "window is invisible and cannot be activated" [Re: atoy]
      #355466 - 01/29/07 01:11 AM

Hi Atoy,

This is rather odd. Could you describe the behavior of the problematic form? Please tell me whether controls on the form are recreated dynamically without re-opening the form. I also need to know what the LoginButton control is. If it is a custom control, please create a simple application demonstrating the problem with this control and send it to us at support@automatedqa.com.

--------------------
Best regards,
David - SmartBear Support


Post Extras: Print Post   Remind Me!   Notify Moderator  
kyuen82
Junior Member


Reged: 06/26/02
Posts: 6
Loc: Honolulu, HI, USA
Re: "window is invisible and cannot be activated" [Re: David_SmartBear]
      #371811 - 04/09/07 09:53 PM

I am seeing the same behavior in TC 5.11.432.5
The first time the dialog gets displayed, the test script works. on subsequent test runs, I get the error that the window is invisible and cannot be activated.

this is java code and the recorded script is below. I get the error when I execute the w1.SwingObject... command. I will check with the developers tomorrow about building a test app that I can send to the TestComplete support group.

function Test1()
{
var w1;
w1 = Sys.Process("java", 2).SwingObject("TextFieldDialog", "Add Class", -1);
w1.SwingObject("JFormattedTextField", "", -1).Keys("runTest2");
w1.SwingObject("JButton", "OK", -1).Click(50, 8);
}


Post Extras: Print Post   Remind Me!   Notify Moderator  
David_SmartBear
Junior Member


Reged: 05/12/04
Posts: 1203
Re: "window is invisible and cannot be activated" [Re: kyuen82]
      #372025 - 04/10/07 07:02 AM

Hi,

Quote:

The first time the dialog gets displayed, the test script works. on subsequent test runs, I get the error that the window is invisible and cannot be activated.



Please tell me on which line the error occurs. You can check this by double-clicking the error in the log. TestComplete will open the script editor and highlight the needed line.

Quote:

I will check with the developers tomorrow about building a test app that I can send to the TestComplete support group.



Please send the sample application directly to us at support@automatedqa.com.

--------------------
Best regards,
David - SmartBear Support


Post Extras: Print Post   Remind Me!   Notify Moderator  
Robert MartinModerator
Super Member


Reged: 03/22/06
Posts: 1836
Loc: Pennsylvania, USA
Re: "window is invisible and cannot be activated" [Re: atoy]
      #372033 - 04/10/07 07:33 AM

I noticed you're passing the index to WinFormsObject as a variable that I'm assuming is being set elsewhere.

Depending upon the application, etc, the index isn't always the same from one run of the application to another. Or, for that matter, in each instantiation of the object in the application. For example, I have several places in my software where Sys.Process('MyApp').Window('TFormClass','My Caption', 1) might fail. There are probably several windows of type TFormClass, potentially even with the same windows caption. Usually, our developers destroy each instance after it's used so the index is always 1. However, in those cases where they don't, each time I open an instance of that form, the index changes.

Two suggestions:

1) Use an index of -1. This is the "wildcard" of the index on a window form and should generally be able to find any window. You might need to be more specific with things like WndCaption or some other indicator on the form to ensure you have the right form
2) Use an Open Application where all form objects are defined with names. That way you can avoid ambiguous calls to forms and just simply call them by the form name (such as Sys.Process('MyApp').MyForm.MyButton.ClickButton).

--------------------
-Robert Martin
Automated Testing Evangelists
TestComplete "expert"
Definition expert - noun - Unknown drip under pressure


Post Extras: Print Post   Remind Me!   Notify Moderator  
kyuen82
Junior Member


Reged: 06/26/02
Posts: 6
Loc: Honolulu, HI, USA
Re: "window is invisible and cannot be activated" [Re: Robert Martin]
      #372159 - 04/10/07 02:01 PM

I get the error on both w1.SwingObject commands

w1.SwingObject("JFormattedTextField", "", -1).Keys("runTest3");
w1.SwingObject("JButton", "OK", -1).Click(50, 8);

as for your advice Robert, Thanks.
I noticed the lack of an object name caused me problems in other parts of the app so modified the app, with dev manager approval, to add a name to all objects. i also let the developers know so they added a name to all screen objects they created.

I noticed in other parts of the app that the index changed. I had dev add a destructor to get rid of the process. Screen capture/object viewer shows the object has the same references for each run.


Post Extras: Print Post   Remind Me!   Notify Moderator  
kyuen82
Junior Member


Reged: 06/26/02
Posts: 6
Loc: Honolulu, HI, USA
Re: "window is invisible and cannot be activated" [Re: kyuen82]
      #372172 - 04/10/07 03:22 PM

problem solved. the developers added a dispose() on the base class. the code was creating multiple dialogs but the object names and such remained the same.

Post Extras: Print Post   Remind Me!   Notify Moderator  
Robert MartinModerator
Super Member


Reged: 03/22/06
Posts: 1836
Loc: Pennsylvania, USA
Re: "window is invisible and cannot be activated" [Re: kyuen82]
      #372343 - 04/11/07 05:45 AM

Those pesky developers...

...just kidding. Glad you got it working. Thanks for keeping us informed.

--------------------
-Robert Martin
Automated Testing Evangelists
TestComplete "expert"
Definition expert - noun - Unknown drip under pressure


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
0 registered and 12 anonymous users are browsing this forum.

Moderator:  NickAQA, Robert Martin, martinh, brentpaine 

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Topic views: 4417

Rate this topic

Jump to

Contact Us | Privacy statement SQAForums

Powered by UBB.threads™ 6.5.5