You might already be familiar with this article. It will tell you how to access your results from code so that you can do whatever you like with them (tweet them, use them to build up a custom dashboard, post them on Facebook etc.). But that's just for functional test.
What about Performance testing? Can you access your Performance data from a coded snippet?
Yes, you can.
It's slightly more complex. Performance results are not available immediately after a test has finished running. Hench you won't be able to access them from the OnAfterTestCompleted (reference). Instead you have to access them if you override the OnAfterTestListCompleted function. As the name suggests: Test Studio goes into that function once it has finished executing a TestList.
So the first thing you need to do is prepare your test and put it in a TestList. Set the TestList to Performance:
Once you have that it's time to overrride OnAfterTestListCompleted. The tricky part is that OnAfterTestListCompleted is not exposed publicly. You can only override it through a custom Test Studio plug-in. But that's not difficult to put together and we have this article that will walk you through it.
Here's a little example of what your OnAfterTestListCompleted function might look like:
Subscribe to be the first to get our expert-written articles and tutorials for developers!