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

Coded step to run another test first

5 Answers 150 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Chad
Top achievements
Rank 1
Chad asked on 19 Oct 2017, 03:50 PM

Is it possible to setup a coded step to run another test before continuing. 

Use case is: There are some setup tests that need to be ran before other tests.

A coded step to call those tests first would be ideal, is there a solution for this?

Thanks

5 Answers, 1 is accepted

Sort by
0
Nikolay Petrov
Telerik team
answered on 24 Oct 2017, 11:26 AM
Hello Chad,

Thank you for this question. It is possible to add a coded step that could be placed for execution as initial to the test. There is an article that you might find useful that provides a sample on how to run an API test in a coded step. I hope this would do in your scenario.

Best Regards,
Nikolay Petrov
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Chad
Top achievements
Rank 1
answered on 30 Oct 2017, 07:45 PM

That is perfect, thanks for the link to the documentation that covers this. 

One more thing though: When I use the code in the example, I get a compile error:

'The type or namespace name 'Process' could not be found (are you missing a using directive or an assembly reference?)'

How is this resolved?

0
Nikolay Petrov
Telerik team
answered on 01 Nov 2017, 02:58 PM
Hello Chad,

The Process is located in the System.Diagnostics namespace. To resolve this compilation problem you could either add a using to it on the top of the code behind file where other usings are (using System.Diagnostics;) or to change Process to System.Diagnostics.Process statement.

I hope that would resolve the problem.

Best Regards,
Nikolay Petrov
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Chad
Top achievements
Rank 1
answered on 01 Nov 2017, 03:15 PM

Thanks for the reply. 

I have tried both of those solutions. 

Adding 'using System.Diagnostics.Process;' did not resolve the issue.

Neither did adding the statement. 

What I did notice is intellisense is not even showing Process as an option. This is part of my confusion. 

0
Nikolay Petrov
Telerik team
answered on 06 Nov 2017, 01:16 PM
Hello Chad,

It is correct that at this point - if not perform additional actions the Process will not appear in the Diagnostics namespace. You have probably seen in the "Project Properties" dialog that there is already a reference to "System". This is misleading though since this is actually the reference to mscorlib, but with a wrong label. So your project actually does not have a reference to System.dll. 

To workaround this issue, you simply need to manually add your references with absolute path to the desired dlls in the project.settings file. You can add your reference like it is shown on the attached screen-shot. Then you should be able to use all related classes.

I hope this would fix the problem.

Best Regards,
Nikolay Petrov
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Chad
Top achievements
Rank 1
Answers by
Nikolay Petrov
Telerik team
Chad
Top achievements
Rank 1
Share this question
or