New WebTest Plugin to set Response Body Bytes Limit
Showing
1 changed file
with
16 additions
and
1 deletions
... | @@ -538,7 +538,8 @@ namespace LIL_VSTT_Plugins | ... | @@ -538,7 +538,8 @@ namespace LIL_VSTT_Plugins |
538 | { | 538 | { |
539 | rx = new Regex(DepRegex); | 539 | rx = new Regex(DepRegex); |
540 | } | 540 | } |
541 | e.WebTest.ResponseBodyCaptureLimit = 10000000; | 541 | // We cant do this here, replaced by SetResponseBodyCaptureLimitWebTestPlugin |
542 | //e.WebTest.ResponseBodyCaptureLimit = 10000000; | ||
542 | if (e.Request.HasDependentRequests) | 543 | if (e.Request.HasDependentRequests) |
543 | { | 544 | { |
544 | foreach (WebTestRequest r in e.Request.DependentRequests) | 545 | foreach (WebTestRequest r in e.Request.DependentRequests) |
... | @@ -563,6 +564,20 @@ namespace LIL_VSTT_Plugins | ... | @@ -563,6 +564,20 @@ namespace LIL_VSTT_Plugins |
563 | } | 564 | } |
564 | } | 565 | } |
565 | 566 | ||
567 | [DisplayName("Response Body Capture Limit"), Description("Sets the Response Body Byte Capture Limit for this WebTest. Warning, this can increase memory and cpu usage on the agents.")] | ||
568 | public class SetResponseBodyCaptureLimit : WebTestPlugin | ||
569 | { | ||
570 | [DisplayName("Limit Bytes"), Description("The number of bytes to set the limit to. Default value is 1.5 MB")] | ||
571 | [DefaultValue(1572864)] | ||
572 | public int Limit { get; set; } | ||
573 | |||
574 | public override void PreWebTest(object sender, PreWebTestEventArgs e) | ||
575 | { | ||
576 | e.WebTest.ResponseBodyCaptureLimit = Limit; | ||
577 | } | ||
578 | } | ||
579 | |||
580 | |||
566 | [DisplayName("Regular Expression Loop"), Description("Loop Condition that matches once on each regexp in previous response body")] | 581 | [DisplayName("Regular Expression Loop"), Description("Loop Condition that matches once on each regexp in previous response body")] |
567 | public class RegExpLoop : ConditionalRule | 582 | public class RegExpLoop : ConditionalRule |
568 | { | 583 | { | ... | ... |
-
Please register or sign in to post a comment