3

Quite simply the question in the title, when I run test it by default runs it within my visual studio.

This doesn't seem to support JavaScript which makes all my test's invalid. Is there anyway to force the tests to run in a valid browser or turn on JavaScript for the in IDE browser?

2
  • Is there a reason why you need to use JavaScript in a performance test? Oct 18, 2012 at 12:16
  • It's a web based performance test, the components are using javascript to run, without them doing anything we can't progress..
    – Anicho
    Oct 18, 2012 at 12:32

2 Answers 2

4

Lyndon is half right. To clarify - Visual Studio web performance tests (coded or otherwise) will not ever execute JavaScript - either in a browser or by any other means. The article Anicho references states "You can use coded a Web performance test to simulate the logic typically performed by JavaScript"

You can craft them however to execute xmlhttp requests that do not get picked up by the recorder and would typically be triggered by a JavaScript/ajax library.

There could be cases where you want to test the actual load time plus JavaScript execution time of a web page. An example would be if your web page receives a large amount of data and has JavaScript that parses or operates on that data. I would suggest using a tool such as Selenium or Visual Studio Coded UI tests to actually execute the test and if you want to continue to get results in the visual studio performance results you can create transactions to measure how long the actions take.

One thing to keep in mind is that while Selenium or Coded UI Tests will allow you to measure the performance of the load time of a web page + JavaScript execution, it is very inefficient and not so useful for generating load or stressing a system. Usually I have my load/stress tests in one Scenario where I can adjust the user count easily and my pure performance tests in a different scenario with 1 user count.

Another thing to keep in mind is that if you are using implicit or explicit waits or polling for the existance of elements within your tests, the time it takes the UI automation framework to execute those things will be added to the load time, so while this will get you pretty close to a load time, it will not be 100% accurate to the degree that the visual studio web performance tests will be.

Feel free to contact me if you have additional questions.

0
2

Have you looked at using a coded web performance test. Haven't tried this before, but hoping to get to trying this out next week. Microsoft specifically mentions that it is able to execute javascript.

2
  • msdn.microsoft.com/en-us/library/ms404678.aspx - your correct in this matter.
    – Anicho
    Oct 18, 2012 at 13:34
  • That article seems to say exactly the opposite, actually: "An application might use JavaScript to dynamically modify form parameters. In a coded Web performance test you can write code to make the same modifications to form parameters manually." Apr 26, 2013 at 19:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.