This is a migrated thread and some comments may be shown as answers.

Test with two app that interact with each other

1 Answer 49 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ken
Top achievements
Rank 1
Ken asked on 28 Jan 2020, 10:51 PM

I am evaluating test studio, but I am having trouble.  I have two apps that need to interact with each other during the test case.  One is the primary app (app1) and the other is a hardware emulation app (app2). 

1. App2 needs to open and load a script and begin it's run,

2. App1 opens

3. App1 begins to communicate with app2 (which starts running the script that was previously loaded). 

4. If the script runs successful, app1 will open show a successful connection to app2. 

Hope that is not too confusing. 

In this scenario, when I run test studio to complete the first step, app2 closes.  App2 needs to stay open and wait for app1 to run. 

How can I create a test for this scenario?

 

1 Answer, 1 is accepted

Sort by
0
Elena
Telerik team
answered on 29 Jan 2020, 04:20 PM

Hi Ken,

Thank you for sharing details for the scenario you need to cover - these are really helpful for me to understand the requirements. 

First, I want to share the assumptions that the applications under test are WPF apps, so the proposed solution covers such a scenario. This will be using a coded approach in order to switch the active application. I will describe the necessary actions step by step in details to complete a prove of concept. 

  1. First thing will be to record a simple test against App1 - this includes to create and configure a new WPF test in Test Studio. Please, note that for recording this test, you need to manually ensure App2 starts and executes its script to communicate with App1. 
  2. I am not completely sure if the script from App2 starts App1, or you need to start it manually. Depending on this, you can start a complete new recording session or connect to the already running process of App1
  3. Create another WPF test with and configure this to launch the script WPF App2.
  4. Record a test against this to trigger the script that this app runs - possibly click on a button or something like this. 
  5. As a next step in that test add a coded step
  6. Depending on the specifics of the scenario you can either launch new process for App1, which is connected with Test Studio, or connect Test Studio to an already existing process of App1. 
  7. Then, get back to the test steps and add the sample test recorded in steps 1.-2. to be executed as step
  8. Next comes a coded step again, which should quit the current application App1 instance
  9. If you need to get back to App2 and perform something against it, you need one more coded step, which will connect the Test Studio Manager() to the running instance of App2 using its process info. 

These steps will ensure that App2 is running through the whole test execution. As reference you can use the two articles - how to connect to a running WPF app, and how a WPF exe can be started with arguments. These are somewhat relevant to the current scenario and I hope will be of further help for you. Here are also some notes for the .Net GetProcess() method which is also needed in one of the scenarios. 

I also created a sample scenario which demonstrates the described coded approach. Please, keep in mind that you will need to add execution delay mechanisms in between the different actions in the test - like wait for the process to launch, etc. The current suggested project is a sample one and it only covers the most straight forward scenario. 

Please, take the time to review these notes and let me know in case of any further questions.

Regards,
Elena
Progress Telerik

 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
Ken
Top achievements
Rank 1
Answers by
Elena
Telerik team
Share this question
or