Merge branch 'master' of https://git.lightsinline.se/products/VSTT-Plugins.git
Showing
2 changed files
with
110 additions
and
0 deletions
| ... | @@ -346,6 +346,104 @@ namespace LIL_VSTT_Plugins | ... | @@ -346,6 +346,104 @@ namespace LIL_VSTT_Plugins |
| 346 | } | 346 | } |
| 347 | } | 347 | } |
| 348 | 348 | ||
| 349 | ///<summary> | ||
| 350 | ///WebTest Plugin Data Generator | ||
| 351 | ///</summary> | ||
| 352 | [DisplayName("Data Generator Integer")] | ||
| 353 | [Description("(C) Copyright 2016 LIGHTS IN LINE AB\r\nGenererar en slumpad integer som context parameter")] | ||
| 354 | public class dataGenInteger : WebTestPlugin | ||
| 355 | { | ||
| 356 | Random RandomNumber = new Random(System.DateTime.Now.Millisecond); | ||
| 357 | |||
| 358 | private string paramName; | ||
| 359 | [DisplayName("Parameter namn")] | ||
| 360 | [Description("Ange namnet på parametern i ditt webtest, tex IntParameter1")] | ||
| 361 | [DefaultValue("IntegerParameter1")] | ||
| 362 | public string ParamNameVal | ||
| 363 | { | ||
| 364 | get { return paramName; } | ||
| 365 | set { paramName = value; } | ||
| 366 | } | ||
| 367 | |||
| 368 | private int intMin; | ||
| 369 | [DisplayName("Integer Min")] | ||
| 370 | [Description("Ange minsta värdet för parametern i ditt webtest, tex 0")] | ||
| 371 | [DefaultValue(0)] | ||
| 372 | public int IntegerMin | ||
| 373 | { | ||
| 374 | get { return intMin; } | ||
| 375 | set { intMin = value; } | ||
| 376 | } | ||
| 377 | |||
| 378 | private int intMax; | ||
| 379 | [DisplayName("Integer Max")] | ||
| 380 | [Description("Ange högsta värdet för parametern i ditt webtest, tex 100")] | ||
| 381 | [DefaultValue(100)] | ||
| 382 | public int IntegerMax | ||
| 383 | { | ||
| 384 | get { return intMax; } | ||
| 385 | set { intMax = value; } | ||
| 386 | } | ||
| 387 | |||
| 388 | private bool prePage = false; | ||
| 389 | [DisplayName("Uppdatera på varje Page")] | ||
| 390 | [Description("Sätt till true om du vill ha värdet uppdaterat inför varje ny sida som laddas i testet.")] | ||
| 391 | [DefaultValue(false)] | ||
| 392 | public bool PrePageVal | ||
| 393 | { | ||
| 394 | get { return prePage; } | ||
| 395 | set { prePage = value; } | ||
| 396 | } | ||
| 397 | |||
| 398 | private bool preTrans = false; | ||
| 399 | [DisplayName("Uppdatera på varje Transaktion")] | ||
| 400 | [Description("Sätt till true om du vill ha värdet uppdaterat inför varje ny transaktion i testet.")] | ||
| 401 | [DefaultValue(false)] | ||
| 402 | public bool PreTransactionVal | ||
| 403 | { | ||
| 404 | get { return preTrans; } | ||
| 405 | set { preTrans = value; } | ||
| 406 | } | ||
| 407 | |||
| 408 | private bool preReq = false; | ||
| 409 | [DisplayName("Uppdatera på varje Request")] | ||
| 410 | [Description("Sätt till true om du vill ha värdet uppdaterat inför varje nytt request i testet.")] | ||
| 411 | [DefaultValue(false)] | ||
| 412 | public bool PreRequestVal | ||
| 413 | { | ||
| 414 | get { return preReq; } | ||
| 415 | set { preReq = value; } | ||
| 416 | } | ||
| 417 | |||
| 418 | public override void PreWebTest(object sender, PreWebTestEventArgs e) | ||
| 419 | { | ||
| 420 | update(e.WebTest.Context); | ||
| 421 | base.PreWebTest(sender, e); | ||
| 422 | } | ||
| 423 | |||
| 424 | public override void PrePage(object sender, PrePageEventArgs e) | ||
| 425 | { | ||
| 426 | if (prePage) update(e.WebTest.Context); | ||
| 427 | base.PrePage(sender, e); | ||
| 428 | } | ||
| 429 | |||
| 430 | public override void PreRequestDataBinding(object sender, PreRequestDataBindingEventArgs e) | ||
| 431 | { | ||
| 432 | if (preReq) update(e.WebTest.Context); | ||
| 433 | base.PreRequestDataBinding(sender, e); | ||
| 434 | } | ||
| 435 | |||
| 436 | public override void PreTransaction(object sender, PreTransactionEventArgs e) | ||
| 437 | { | ||
| 438 | if (preTrans) update(e.WebTest.Context); | ||
| 439 | base.PreTransaction(sender, e); | ||
| 440 | } | ||
| 441 | |||
| 442 | private void update(WebTestContext context) | ||
| 443 | { | ||
| 444 | context[paramName] = RandomNumber.Next(intMin, intMax); | ||
| 445 | } | ||
| 446 | } | ||
| 349 | 447 | ||
| 350 | ///<summary> | 448 | ///<summary> |
| 351 | ///WebTest Plugin Data Generator | 449 | ///WebTest Plugin Data Generator | ... | ... |
| ... | @@ -2,6 +2,8 @@ | ... | @@ -2,6 +2,8 @@ |
| 2 | <WebTest Name="WebTest3" Id="5f8fe34b-e853-4a88-95cb-a8e963383b09" Owner="" Priority="2147483647" Enabled="True" CssProjectStructure="" CssIteration="" Timeout="0" WorkItemIds="" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010" Description="" CredentialUserName="" CredentialPassword="" PreAuthenticate="True" Proxy="default" StopOnError="False" RecordedResultFile="" ResultsLocale=""> | 2 | <WebTest Name="WebTest3" Id="5f8fe34b-e853-4a88-95cb-a8e963383b09" Owner="" Priority="2147483647" Enabled="True" CssProjectStructure="" CssIteration="" Timeout="0" WorkItemIds="" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010" Description="" CredentialUserName="" CredentialPassword="" PreAuthenticate="True" Proxy="default" StopOnError="False" RecordedResultFile="" ResultsLocale=""> |
| 3 | <Items> | 3 | <Items> |
| 4 | <Request Method="GET" Guid="359feba0-105f-4dbf-a630-32d640c10817" Version="1.1" Url="https://new.vinnarum.com/" ThinkTime="0" Timeout="300" ParseDependentRequests="False" FollowRedirects="True" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8" ExpectedHttpStatusCode="0" ExpectedResponseUrl="" ReportingName="" IgnoreHttpStatusCode="False" /> | 4 | <Request Method="GET" Guid="359feba0-105f-4dbf-a630-32d640c10817" Version="1.1" Url="https://new.vinnarum.com/" ThinkTime="0" Timeout="300" ParseDependentRequests="False" FollowRedirects="True" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8" ExpectedHttpStatusCode="0" ExpectedResponseUrl="" ReportingName="" IgnoreHttpStatusCode="False" /> |
| 5 | <Request Method="GET" Guid="359feba0-105f-4dbf-a630-32d640c10817" Version="1.1" Url="https://new.vinnarum.com/" ThinkTime="0" Timeout="300" ParseDependentRequests="False" FollowRedirects="True" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8" ExpectedHttpStatusCode="0" ExpectedResponseUrl="" ReportingName="" IgnoreHttpStatusCode="False" /> | ||
| 6 | <Request Method="GET" Guid="359feba0-105f-4dbf-a630-32d640c10817" Version="1.1" Url="https://new.vinnarum.com/" ThinkTime="0" Timeout="300" ParseDependentRequests="False" FollowRedirects="True" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8" ExpectedHttpStatusCode="0" ExpectedResponseUrl="" ReportingName="" IgnoreHttpStatusCode="False" /> | ||
| 5 | </Items> | 7 | </Items> |
| 6 | <WebTestPlugins> | 8 | <WebTestPlugins> |
| 7 | <WebTestPlugin Classname="LIL_VSTT_Plugins.ServiceManagerWebTestPlugin, LIL_VSTT_Plugins, Version=1.3.0.0, Culture=neutral, PublicKeyToken=null" DisplayName="Service Manager Config" Description="(C) Copyright 2015 LIGHTS IN LINE AB
Sätter config värden i Service Manager instansen för hela testet."> | 9 | <WebTestPlugin Classname="LIL_VSTT_Plugins.ServiceManagerWebTestPlugin, LIL_VSTT_Plugins, Version=1.3.0.0, Culture=neutral, PublicKeyToken=null" DisplayName="Service Manager Config" Description="(C) Copyright 2015 LIGHTS IN LINE AB
Sätter config värden i Service Manager instansen för hela testet."> |
| ... | @@ -15,5 +17,15 @@ | ... | @@ -15,5 +17,15 @@ |
| 15 | <RuleParameter Name="useTls12" Value="True" /> | 17 | <RuleParameter Name="useTls12" Value="True" /> |
| 16 | </RuleParameters> | 18 | </RuleParameters> |
| 17 | </WebTestPlugin> | 19 | </WebTestPlugin> |
| 20 | <WebTestPlugin Classname="LIL_VSTT_Plugins.dataGenInteger, LIL_VSTT_Plugins, Version=1.3.0.0, Culture=neutral, PublicKeyToken=null" DisplayName="Data Generator Integer" Description="(C) Copyright 2016 LIGHTS IN LINE AB
Genererar en slumpad integer som context parameter"> | ||
| 21 | <RuleParameters> | ||
| 22 | <RuleParameter Name="ParamNameVal" Value="TimeStampParameter1" /> | ||
| 23 | <RuleParameter Name="IntegerMin" Value="0" /> | ||
| 24 | <RuleParameter Name="IntegerMax" Value="100" /> | ||
| 25 | <RuleParameter Name="PrePageVal" Value="True" /> | ||
| 26 | <RuleParameter Name="PreTransactionVal" Value="False" /> | ||
| 27 | <RuleParameter Name="PreRequestVal" Value="False" /> | ||
| 28 | </RuleParameters> | ||
| 29 | </WebTestPlugin> | ||
| 18 | </WebTestPlugins> | 30 | </WebTestPlugins> |
| 19 | </WebTest> | 31 | </WebTest> |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or sign in to post a comment