Scripting Java or C inside a VUser script to manipulate a web app in Ajax

只谈情不闲聊 提交于 2019-12-25 04:58:07

问题


I wonder if it is possible to script (in either C or Java) inside a vuser recorded script to control/manipulate elements, clicking radio-buttons and so forth on a web app/page using Ajax and being under test?

Problem is that when running a vuser script against a web app implemented using Ajax, I need to manipulate page elements in order to get the script running further (using http-protocol) and because http-protocol is focused on recording http-traffic as in web requests and responses the manipulation/client side behavior with a "hidden" radiobutton menu is not captured during recording.

I hope someone knows/has done something like this?


回答1:


You can do this with C easily since a WEB/HTML LoadRunner script is compiled and run in C. You can write as many custom functions as you want and call them at will all throughout your script. Think of the initial recording as just a starting point and hack away.

Technically you could do this with JAVA as well, but you would have to create an empty JAVA User script and hand code the whole thing. I've done similar work in dealing with JAVA services testing, but it isn't for the faint of heart.



来源:https://stackoverflow.com/questions/14780394/scripting-java-or-c-inside-a-vuser-script-to-manipulate-a-web-app-in-ajax

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!