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

WPF - recorder + application quit and start again

10 Answers 114 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Dmitry
Top achievements
Rank 1
Dmitry asked on 05 Aug 2017, 12:33 PM
     Is it possible to continue recording tests after tested application was restarted in coded step? We need this to ensure that test data created in app are persisted and we restart application to make sure that newly added data is still there, but recorder fails with "process with id cannot be found"- I suppose it still refers to old process which in our case is already gone.

10 Answers, 1 is accepted

Sort by
0
Aaron
Top achievements
Rank 1
answered on 07 Aug 2017, 05:21 PM

I'm not sure how "proper" this solution is, but it works for me. See the attached image for how I do this in a coded step. 

Before calling Manage.ActiveApplication.Quit(), I make sure my app is in a spot where it can be safely closed (i.e. I put myself back at my login page before quitting the application).

 

0
Aaron
Top achievements
Rank 1
answered on 07 Aug 2017, 05:22 PM
Last post didn't attach my screenshot...
0
Aaron
Top achievements
Rank 1
answered on 07 Aug 2017, 05:23 PM
http://prntscr.com/g5ika5
0
Dmitry
Top achievements
Rank 1
answered on 08 Aug 2017, 10:21 AM

Aaron, thanks for your answer, I tried it, and couple more ideas, but it seems Telerik recorder does not care about other instances of application, and always wants to see the instance it has created at the test start phase.

I tried to set ActiveApplication in Manager, even via reflection, but Recorder does not care about active application. It has some process id, and it want to see only that process.

0
Dmitry
Top achievements
Rank 1
answered on 08 Aug 2017, 10:43 AM
Acttually this seems to be issue of TestStudio itself - it calls public method of recorder passing wrong (outdated) process id to it, that's why recorder cannot connect. In my case this means there is no way for TestStudio to continue recording via "run to here" if test has app restart as one the steps...
0
Aaron
Top achievements
Rank 1
answered on 08 Aug 2017, 10:56 AM
Is there a reason that your process needs to be restarted DURING test recording? Couldn't you record the whole thing as if the process doesn't restart in one go, and then use something similar to my coded step (which should definitely work on playback) as a step manually inserted where you would want the process to restart?
0
Dmitry
Top achievements
Rank 1
answered on 08 Aug 2017, 11:09 AM

What you are suggesting - is the workaround we are forced to use, but I don't think this is a good approach in such an application like TestStudio, that should help making tests, not creating obstacles in a way.

Also, worth mentioning - wpf recorder has a quite big bug (https://feedback.telerik.com/Project/161/Feedback/Details/225866-recorder-does-not-identify-the-automationids-in-a-custom-wpf-application-when-exe) in it, which forces us to spend much time on a single test, just because of this bug. I mean we are forced to rerecord steps, because DOM representation in recorder is different between recording and executing, but using option "run to here" we can partially solve this problem.

0
Nikolay Petrov
Telerik team
answered on 10 Aug 2017, 07:34 AM
Hi Dmitry,

In WPF testing by design it is meant to have only one application per test recording. As you observed if you start second process in the same test the recorder is not launched and attached to it. A workaround could be to use a test as step in the same test or to start a new test when it is necessary to launch the application again.

The problem you mentioned in your last response is under investigation from our dev team. I hope it would be processed soon.

@Aaron: Thank you for pointing out right directions on this problem.

Best Regards,
Nikolay Petrov
Progress Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Dmitry
Top achievements
Rank 1
answered on 11 Aug 2017, 11:25 AM
Let me disagree, it is a bad design if your recorder cannot attach to an "ActiveApplication" property of Manager (static class property available in coded steps). Why in code I can REPLACE application instance, but recorder cannot take process Id from that manager?
0
Nikolay Petrov
Telerik team
answered on 16 Aug 2017, 08:09 AM
Hi Dmitry,

Thank you for this feedback. As I mentioned previously to have one recorder available per a test script scenario is set by design. If you think that this work-flow could be improved - please add a feedback on our portal that will be reviewed by our management. Thank you in advance.

Best Regards,
Nikolay Petrov
Progress Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
Dmitry
Top achievements
Rank 1
Answers by
Aaron
Top achievements
Rank 1
Dmitry
Top achievements
Rank 1
Nikolay Petrov
Telerik team
Share this question
or