Insert 120 second wait in Visual studio Webtest

喜你入骨 提交于 2019-12-02 07:37:58

Think times are processed after the response is received. So to have a delay between two requests set the think time on the first request. I have successfully used long sleep times. Think times can be disabled in a test so make sure they are enabled:

1 In the ".testsettings" file, in the Web test section.

2 In the Think profile property of the scenario. If the delay should be (as near as possible to) exactly 120 seconds then set the profile to On.

3 The default for when Visual Studio runs a standalone web test is to not use think times. Thus everything runs as fast as possible. The setting in (1) above can be used to change the default. A temporary change to the default can be made from the "Edit test settings" command of the web test results window; this change only applies to test runs started by the "Click here to run again" in the same window.

If the two requests are actually different web tests then the Think time between test iterations property of the scenario may be useful.

Do not use any of the task or thread delay (or sleep) methods if there is any chance that this test will be used as part of a load test as they will stop many virtual users from running. See the first part of this answer for a fuller explanation. A delay or sleep call might be used if the web test will never be used within a load test.

You can do this

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