12

So I'm coming up on the end of a project cycle; and I want to just give it a good shake around the hinges to see if everything is fine.

I'm not looking for load testing (imo, load testing locally is pointless) - but my idea is to fire up dotProfile and dotMemory then (using a tool) continuously run sessions against the site locally - either following a script or automatic (spidering). Again; not for purposes of load testing - more like leave it running for a couple of hours and see if anything stands out in the traces.

I've been doing some research myself; but most tools I find are either Spiders/SEO optimizers or load testing tools. I suppose a load testing tool could do the job, but I'm wondering if anyone else has experience they'd like to share.

1
  • This doesn't really help in the short term - but have you considered Application Insights for ongoing monitoring?
    – Chris Berg
    Oct 12, 2016 at 13:46

7 Answers 7

7
+50

I'd recommend learning and using Apache JMeter.

Yes, it's a technically a load testing tool, but in reality it's a highly configurable and very powerful tool to script simple and complex HTTP (and other) requests against one or many destinations.

We use it for both load and stress testing. You can build up a suite of requests that cover a good representation of your site pages, configure and pass in variables / user logins, etc. and then set it to run with a low thread concurrency level (i.e. only running 1 or 2 requests at a time but over a much longer period of time.).

Also worth nothing that each thread can be spun up with a unique session scope and cookie storage, so you can simulate complex site interactions. Or you can choose not to do it and just bombard the site with anonymous requests.

We've used this same process to run extended tests over a weekend to catch memory leaks, very much what you sound like you're looking to do.

I'd suggest avoiding using site-crawlers for this as they'll make it hard to identify what pages are causing the leaks. With something more controlled like JMeter you'd be able to turn on and off tests to isolate to just the requests that cause the leak. Then fix the leak and re-run the exact same tests.

Useful links:

JMeter Home

JMeter Plugins

3
  • 2
    There's a "Random Walk" write-up I've used a couple times -- it's specific to Sitecore for JMeter and might do the trick for you: kb.sitecore.net/articles/398589. You could tweak it to work through specific nooks and crannies or your own site, or just set it to visit some random links as the pages load.
    – G Killian
    Oct 12, 2016 at 23:27
  • 1
    choco install jmeter and we're off :-)
    – Mark Cassidy
    Oct 13, 2016 at 10:37
  • JMeter also has a test recorder which sets up a local proxy and creates tests for each interaction you have with your site: guide.blazemeter.com/hc/en-us/articles/… - However I found it generates a lot of noise and I spend more time cleaning it up and polishing where I could have just written a clean test from the start.
    – Laver
    Oct 13, 2016 at 21:10
5

Ran into a similar situation in a project, wanted to just 'smoke test' things towards the end both locally (Resharper test runner) and in CI/deployment (VStest task). Ended up creating another 'Test' project in the same solution and followed an example Selenium project online: https://github.com/atosorigin/SeleniumExample. From there, I picked out a few pages that were the most likely to fail and wrote tests around them:

  • login - does admin/b auth, does bad/pass fail
  • search - if I execute * search, does it return something
  • homepage - does it render after login

Testing those pages alone were enough for me to verify that things weren't destroyed.

Edit: I implied "smoke testing" from the just give it a good shake around the hinges, but I am just realizing you are asking more about the running footprint of the application itself over a duration of time. So unless you write Selenium tests to execute simultaneous users over an hours time, I don't know that my suggestion will provide you the desired outcome.

2

You could write some scripts using Casper.js which is an automation tool for Phantom.js to exercise the site. Won't cost you anything but a bit of time and Phantom.js already ships with Sitecore.

2

One way is to use Selenium. They have a .NET driver which you can use to write your own script. See the getting started guide for examples on how to use Selenium. This makes it possible to randomize stuff, fill in and post forms, navigate and so on.

1

There are loads of tools and techniques, it all depends on what you really want to test. So stress and load test, to do it properly you'll have to use paid services. In regards to functional testing we use Specflow, easy straight forward to use and to write UI acceptance tests. In regards performance I use Sitecore tracer and performance monitor, where you can see in details how much time each rendering is using to process. dotPrfile and dotMemory are more designed to identify memory leaks (performance issues) and are usually used, when issue persists on Prod boxes. I would advise using SouceLabs for unit testing and UI testing, its great service and isn't too expensive.

1

Have you tried Selenium? It is easy to use and you can customize your tests if you are looking for specific sections where things may go wrong(like form submitions, 404 links, regression tests not performed properly, etc).

0

I use WAPT (http://www.loadtestingtool.com/) for tests like this. It is in fact a load test tool, but you can define a reasonable load (not to stress the server) and the tool is able to monitor performance monitors on your server as well. You can keep it running for a few hours, based upon a recorded session which you can adapt with many options to make it look like real visitor behavior. Combined with the performance monitoring, this can help you to identify memory/cpu/... usage of your application in 'normal' circumstances.

3
  • Admittedly looks cool. I think I'll end up paying for a lot more features than I need though - given the cheapest license being almost USD$ 1.000 - loadtestingtool.com/order.shtml
    – Mark Cassidy
    Sep 26, 2016 at 9:19
  • That could be true :) We are using it a lot, also for load testing so the license fee is less of a problem. And I assume you already thought of a free load tester..
    – Gatogordo
    Sep 26, 2016 at 9:33
  • Am just exploring options :-) But since I run a 1 man Sitecore army; I have to think twice before shelling out 1K of my hard... well earned cash anyway ;-)
    – Mark Cassidy
    Sep 26, 2016 at 10:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.