Solving VuGen script generation errors

On very rare occasions you may encounter a web-based application that causes VuGen to throw an error during code generation. Every time this has happened to me, it has been solvable without having to talk to HP Software Support. Read on for my tips...

Error during code generation. The vuser Script was not generated.

When this problem occurs, you will see that both the Recorded Events Log and the Recording log show that HTTP requests and responses have been captured, but the Code Generation Log is empty.

VuGen Recorded Events Log

VuGen Recorded Events Log

VuGen Generation Log

Fortunately, it is usually not even necessary to re-record the script, because VuGen has a neat "Regenerate Script" feature, which will allow you to experiment with the different recording settings that are applied during the VuGen code generation stage.

VuGen Regenerate Script menu option

Note that when you regenerate your script, it will overwrite any changes you have made to the code. But comments and transactions added during recording and any correlation performed automatically with Correlation Rules will still be included in your newly generated script.

VuGen Regenerating the script will overwrite any manual changes. Only recorded actions will be effected. Click OK to overwrite the script.

Regenerating the script as a URL-based script with "Use web_custom_request only" enabled is a work-around for some script generation problems, but it can result in a very verbose script to work with.

VuGen Recording Settings > URL-based script > Use web_custom_request only

Changing the supported character set will sometimes solve code generation problems too. EUC-JP is a multi-byte format for representing characters from Asian langages (so I have never come across this one), but changing to UTF-8 (which is disabled by default in VuGen) has solved code generation problems for me several times.

VuGen Advanced Recording Options

Recording the script using the earlier recording engine sometimes solves code generation problems, but note that you actually do have to re-record the script using the old recording engine, you can't just regenerate the script. Remember to restart VuGen after ticking the "Record script using earlier recording engine" checkbox or the new recording engine will still be used.

Recording the script with a Multiple Protocol vuser type, with Web and Windows Sockets (even though your application only sends and receives HTTP) sometimes also fixes code generation problems as this forces a different recording engine to be used. I am fairly sure that this just forces VuGen to use the same "earlier" recording engine mentioned previously, but cannot confirm without doing further investigation. This is worth a try anyway if you are still having problems.

VuGen Multiple Protocol Web (HTTP/HTML) + Windows Sockets script

So, in summary...

  • Regenerate your script with a different recording mode (try "Use web_custom_request only").
  • Try a different character set. Check or un-check "Support charset UTF-8"
  • Re-record the script with the old recording engine (remember to restart VuGen).
  • Re-record the script with a Multiple Protocol Web + Windows Sockets vuser.

Tech tips from JDS