Thursday, January 08, 2009

Loadrunner scripts writing tips

* 首页 相册 标签

Loadrunner scripts writing tips
joychester 发表于 2008-7-11 13:36:00
0
推荐

这是我在平时的学习&实践中的总结,分享给大家,希望有些提示,很多细节的东西没有写出,只能大家自己去体会去尝试:

1. Content check and error handling: using web_reg_find() functions everywhere, and write some error handling code to make sure LR can handle the requests in a proper way, like using lr_exit() function and lr_error_message() to write error messages in the controller console, so that we can track the error in time
2. Dealing with special characters using C programming language: define dynamic array and using pointer to handle that, and remember to free the parameters at the end.
3. Write Dll to make scripts shorter: using some open source tool to make Dll file which includes some common functions, then we can call the common functions dynamically and make scripts shorter.currently I use Code::Blocks and MinGW compiler, i do not use VC++, because it is not free :)
4. Look at the detail log message on demand: using lr_set_debug_message() function, you can open and close it on demand, so make your debug skill more efficiency.

5. using Ajax(click& scripts) instead of web (click & scripts )and web(http&html), you can combine Ajax and Http method together when you are writing the scripts

6.Learn how to use regular expression, a very powerful and helpful "tool"!

No comments:

Post a Comment