La till stöd att ignorera blanka/tomma rader i CSV filen för SetTestParameter loadtest plugin
Showing
5 changed files
with
20 additions
and
3 deletions
... | @@ -119,6 +119,7 @@ namespace LIL_VSTT_Plugins | ... | @@ -119,6 +119,7 @@ namespace LIL_VSTT_Plugins |
119 | private bool mySeqLoop = false; | 119 | private bool mySeqLoop = false; |
120 | private bool myHasColName = false; | 120 | private bool myHasColName = false; |
121 | private bool myUseAutoSplit = false; | 121 | private bool myUseAutoSplit = false; |
122 | private bool myIgnoreBlanks = true; | ||
122 | 123 | ||
123 | private StringCollection myParams = new StringCollection(); | 124 | private StringCollection myParams = new StringCollection(); |
124 | private Random random = new Random(); | 125 | private Random random = new Random(); |
... | @@ -154,6 +155,15 @@ namespace LIL_VSTT_Plugins | ... | @@ -154,6 +155,15 @@ namespace LIL_VSTT_Plugins |
154 | set { myUseAutoSplit = value; } | 155 | set { myUseAutoSplit = value; } |
155 | } | 156 | } |
156 | 157 | ||
158 | [DisplayName("CSV Ignorera blankskott")] | ||
159 | [Description("Ange False om du inte vill att rader med blankskott ignoreras (tomma/blanka rader eller samtliga kolumner tomma/blanka).")] | ||
160 | [DefaultValue(true)] | ||
161 | public bool IgnoreBlanks | ||
162 | { | ||
163 | get { return myIgnoreBlanks; } | ||
164 | set { myIgnoreBlanks = value; } | ||
165 | } | ||
166 | |||
157 | [DisplayName("Context Parameter Namn")] | 167 | [DisplayName("Context Parameter Namn")] |
158 | [Description("Ange namnet på parametern som vi ska lägga till i TestContext, om det är flera använd CSV format.")] | 168 | [Description("Ange namnet på parametern som vi ska lägga till i TestContext, om det är flera använd CSV format.")] |
159 | [DefaultValue("UserName")] | 169 | [DefaultValue("UserName")] |
... | @@ -449,6 +459,9 @@ namespace LIL_VSTT_Plugins | ... | @@ -449,6 +459,9 @@ namespace LIL_VSTT_Plugins |
449 | int dataNum = 0; | 459 | int dataNum = 0; |
450 | while ((input = re.ReadLine()) != null) | 460 | while ((input = re.ReadLine()) != null) |
451 | { | 461 | { |
462 | // Ignore blank lines and empty lines (just whitespace) or lines with only blank/empty/whitespace columns | ||
463 | if (myIgnoreBlanks && String.IsNullOrWhiteSpace(input.Replace(',', ' '))) continue; | ||
464 | |||
452 | lineNum++; | 465 | lineNum++; |
453 | if (lineNum == 1 && myHasColName == true) | 466 | if (lineNum == 1 && myHasColName == true) |
454 | { | 467 | { | ... | ... |
No preview for this file type
No preview for this file type
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <LoadTest Name="LoadTest1" Description="" Owner="" storage="c:\ws\repos\vstt-plugins\testproject1\loadtest1.loadtest" Priority="2147483647" Enabled="true" CssProjectStructure="" CssIteration="" DeploymentItemsEditable="" WorkItemIds="" TraceLevel="None" CurrentRunConfig="Run Settings1" Id="0e35c1c4-9214-4fc4-907f-42e11a00845a" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010"> | 2 | <LoadTest Name="LoadTest1" Description="" Owner="" storage="d:\git\vstt-plugins\testproject1\loadtest1.loadtest" Priority="2147483647" Enabled="true" CssProjectStructure="" CssIteration="" DeploymentItemsEditable="" WorkItemIds="" TraceLevel="None" CurrentRunConfig="Run Settings1" Id="0e35c1c4-9214-4fc4-907f-42e11a00845a" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010"> |
3 | <Scenarios> | 3 | <Scenarios> |
4 | <Scenario Name="Scenario1" DelayBetweenIterations="1" PercentNewUsers="0" IPSwitching="true" TestMixType="PercentageOfUsersRunning" ApplyDistributionToPacingDelay="true" MaxTestIterations="0" DisableDuringWarmup="false" DelayStartTime="0" AllowedAgents=""> | 4 | <Scenario Name="Scenario1" DelayBetweenIterations="1" PercentNewUsers="0" IPSwitching="true" TestMixType="PercentageOfUsersRunning" ApplyDistributionToPacingDelay="true" MaxTestIterations="0" DisableDuringWarmup="false" DelayStartTime="0" AllowedAgents=""> |
5 | <ThinkProfile Value="0.2" Pattern="NormalDistribution" /> | 5 | <ThinkProfile Value="0.2" Pattern="NormalDistribution" /> |
... | @@ -416,7 +416,7 @@ | ... | @@ -416,7 +416,7 @@ |
416 | </CounterSet> | 416 | </CounterSet> |
417 | </CounterSets> | 417 | </CounterSets> |
418 | <RunConfigurations> | 418 | <RunConfigurations> |
419 | <RunConfiguration Name="Run Settings1" Description="" ResultsStoreType="Database" TimingDetailsStorage="AllIndividualDetails" SaveTestLogsOnError="true" SaveTestLogsFrequency="1" MaxErrorDetails="200" MaxErrorsPerType="1000" MaxThresholdViolations="1000" MaxRequestUrlsReported="1000" UseTestIterations="true" RunDuration="600" WarmupTime="0" CoolDownTime="0" TestIterations="8" WebTestConnectionModel="ConnectionPerUser" WebTestConnectionPoolSize="50" SampleRate="5" ValidationLevel="High" SqlTracingConnectString="" SqlTracingConnectStringDisplayValue="" SqlTracingDirectory="" SqlTracingEnabled="false" SqlTracingFileCount="2" SqlTracingRolloverEnabled="true" SqlTracingMinimumDuration="500" RunUnitTestsInAppDomain="true" CoreCount="0" UseMultipleIPs="false" TestAgentConfiguration="Default" AgentDiagnosticsLevel="Warning"> | 419 | <RunConfiguration Name="Run Settings1" Description="" ResultsStoreType="Database" TimingDetailsStorage="AllIndividualDetails" SaveTestLogsOnError="true" SaveTestLogsFrequency="1" MaxErrorDetails="200" MaxErrorsPerType="1000" MaxThresholdViolations="1000" MaxRequestUrlsReported="1000" UseTestIterations="true" RunDuration="600" WarmupTime="0" CoolDownTime="0" TestIterations="8" WebTestConnectionModel="ConnectionPerUser" WebTestConnectionPoolSize="50" SampleRate="5" ValidationLevel="High" SqlTracingConnectString="" SqlTracingConnectStringDisplayValue="" SqlTracingDirectory="" SqlTracingEnabled="false" SqlTracingFileCount="2" SqlTracingRolloverEnabled="true" SqlTracingMinimumDuration="500" RunUnitTestsInAppDomain="true" CoreCount="0" ResourcesRetentionTimeInMinutes="0" UseMultipleIPs="false" TestAgentConfiguration="Default" AgentDiagnosticsLevel="Warning"> |
420 | <CounterSetMappings> | 420 | <CounterSetMappings> |
421 | <CounterSetMapping ComputerName="[CONTROLLER MACHINE]"> | 421 | <CounterSetMapping ComputerName="[CONTROLLER MACHINE]"> |
422 | <CounterSetReferences> | 422 | <CounterSetReferences> |
... | @@ -435,7 +435,7 @@ | ... | @@ -435,7 +435,7 @@ |
435 | <LoadTestPlugins> | 435 | <LoadTestPlugins> |
436 | <LoadTestPlugin Classname="LIL_VSTT_Plugins.SetTestParameter, LIL_VSTT_Plugins, Version=1.3.0.0, Culture=neutral, PublicKeyToken=null" DisplayName="Set Test Context Parameters" Description="(C) Copyright 2011 LIGHTS IN LINE AB
Sätter parametrar i testcontextet för tester i mixen hämtat från en CSV fil"> | 436 | <LoadTestPlugin Classname="LIL_VSTT_Plugins.SetTestParameter, LIL_VSTT_Plugins, Version=1.3.0.0, Culture=neutral, PublicKeyToken=null" DisplayName="Set Test Context Parameters" Description="(C) Copyright 2011 LIGHTS IN LINE AB
Sätter parametrar i testcontextet för tester i mixen hämtat från en CSV fil"> |
437 | <RuleParameters> | 437 | <RuleParameters> |
438 | <RuleParameter Name="Connection_String" Value="C:\tmp\Userdata.csv" /> | 438 | <RuleParameter Name="Connection_String" Value="Userdata.csv" /> |
439 | <RuleParameter Name="Has_col_name" Value="False" /> | 439 | <RuleParameter Name="Has_col_name" Value="False" /> |
440 | <RuleParameter Name="Autosplit" Value="False" /> | 440 | <RuleParameter Name="Autosplit" Value="False" /> |
441 | <RuleParameter Name="Parameter_Name" Value="Parameter1" /> | 441 | <RuleParameter Name="Parameter_Name" Value="Parameter1" /> |
... | @@ -451,6 +451,7 @@ | ... | @@ -451,6 +451,7 @@ |
451 | <RuleParameter Name="Scenario_Names" Value="" /> | 451 | <RuleParameter Name="Scenario_Names" Value="" /> |
452 | <RuleParameter Name="Agent_Names" Value="" /> | 452 | <RuleParameter Name="Agent_Names" Value="" /> |
453 | <RuleParameter Name="Use_UniqueTestIteration" Value="True" /> | 453 | <RuleParameter Name="Use_UniqueTestIteration" Value="True" /> |
454 | <RuleParameter Name="IgnoreBlanks" Value="True" /> | ||
454 | </RuleParameters> | 455 | </RuleParameters> |
455 | </LoadTestPlugin> | 456 | </LoadTestPlugin> |
456 | </LoadTestPlugins> | 457 | </LoadTestPlugins> | ... | ... |
-
Please register or sign in to post a comment