Earlier I was using Visual Studio Load Test to generate load for my load testing. I created .Net unit tests which I called by VS Load Test. Now VS Load Test is retired by Microsoft. Can I integrate my existing .Net code with JMeter?
You cannot integrate .NET code with JMeter because as per JMeter project main page
The Apache JMeter™ application is open source software, a 100% pure Java application designed to load test functional behavior and measure performance. It was originally designed for testing Web Applications but has since expanded to other test functions.
If you still can execute your Web Tests, you can replay them via JMeter's proxy.
Prepare JMeter for recording. The easiest way is going for JMeter Templates Feature
From JMeter's main menu choose `File -> Templates -> Recording" and click "Create"
Open HTTP(S) Test Script Recorder and click "Start"
Prepare Visual Studio for Recording, in your Web Test Project properties set JMeter as the proxy:
Run your Visual Studio test
JMeter will capture the requests and create the relevant HTTP Request samplers under the Recording Controller
You might need to still perform correlation/parameterization manually.
Related
A developer that I have engaged to code a system (java) will be providing their testing reports and scripts for our review. Scripts will be JMeter, I am wanting to gain a robust converter to enable these scripts to be used in for functional testing in a Locally Hosted Visual Studio instance running Microsoft 10.
What have people used previously?
Regards, Karen
Performance scripts are not meant for functional testing as they dont have the interaction capabilities with the page objects like click. So, jmeter scripts are not 100% equivalent to functional testing.
If you want to use the jmeter jmx with Visual Studio then you can do it as VS allows to run the jmx. Check the below reference:-
https://learn.microsoft.com/en-us/vsts/test/load-test/get-started-jmeter-test?view=vsts
Hope this helps.
We need to create load and stress tests for a cloud application. Most tests will have to be coded instead of being recorded. Thus we need to integrate unit tests in the text mix.
Currently, we are creating a spike with Visual Studio 2015 Load Test Framework. We want to run the load tests from our local infrastructure as well as use Azure's cloud testing.
We would rather use XUnit instead of MS Test to write the unit tests. Is that possible? Do we have to write an plugin to achieve that?
Please check this question for the answer. Both NUnit and XUnit tests can't be added to a load test.
I'm trying to set up a build server script to run VS Load Tests. My preferred build server is Team City, but I would accept VSO's build server as well.
Thanks!
You should not use build server to run load test.
Visual Studio Online provides cloud-based load test, you can use it for your testing.
Instruction about VSO Load Test: https://www.visualstudio.com/en-us/get-started/test/load-test-your-app-vs
All of the load tests documentation on MSDN describes a computer (running visual studio) connecting to a test controller, which connects to the test agents. Is it possible to run Visual Studio on the Test Controller, and run tests from there?
Running Visual Studio on a Controller with agents is more or less like running local test. You can run load tests from a single (developer?) machine, but you usually can't generate enough traffic to really see how the application responds, especially if the target is hosted on the same machine. It's also very depending on your context.
Using Controllers & Agents in a test rig, provides a distributed architecture to generate a lot of load and activity.
I have a solution with a WebAPI project and a VS Test project.
My tests make calls to the API using RestSharp via a Url rather than instantiating the controller itself and injecting things (context etc).
My question, is there a way to tell the test project to launch the web project via IIS Express when a test run begins? Currently I just run two instances of VS, one with the web projected with debugging started and the other running the test package
If you are trying to debug both the test and the service, consider doing this
Launch to debug your Web service in Visual Studio.
Click Debug -> Detach All. IIS Express will keep running.
Set a break point and start Debuging your Unit Test.
(Skip this if you don't need to debug the web service) Click Debug -> Attach to Process. Find iisexpress.exe and attach.
However, you lose Edit and Continue on your web service which was detached.
I wouldn't recommend using the network to unit test Web API. You open yourself up to potential flakiness in the test and you end up testing a whole lot more than the service itself.
But if you really must do so, maybe to test that your client can exchange information with the API, then I'd suggest you look into self-hosting the service:
http://www.asp.net/web-api/overview/hosting-aspnet-web-api/self-host-a-web-api
Self-hosting lets you start up a server for Web API with just a few lines of code and you could have your tests start up this server in the right places. In most cases, this should behave the same as having your service hosted in IIS Express. But there are some important distinctions. For example, you won't be able to use some System.Web concepts you may be used to (like HttpContext.Current).
Update:
I've written a blog post about testing Web API services that might help -
https://learn.microsoft.com/en-us/archive/blogs/youssefm/writing-tests-for-an-asp-net-web-api-service
Hope that helps.
I know this is an old post but I was just faced with this issue. I can provide a more detailed response if / when anyone reads this.
In short.. I created a console app referencing the unit test assembly and via reflection and a simple menu system you can run any one of your tests.
I then set multiple startup projects to be the Web project and the console project.
I can then F5 and debug both the unit test and the Web project from within the same session. No attaching to a process of multiple solutions needed.
Running your web service or site in release non-debug by CTRL-F5 makes it run independent from Visual Studio and you are free to run your Tests from inside VS
I know that this is late but I use this solution:
Start two instances of Visual Studios. Start debugging the API in one VS and then debug the test in another.