Ask a Question

Automation Test flow execution between desktop and web module and visa-versa in TestComplete

SOLVED
KP13
Occasional Contributor

Automation Test flow execution between desktop and web module and visa-versa in TestComplete

I have few test scenarios which flow from desktop application to web page and visa-versa.

Could you please share any effective way to automate those type of test scenarios using TestComplete Desktop & Web module.

8 REPLIES 8
AlexKaras
Community Hero

Hi,

 

Assuming that you have both, Desktop and Web modules licenses for TestComplete, there is nothing special in such testing. You are obtaining references to the processes that you need to interact with and do what you need.

Sample pseudo-code:

var oDsk = Sys.Process("MyDesktop");

var oMainWnd = oDsk.MainWindow;

var page = Sys.Browser("chrome").Page("www.myTestedPage");

 

oMainWnd.btnWatchLoggedInUsers.Click();

 

page.LoginName.Keys("myLogin");

page.LoginPwd.Keys("mySecurePwd");

page.btnSubmit.Click();

 

oMainWnd.LoggedInUsersForm.btnRefresh.Click();

...

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

You may also need to do some waiting for one or the other of the modules to load.  Here are various ways to do that:

 

https://support.smartbear.com/testcomplete/docs/app-objects/common-tasks/waiting-process-or-window-a...


Marsha_R
[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
KP13
Occasional Contributor

Thanks, Alex for your valuable reply...!!!

I have another query related to this. i.e. As I have to create 2 projects (1 desktop module project & 1 web module project), how will I change the test flow control from desktop to the web or vice-versa. And in which project the test result will be created.

tristaanogre
Esteemed Contributor

Projects are run separately.  Think of them as unique executable test runs that are, effectively, self contained.  You can't run the two projects in a way that will switch back and forth between tests.  In order to run the type of flow you want, you need to have your tests for both web and desktop portions in the same project if you want to run it on the same machine.


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
KP13
Occasional Contributor

 @tristaanogre Would you like to suggest me to create a single project [Rather than creating 1 desktop module project and 1 Web module project ] where we can write the script for both Desktop and Web application.. I think it will work for me.

tristaanogre
Esteemed Contributor

Yes, that's pretty much the only way to do what you are asking.


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
KP13
Occasional Contributor

@tristaanogre @AlexKaras So, if that would be case, then which type of project I have to create (from the attached screen), so that we can write the script for both window and web page application?

CreateProjectType.png

 

Hi,

 

Actually, it does not matter. The actual difference, IIRC, is in the contents of the Tested Applications item.

But:

a) You might not need Tested Applications at all -- this depends on the chosen approach to start the tested application(s); and

b) You can easily add/remove applications in the Tested Applications test item afterwards.

 

(To have less possible corrections later, I would, probably select Web Application option, though this really will not affect anything too much. Selection of the scripting language to use should be considered much more thoroughly.)

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
================================
cancel
Showing results for 
Search instead for 
Did you mean: