Using MySQL instead of VTS for LoadRunner

I have two requirements for some testing which I’m currently undertaking and MySQL seems to be able to help me in both cases.

  • Firstly, I want to create data in one script and use it in subsequent scripts. When the data is “in use” I want other vUsers to use an alternate piece of data. When a piece of data has been “used” I want to flag it as such and prevent it being used in subsequent iterations.
  • Secondly, I want to write detailed information about transactions including a description of the transaction, the time it executed and the response time to a database. This will allow more detailed analysis than is normally possible using LoadRunner Analysis and allow a database of performance stats for multiple tests run over a period of time to be built up.
I know that it is possible to use Virtual Table Server (VTS) for this, but VTS has a number of limitations.
  • VTS can only read in data one row at a time. Queries must then be written in LoadRunner using C code to determine whether the data is suitable for use. This is inefficient when compared to SQL queries which execute on the server and can return data directly to the vUser.
  • VTS is not officially supported by HP (and it wasn’t supported by Mercury). MySQL isn’t supported either, but MySQL is well documented on the Internet and there is an established user community as well as large numbers of people familiar with SQL syntax.
  • VTS is an in-memory database and needs to import data before a test and export data to file before it is shut down. This makes it very easy to accidentally close VTS before data is saved and lose your test data. MySQL and other databases automatically save the database tables when they shut down which reduces the risk of this occurring.
A PDF document describing the process for using MySQL with LoadRunner, together with LoadRunner library files, the MySQL DLL and sample scripts which read and write to MySQL are available in my GitHib library.
Please feel free to comment below if you find this useful.

 

Author: Richard Bishop

http://about.me/richard_bishop

2 thoughts on “Using MySQL instead of VTS for LoadRunner”

  1. Richard,

    I have adopted your MySQL solution for data sharing between vusers, and have gotten much use out of it. I think it’s brilliant, because one can use MySQL for so much more than just passing data between vusers!

    Anyway, we’ve run into an issue where it appears our 64-bit Windows 7 system doesn’t like your 32-bit dll. Is there any way you could recompile to 64-bit and post?

    Even if you can’t, thanks for this solution! It’s so much better than VTS!

    Jim

    1. Thanks Jim,

      Glad to know that you found the post useful. I haven’t tried it with 64-bit Windows 7 but you could probably install the 32-bit version of MySQL and get it to work with that.

      If I get some downtime in the near future, I’ll try it with Windows 7 and see if I can work around the problem.

      Good luck with your testing.
      All the best
      Richard

Comments are closed.