Ask a Question

Switch TestComplete's focus among processes

SOLVED
m_essaid
Valued Contributor

Switch TestComplete's focus among processes

Hi,

 

I have 2 processes that opens 2 forms side by side. Visualy, there isn't a form that overlaps another.

I have to focus on the left form, but it says :

 

Unexpected window: 'theRightForm'

 

So before acting on this form i'm trying to set the focus, but I didn't manage to do so.

 

I tried :

Aliases.MyProcess.MyForm.Activate()

or

Aliases.MyProcess.MyForm.SetFocus()

or

Aliases.MyProcess.MyForm.Click()

 

Anyone could advise please ?

 

Thank you,

 

Mehdi

3 REPLIES 3
tristaanogre
Esteemed Contributor

If the RightForm is modal in any way, while it doesn't overlap, it will still be an "unexpected window".


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

Hi Robert,

But when I manualy clic on the left window the test succeed...

I wish I could make the robot do this click.

tristaanogre
Esteemed Contributor

You can, in the project, check the option to ignore unexpected windows.  Will this resolve things?  It's possible that the unexpected window handler is preventing the additional clicks.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
cancel
Showing results for 
Search instead for 
Did you mean: