facing JavaScript required error when running vsts

2019-09-10 15:20发布

问题:

when running recorded webtest in VSTS 2010 ultimate facing JavaScript required error for many https requests, please help me to take it further for load testing.

回答1:

Visual Studio's web tests send and receive HTTP(S) messages. They do not execute or have anything to do with JavaScript or any other "active" elements of the web pages. Any Javascript activity by the web pages must be simulated in the web test.

Often web pages have HTML to display a message that Javascript is required. These web pages have Javascript code that overwrites that message with the information that is wanted. Hence when Javascript is not available the page shows the default message.

Your web test needs to create the requests that JavaScript would have created. That does not mean running JavaScript code, it means finding what requests are sent and creating them. For your testing I recommend that you learn about "dynamic parameters"

This web page discusses the exact problem described in the question, it gives reasons but not solutions. See the section about "Web Tests Can Succeed Even Though It Appears They Failed". It also has a good section on "Debugging a Web Test to Find and Fix Dynamic Parameters". This page has some good descriptions of how to solve many creation issues.