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

Extracting test name

2 Answers 62 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Carl
Top achievements
Rank 1
Carl asked on 07 Jun 2017, 07:28 PM
Is there a way to extract the test name and then use it later to build a spreadsheet name that binds with subtests?

2 Answers, 1 is accepted

Sort by
0
Aaron
Top achievements
Rank 1
answered on 08 Jun 2017, 08:06 PM

If you added references to the two .dll's pictured in the screenshot, you can do the following inside of a coded step:

SetExtractedValue("testName", this.ExecutionContext.Test.Name.ToString());

Or, if you're doing it all in one coded step, and don't need to use the name anywhere else, you would just do:

string testName = this.ExecutionContext.Test.Name.ToString());

0
Nikolay Petrov
Telerik team
answered on 12 Jun 2017, 11:42 AM
Hi Carl,

@Aaron: thank you for pointing the right approach in this case.

The dll that have to be referred to the project are:

- System.Runtime.Serialization.dll - which is a .NET provided one
- Telerik.TestStudio.Interfaces.dll - provided by Test Studio and located in installation directory \Bin folder

then the line to extract the test name is same:
string testName = this.ExecutionContext.Test.Name.ToString();

I hope this clarification helps.

Kind 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
Carl
Top achievements
Rank 1
Answers by
Aaron
Top achievements
Rank 1
Nikolay Petrov
Telerik team
Share this question
or