问题描述
我想知道是否有可能在Vuser录制的脚本中(用C或Java编写脚本)(在C或Java中)来控制/操作元素,单击Web应用程序/页面上的单选按钮等等. Ajax还在接受测试吗?
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?
问题是,当针对使用Ajax实现的Web应用程序运行vuser脚本时,我需要操纵页面元素才能使脚本进一步运行(使用http-protocol),并且因为http-protocol专注于记录http-录制期间未捕获与Web请求和响应中的流量一样的带有隐藏"单选按钮菜单的操作/客户端行为.
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?
推荐答案
由于WEB/HTML LoadRunner脚本是在C语言中编译和运行的,因此您可以使用C轻松地做到这一点.您可以编写任意数量的自定义函数,然后调用在整个脚本中都可以随意使用它们.认为最初的录音只是一个起点,然后逐渐消失.
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.
从技术上讲,您也可以使用JAVA进行此操作,但是您必须创建一个空的JAVA User脚本并手动编写整个代码.我在处理JAVA服务测试方面也做过类似的工作,但这并不是出于胆小.
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.
这篇关于在VUser脚本中编写Java或C脚本以操纵Ajax中的Web应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!