Scripting Best Practices

Additional critical scripting best practices should include consideration of the following items:

  1. If you are using a tool that records and playback your script, then try adding transaction names and comments while recording the script;
  2. Parameterize your script in order to create a test scenario as identical as possible to the production scenario. For examples, if using dates, use the date functions instead of static date;
  3. For every web page, it's important to have text (and or) image check point. This validates that the page actually opened, and that the text appeared on the page for every virtual user while your test runs;
  4. ThinkTime is critical to have implemented for production like live user sessions (concurrent users) and think time that matches to what users might wait for in production;
  5. Before any performance tests run, it's critical to ensure that you've cleared the application logs, web logs and database logs. You should also restart the server after every;
  6. Monitor your servers during the test and note the time (in seconds if possible) for any abnormal observations. After the test, check the server logs for what caused the abnormal behavior;
  7. If your application has a lot of AJAX requests and activities happening on the client side, it is good to test a single user and response time observed for the same in GUI mode. For the same, this is either initiated manuall,y or using some automation test tool. This gives an idea of the Graphical User Interface (GUI) response time for a user under load;
  8. Always keep an eye on the capacity of your load generators and don't over stress the load generators during the test. For higher number of virtual users, use multiple load generators without stressing them;
  9. It is common practice to have a separate test environment for performance test. Testing the system on Production or QA environment may impact the activities of production users or internal QA testers;
  10. Use the 80-20 rule while designing scenarios: While designing scenarios, go for functionalities and transactions that execute 80 % of the time by end users and form only 20% of the system.

Have a question or comment? Add your thoughts to the Comments below. Click here to go to the next page .