cancel
Showing results for 
Search instead for 
Did you mean: 

Calling WPF test script from Web framework

endorium
Frequent Contributor

Calling WPF test script from Web framework

Currently all our products are WPF based desktop applications. We have an existing framework for these.

 

We are currently creating a web framework as some of these applications are moving over to be web based.

 

My question is some scenarios will involve the need to run a WPF script and then run a web script.

Both WPF and Web Projects/frameworks are separate. Is there a way to call a WPF script to run from within the web framework?

 

I presume there is but cant find any information on this. WPF script will do the backend config in those applications and then web script runs and does the actual scenarios.

3 REPLIES 3
AlexKaras
Community Hero

Re: Calling WPF test script from Web framework

Hi,

 

What you need is absolutely possible without any specific actions from your side.

TestComplete communicates with desktop applications as with Sys.Process(<WPF app>) objects and with web applications as with Sys.Browser.Page(<Web App Page>) ones.

Your tests can address both your applications and TestComplete will switch and drive required application automatically.

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
================================
endorium
Frequent Contributor

Re: Calling WPF test script from Web framework

So I dont need to combine both projects/frameworks together then?

 

For the WPF scripts the dictionaries/mapping etc...  will be in the WPF framework.

I will be in the Web framework when I execute a test. We use workbook driven tests for both web and wpf.

AlexKaras
Community Hero

Re: Calling WPF test script from Web framework

> So I dont need to combine both projects/frameworks together then?

Well... You do need to combine them to certain extent...

But the implementation depends on your test plan.

For example, assuming that you need to run tests against your WPF part and then run tests against web part, then all you need to do is to create a new test suite, add WPF project to it, add web project to it and run the whole test suite.

If you need to do something in your web application, then do something in the WPF one and return to web afterwards, then you need to make web tests access test code for WPF and vise versa. To do this, you can, for example, create a new test project and add WPF and web test and framework script units to it as existing modules. If your test code uses NameMapping/Aliases then you will need to merge namemapping files from both frameworks and add resulting file to the test project.

Namemapping will be the only inconvenience because while regular script code can be shared between different projects, namemapping cannot be dynamically combined. Thus, if your namemapping changes, you will need to copy changes from one file (web or WPF) to combined file (or vise versa, depending on what file was changed).

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
================================
New Here?
Join us and watch the welcome video:
Announcements