loadrunner Error 27985问题

错误提示:
Error -27985: There is no context for HTML-based functions. A previous function may not have used "Mode=HTML" or downloaded only non-HTML page(s), or the context has been reset (e.g., due to a GUI-based function)

 

看了很多解决方法,有人认为是由于web_find只能只用在基于HTML模式录制的脚本中,但是我全部脚本中没有web_find()这中函数,而是用的web_reg_find(),不过即使只用web_reg_find()也有的会出现上述问题,其实真正的原因是由于:

Runtime Settings的Browse Emulation中设置了Simulate a new user on each iteration引起的。由于这个设置导致每次迭代时都会模拟一个新的用户,此时这个新的用户并没有执行init操作而失败了,也即是错误提示中的There is no context。

这里涉及到一个知识点就是在Rumtime Settings的迭代设置中,迭代运行次数只对Action部分有效,而Init部分和End部分还是只运行一次的。这时如果设置了“Simulate a new user on each iteration”,将出现上面的错误。

原文地址:https://www.cnblogs.com/ly2018/p/8489526.html