{"id":1618,"date":"2012-03-12T23:12:04","date_gmt":"2012-03-12T23:12:04","guid":{"rendered":"http:\/\/www.obieta.com\/?p=1618"},"modified":"2012-03-12T23:12:04","modified_gmt":"2012-03-12T23:12:04","slug":"sharepoint-performance-load-testing-using-microsoft-visual-studio-vs-quotium-qtest","status":"publish","type":"post","link":"http:\/\/obieta.com\/?p=1618","title":{"rendered":"Sharepoint Performance \/ Load Testing using Microsoft Visual Studio vs Quotium QTest"},"content":{"rendered":"<div>\n<div>Below  is a white paper written in 2009 &#8211; QTest is now even better for  performance testing\u00a0Share point\u00a0&#8211; contact me for more\u00a0information.<\/div>\n<div>SharePoint Performance Testing White Paper: Scripting<\/div>\n<\/div>\n<div>Performance Test Scripts for Complex SharePoint Applications by Adam Brown<\/div>\n<h2>Introduction<\/h2>\n<div>This  paper focuses on the scripting phase of performance testing as this can  be one of the most time &amp; effort intensive parts of any load  testing project, particularly when working with bespoke and complex  applications, including SharePoint applications. Also this can be the  phase where most technical experience is required.<\/div>\n<h2>Abstract<\/h2>\n<div>The  reason for the paper is following an attempt to use Microsoft Visual  Studio Team Test System Web Testing to performance test a complex  SharePoint implementation.<\/div>\n<div>It  was found that creating scripts (transactions, user journeys whatever  you like to call them) for simple SharePoint applications could be  straight forward, however for a more complex implementation the dynamic  parameterisation that visual studio does simply did not parameterise all  necessary variables and a coding approach was required. The same  scenario was then evaluated using QTest from Quotium which was able to  parameterise all variables quickly and without the need for coding.<\/div>\n<h2>Executive Summary<\/h2>\n<div>\u00b7 \u00a0In  this scenario, Visual Studio Team System for Testers would require at  least 540 \u2013 1080 lines of code to be manually edited or written plus  other investigative activity to make a suite of scripts.<\/div>\n<div>\u00b7 \u00a0QTest  was able to handle the required parameterisation without any code  having to be written; QTest generated and integrated all the code  required.<\/div>\n<h2>The application under test (AUT)<\/h2>\n<div>The  objective of the application was to make more of the functionality of  Microsoft Office Project available via a web interface, this was then  deployed via SharePoint so that staff unfamiliar with MS Project would  be more comfortable with a web interface and MS Project did not need to  be installed on all machines. It enables users to create, edit and view  projects. The application was written by Raona of Spain.<\/div>\n<p><strong><br \/> <\/strong><\/p>\n<h2>The scenario<\/h2>\n<div>We  decided to record the process of creating a project using the  application, that way we could see on the server if the transactions  simulated with the tool were being properly executed. The transaction  steps were as follows:<\/div>\n<div>1: Navigate to Application HomePage<br \/> 2: Click New Project<br \/> 3: Enter Project Name, Template &amp; and Zone \u00a0Click Create Project<br \/> 4: Click Save and Publish<br \/> 5: Click OK when asked to check in<br \/> 6: Click Save<\/div>\n<h2>The captures<\/h2>\n<div>Captures  were made using the built in recording mechanisms featured with each  tool, this comprises of clicking the record button and interacting with  the AUT as a real user would.<\/div>\n<h3>Microsoft\u2019s Visual Studio Team System for Testers<\/h3>\n<div>First  we used the Microsoft tool, capture was straight forward and the tool  appeared to detect dynamic parameters while generating its visual script  (no code seen at this point). Dynamic parameters are incredibly  important when generating scripts as if these are not dealt with  correctly then the entire script (and any load tests executed with it)  can be rendered useless.<\/div>\n<div>Looking at the script that was generated and the dynamic parameters, at first glance the tool had done a good job.<\/div>\n<div><a href=\"https:\/\/lh6.googleusercontent.com\/-Gi9Cql0RANg\/TW6dagPlx7I\/AAAAAAAAA0M\/2zVVdJe5fL0\/s1600\/SP1.png\"><\/a><\/div>\n<div>It  was clear that we would have to parameterise the project name (used in  step 3 of our transaction steps list above) as duplicate project names  are not allowed in the AUT, however before parameterising this value we  thought we\u2019d better check that the script would run after simply  manually updating the project name parameter in the script by using find  and replace (we changed it from \u201cTestProj2\u201d to \u201cTestProj3\u201d). This way  we could quickly find out what else, if anything needed to be  parameterised.<\/div>\n<div>After  attempting to run the script with the new project name parameter it  failed receiving a HTTP Code 500 &#8211; internal server error from the  application under test.<\/div>\n<table cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td><a href=\"https:\/\/lh4.googleusercontent.com\/-mZYLyQ_5h3I\/TW6e6I9lz_I\/AAAAAAAAA0Y\/Gf9_mkdgx5w\/s1600\/SP2.png\"><\/a><\/td>\n<\/tr>\n<tr>\n<td>Note the Server 500 Error (highlighted in blue) and the details in the window below it.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div>After  a closer look at the script (at this point we dropped down into the  generated Visual Basic code) we could see exactly what had been  automatically\u00a0parameterised\u00a0and what had not and it quickly became  obvious why this script had caused a 500 internal server error and why  this script, in it\u2019s current state, could never work and could never be  used to generate accurate load.<\/div>\n<div>The reasons for this are explained below as follows:<\/div>\n<div>The dynamic parameters that the Visual Studio Web Testing tool did not deal with are as below:<\/div>\n<div>ProjectUID<br \/> CLSID<br \/> SessionUID<br \/> JobUID<br \/> ViewUID<br \/> ViewTimeStamp<\/div>\n<div>The  problem is that the AUT as with many applications needs to use these  types of parameters to maintain state, identify objects and maintain  sessions. To use a parameter from a previous transaction recording  simply can\u2019t work and if it does not cause visible errors, it will  result in inaccurate load being generated were the script to be used as  part of a test.<\/div>\n<div>The parameters it did deal with were as follows:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 __VIEWSTATE<br \/> __EVENTARGUMENT<br \/> __EVENTVALIDATION<br \/> __REQUESTDIGEST<br \/> __LASTFOCUS<br \/> Cookies<br \/> URL Parameters in redirects<\/div>\n<div>These  are standard Microsoft parameters and are dealt with correctly. The  problem with the parameters mentioned previously is that they are more  than likely created in the development process, so Visual Studio\u2019s web  testing tool can\u2019t know anything about them.<\/div>\n<div>An example of a parameter  that has not been parameterised is shown below is the XML request made by Visual Studio during a failed replay of the script.<\/div>\n<div><a href=\"https:\/\/lh3.googleusercontent.com\/-5Bq9LmkmxBA\/TW6gCTqPcKI\/AAAAAAAAA0c\/ijTWQc4GDEY\/s1600\/SP3.png\"><\/a><\/div>\n<div>If we look at the script below we can see the parameter  is static in the script not dynamic (look in the chunk of unparsed XML):<\/div>\n<div><a href=\"https:\/\/lh5.googleusercontent.com\/-lKnJH5jRSjQ\/TW6nn0hDBBI\/AAAAAAAAA0g\/gSnTBcB0dlM\/s1600\/SP4.png\"><\/a><\/div>\n<div>Compare this with a parameter that has been automatically parameterised and made dynamic (see __VIEWSTATE):<\/div>\n<div><a href=\"https:\/\/lh6.googleusercontent.com\/--se7BhkUTWU\/TW6oAEcD9hI\/AAAAAAAAA0k\/23oXZ9kkdvs\/s1600\/SP5.png\"><\/a><\/div>\n<div>So  it seems that the only way to make the script work is to manually  insert code to extract the dynamic parameters from the relevant web  server responses, store them as variables and insert them in the place  of the static parameters that need to be replaced in the XML.<\/div>\n<div>Of  course this should be no problem for a seasoned developer or tester  with VB \/ C# coding \/ scripting experience, however it may be time  consuming as there are at least 6 parameters here that need to be  replaced, each of which appears any number of times in the script,  depending on the size of the script. Add to that the fact that we will  need to produce more than one script to create a realistic scenario,  furthermore, when the application changes, the script will more than  likely need to be re-recorded to ensure that any changes are correctly  handled in the script. This makes for a lot of lines of code and hence a  lot of time spent during the scripting process. Let\u2019s quantify this:<\/div>\n<div>Once  we\u2019ve figured out a way of finding out where the parameter came from  and the best way to extract it with Visual studio we have the following:<\/div>\n<div>6 Parameters each appearing on average 6 times in each script.<\/div>\n<div>This means that approximately 36 lines of code need to be altered.<\/div>\n<div>Further  more at least 18 lines of code need to be inserted for declaration and  extraction (1 for declaration and one for extraction \u2013 possibly more).<\/div>\n<div>More lines of code may be required for complex parsing of parameters.<\/div>\n<div>This means that for each script we have there are at least 54 changes required.<\/div>\n<div>Typically in load testing 10-20 scripts are required for an accurate scenario, this means that we have <strong>at least<\/strong> <strong>540-1080 lines of code to edit or insert<\/strong> for each load test we prepare.<\/div>\n<div>If the application is changed then all of this work has to be re-visited or repeated.<\/div>\n<div>What\u2019s required is a parsing engine that can be configured to deal with bespoke \/ non standard parameters.<\/div>\n<p><strong><br \/> <\/strong><\/p>\n<h3>Quotium QTest<\/h3>\n<div>\n<p> Next we used QTest to capture the same transaction. QTest does not  automatically parameterise the script once it is generated; automatic  parameterisation is achieved by selecting a model from the drop down box  and clicking \u2018Apply Model\u2019. QTest is not limited to Microsoft  technologies so there are other models on there for J2EE, Siebel, SAP  etc.<\/p><\/div>\n<table cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td><a href=\"https:\/\/lh4.googleusercontent.com\/-bRJpoApP4P8\/TW6y_oeDufI\/AAAAAAAAA0o\/Dbh5hNA9cuE\/s1600\/SP6.png\"><\/a><\/td>\n<\/tr>\n<tr>\n<td>Note the Model drop down list in the top left of the application<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div>By  default the SharePoint model was not there, this was downloaded  separately as an XML file. We found however that the .Net model was able  to make most of the parameterisation that Visual Studio could.<\/div>\n<div> After the parameterisation process QTest had covered everything that  could be seen as a header parameter, it had not covered any parameters  that appeared in the body part of a request, such as an XML request,  these remained static.<\/div>\n<div><a href=\"https:\/\/lh4.googleusercontent.com\/-g-i7KXj0ywo\/TW6zxw6uUJI\/AAAAAAAAA0s\/BQj-77xWrtQ\/s1600\/SP7.png\"><\/a><\/div>\n<div>It was however quite straight forward to parameterise these using Find In HTTP Responses  from the right click menu (see above). Highlighting the parameter we  needed to make dynamic and right clicking presented the menu we needed  (below):<\/div>\n<div><a href=\"https:\/\/lh5.googleusercontent.com\/-bqkeMimorpc\/TW6z0_frJqI\/AAAAAAAAA0w\/K4X6uIstPFM\/s1600\/SP8.png\"><\/a><\/div>\n<div>QTest  then presented us with the locations of every instance of this  parameter in all of the HTTP responses (lower part of screen in  screenshot above)<\/div>\n<div>After  double clicking the response (above: I chose the one from the body of  response ID 87 rather than the header of response 87) QTest then  highlighted the parameter for extraction in the HTTP window on the right of the tool (see highlighted text in widow below),<\/div>\n<div><a href=\"https:\/\/lh5.googleusercontent.com\/-A9yWyxKykoE\/TW61CsZQ45I\/AAAAAAAAA04\/f-xtZvS4jYs\/s1600\/SP10.png\"><\/a><\/div>\n<p>&nbsp;<\/p>\n<div><a href=\"https:\/\/lh6.googleusercontent.com\/-uVSH7M3qYe0\/TW61CCDbEoI\/AAAAAAAAA00\/QN3kZLb5Zf8\/s1600\/SP9.png\"><\/a><\/div>\n<div>where we were then able to select Extract Value  following a right click on the selected text (see right). QTest then  evaluated the text to the immediate right and to the immediate left of  the parameter for extraction and used this to build an extraction rule  (see Left Delimiter and Right Delimiter in\u00a0screen shot\u00a0above).<\/div>\n<div>Using  the Magnifying glass button we were able to verify that the extraction  had worked correctly. Finally, the Apply button created the variable in  the script, generated the extraction code and inserted it at the  relevant place. All that was left was to use the find and replace to  replace all instances of the hard coded value in the script with the  variable that had just been parameterised.<\/div>\n<div><a href=\"https:\/\/lh5.googleusercontent.com\/-8exg6idMP7I\/TW61C6I_SLI\/AAAAAAAAA08\/pAHyDK9ZrDs\/s1600\/SP11.png\"><\/a>By highlighting the static value in the script, right clicking and using Find and replace in strings\u2026 it was possible to quickly parameterise all instances of this static value as per\u00a0screen shot\u00a0to the right.<\/div>\n<div>This  process was repeated for all variables that remained hard coded in the  script including the \u2018Project Name\u2019 that the user would normally enter  through the keyboard.<\/div>\n<div>Rather  than use a list of values we decided to use a timestamp on the project  name as that way we would always have a unique name for the Project.  Looking at the help we found the command for timestamps. This did mean  that we had a small piece of code to write as follows, this was placed  at the top of the script:<\/div>\n<div>UniqeName = \u201cMyProj\u201d + Date(\u201c%f\u201d);<\/div>\n<div>To  save time we then modified the SharePoint model to ensure that all  references to the hard coded project name were parameterised. To do this  we selected \u2018SharePoint\u2019 from the model drop down list on the toolbar  and clicked the\u00a0&#8216;Apply Model&#8217;\u00a0button  to edit it. We inserted a rule for the project name to ensure that the  variable we just created was used instead of the hard coded value.  Please see the screen shots below.<\/div>\n<div><a href=\"https:\/\/lh3.googleusercontent.com\/-N7OISRKUAkk\/TW61DBokh_I\/AAAAAAAAA1A\/xwh_kONQLAE\/s1600\/SP12.png\"><\/a><\/div>\n<p>&nbsp;<\/p>\n<div><a href=\"https:\/\/lh5.googleusercontent.com\/-wYIvZIEaXI8\/TW61DkCoM2I\/AAAAAAAAA1E\/yJ8RSW53ldA\/s1600\/SP13.png\"><\/a><\/div>\n<p>&nbsp;<\/p>\n<div>The next step was to replay the script to see if it works.<\/div>\n<div>During  the replay the tool shows the HTML pages that the server responds with  and finally pops up with a window offering to show replay differences.  This proved to be especially useful as it compares the traffic that was  generated by the browser when the script was recorded with the traffic  that QTest generated. Any unexpected behaviour is quickly highlighted  with this tool by severity 1,2 &amp; 3.<\/div>\n<div>Looking at the screen capture below we can see that the request that had failed with Visual Studio (see 2<sup>nd<\/sup> illustration on 2<sup>nd<\/sup> page) has now worked with QTest. This is because all of the parameters in the XML statements have been correctly dealt with.<\/div>\n<div><a href=\"https:\/\/lh3.googleusercontent.com\/-3uApp9l8-4c\/TW61EGpgJbI\/AAAAAAAAA1I\/UWbhx1Z0rjQ\/s1600\/SP14.png\"><\/a><\/div>\n<p>&nbsp;<\/p>\n<div>We  can also see in the replay window in QTest that the Project has been  successfully created with the unique name \u2018MyProj\u2019 and a UTC:<\/div>\n<div><a href=\"https:\/\/lh5.googleusercontent.com\/-AE5RWLBAyac\/TW61EjCYwwI\/AAAAAAAAA1M\/TODxL-XKO2M\/s1600\/SP15.png\"><\/a><\/div>\n<p>&nbsp;<\/p>\n<div><a href=\"https:\/\/lh3.googleusercontent.com\/-rUUadVPvdqg\/TW61E0hVX5I\/AAAAAAAAA1Q\/BnsChCHN-cc\/s1600\/SP16.png\"><\/a><\/div>\n<div>This can also be verified in a browser:<\/div>\n<div><a href=\"https:\/\/lh4.googleusercontent.com\/-SYvd-qN83ww\/TW61FRFEpuI\/AAAAAAAAA1U\/jFwhUX5o6l4\/s1600\/SP17.png\"><\/a><\/div>\n<p><strong><br \/> <\/strong><\/p>\n<h2>Summary<\/h2>\n<div>Visual  Studio is a capable tool in the hands of developers with the necessary  experience to use it and the time to correctly program it. It can be  suitable for use by non programmers with some simple web applications  where nothing has been bespoken (in our experience this is a rare case  in large organisations).<\/div>\n<div>However  if the application is not a standard out of the box vanilla affair,  time is limited and programmers scarce then QTest offers a better  approach as it\u2019s features make a typically difficult and lengthy task  (scripting) a relatively straight forward and short one.<\/div>\n<div>QTest  is a very capable and powerful tool in the hands of anyone with an IT  background, developer or not. Therefore it\u2019s highly suitable for  testers.<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Below is a white paper written in 2009 &#8211; QTest is now even better for performance testing\u00a0Share point\u00a0&#8211; contact me for more\u00a0information. SharePoint Performance Testing White Paper: Scripting Performance Test Scripts for Complex SharePoint Applications by Adam Brown Introduction This paper focuses on the scripting phase of performance testing as this can be one of [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[5,1],"tags":[],"_links":{"self":[{"href":"http:\/\/obieta.com\/index.php?rest_route=\/wp\/v2\/posts\/1618"}],"collection":[{"href":"http:\/\/obieta.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/obieta.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/obieta.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/obieta.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1618"}],"version-history":[{"count":0,"href":"http:\/\/obieta.com\/index.php?rest_route=\/wp\/v2\/posts\/1618\/revisions"}],"wp:attachment":[{"href":"http:\/\/obieta.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1618"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/obieta.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1618"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/obieta.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1618"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}