cancel
Showing results for 
Search instead for 
Did you mean: 

TestComplete switching between two windows applications

SOLVED
Highlighted
Occasional Contributor

TestComplete switching between two windows applications

Hello,

 

I am currently trying to automate one windows application which has one authentication module in it. 

 

when I launch my windows application,

1. firth thing it asks me is to enter server URL in the application (I am able to automated this)

2. Click on login button.  (I am able to automated this)

 

3. then it opens a default web browser for me to enter user name and password and click on Submit button  (NOT DONE, how to switch control to web brower and make it identify control on web brower enter info and click submit)

 

4. and then I need to again sswitch back to my windows application again and check if application login is successfull 

5. then continue next actions on windows application.

 

Can anyone suggest on this or if anyone had already written some peice of code for something similar scenario ? 

 

Basically swtiching between two different applications during automation in TestComplete. 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Hero

Hi,

 

NameMapping will certainly work.

But NameMapping is (just) a more convenient and manageable form of direct process and object referencing. So it is not required to stick to NameMapping/Aliasing (though it is a recommended way) and the following (pseudocode) will work as well:

var oMyDesktopProcess = Sys.Process(<YourDesktopApp>);

var oDesktopLogin = oMyDesktopProcess.Window(<LoginWindow>);

// perform login sequence

 

var oBrowser = Sys.Browser(<BrowserName>);

var oPage = oBrowser.Page(...);

// perform actions in browser

 

oMyDesktopProcess.Window(<SomeOtherWindow>).Button(<...>).Click();

oPage.FindChild(...);

// etc.

// i.e. no special actions to switch between tested applications are needed with TestComplete

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] 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. Posts made by [Community Heroes]
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.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

View solution in original post

4 REPLIES 4
Highlighted
Community Leader

In my opinion, all the operations you mentioned in the entry can be performed by mapping objects to the NameMapping repository.

 

Map the items you are interested in and then work with them in the code.

 

If you want to run some applications other than the one you are working with during the script, add it to TestedApps.

 

The problem of switching between applications will not occur if you have it mapped in the NameMapping repository.

Highlighted
Occasional Contributor

OK sure, I will try this and get back to you.

Highlighted
Community Hero

Hi,

 

NameMapping will certainly work.

But NameMapping is (just) a more convenient and manageable form of direct process and object referencing. So it is not required to stick to NameMapping/Aliasing (though it is a recommended way) and the following (pseudocode) will work as well:

var oMyDesktopProcess = Sys.Process(<YourDesktopApp>);

var oDesktopLogin = oMyDesktopProcess.Window(<LoginWindow>);

// perform login sequence

 

var oBrowser = Sys.Browser(<BrowserName>);

var oPage = oBrowser.Page(...);

// perform actions in browser

 

oMyDesktopProcess.Window(<SomeOtherWindow>).Button(<...>).Click();

oPage.FindChild(...);

// etc.

// i.e. no special actions to switch between tested applications are needed with TestComplete

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] 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. Posts made by [Community Heroes]
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.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

View solution in original post

Highlighted
Community Manager

Hi @atul_acrolinx,

 

Have you managed to resolve the issue? Please share the solution with us.

 

 

---------
Tanya Gorbunova
SmartBear Community Manager

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today
New Here?
Join us and watch the welcome video:
Announcements
Join TechCorner Challenge!
Want a fun and easy way to learn TestComplete? Try solving weekly TechCorner challenges and get into the Leaderboard!


Challenge Status

Get properties of a web page element

See replies!

Compare images using the Region Checkpoint

See replies!

Compare HTML table with Excel file and correct data in Excel file

Participate!

How to execute remote test and obtain results via Test Runner REST API

Participate!
Top Kudoed Authors