Initial sync
Showing
22 changed files
with
2854 additions
and
0 deletions
.cvsignore
0 → 100644
1 | TestResults | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
LIL_VSTT_Plugins.sln
0 → 100644
1 | | ||
2 | Microsoft Visual Studio Solution File, Format Version 12.00 | ||
3 | # Visual Studio 2013 | ||
4 | VisualStudioVersion = 12.0.31101.0 | ||
5 | MinimumVisualStudioVersion = 10.0.40219.1 | ||
6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8ADAFB91-C10D-42C8-8499-30B3692C27F3}" | ||
7 | ProjectSection(SolutionItems) = preProject | ||
8 | LIL_VSTT_Plugins.vsmdi = LIL_VSTT_Plugins.vsmdi | ||
9 | Local.testsettings = Local.testsettings | ||
10 | TraceAndTestImpact.testsettings = TraceAndTestImpact.testsettings | ||
11 | EndProjectSection | ||
12 | EndProject | ||
13 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LIL_VSTT_Plugins", "LIL_VSTT_Plugins\LIL_VSTT_Plugins.csproj", "{06A22593-601E-4386-917A-9835DE30E14E}" | ||
14 | EndProject | ||
15 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestProject1", "TestProject1\TestProject1.csproj", "{01CF59F6-F912-447A-91BC-0301FDA09C02}" | ||
16 | EndProject | ||
17 | Global | ||
18 | GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
19 | Debug|Any CPU = Debug|Any CPU | ||
20 | Release|Any CPU = Release|Any CPU | ||
21 | EndGlobalSection | ||
22 | GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
23 | {06A22593-601E-4386-917A-9835DE30E14E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
24 | {06A22593-601E-4386-917A-9835DE30E14E}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
25 | {06A22593-601E-4386-917A-9835DE30E14E}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
26 | {06A22593-601E-4386-917A-9835DE30E14E}.Release|Any CPU.Build.0 = Release|Any CPU | ||
27 | {01CF59F6-F912-447A-91BC-0301FDA09C02}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
28 | {01CF59F6-F912-447A-91BC-0301FDA09C02}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
29 | {01CF59F6-F912-447A-91BC-0301FDA09C02}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
30 | {01CF59F6-F912-447A-91BC-0301FDA09C02}.Release|Any CPU.Build.0 = Release|Any CPU | ||
31 | EndGlobalSection | ||
32 | GlobalSection(SolutionProperties) = preSolution | ||
33 | HideSolutionNode = FALSE | ||
34 | EndGlobalSection | ||
35 | GlobalSection(TestCaseManagementSettings) = postSolution | ||
36 | CategoryFile = LIL_VSTT_Plugins.vsmdi | ||
37 | EndGlobalSection | ||
38 | EndGlobal |
LIL_VSTT_Plugins.vsmdi
0 → 100644
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <TestLists xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010"> | ||
3 | <TestList name="Lists of Tests" id="8c43106b-9dc1-4907-a29f-aa66a61bf5b6"> | ||
4 | <RunConfiguration id="f9146b42-ca07-41ed-9af4-6ec2afc90583" name="Local" storage="local.testsettings" type="Microsoft.VisualStudio.TestTools.Common.TestRunConfiguration, Microsoft.VisualStudio.QualityTools.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> | ||
5 | </TestList> | ||
6 | </TestLists> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
LIL_VSTT_Plugins/ExtractionRules.cs
0 → 100644
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Linq; | ||
4 | using System.Text; | ||
5 | using System.Net; | ||
6 | using Microsoft.VisualStudio.TestTools.WebTesting; | ||
7 | using Microsoft.VisualStudio.TestTools.LoadTesting; | ||
8 | using System.IO; | ||
9 | using System.ComponentModel; | ||
10 | |||
11 | namespace LIL_VSTT_Plugins | ||
12 | { | ||
13 | /// <summary> | ||
14 | /// Nästlad extraction rule | ||
15 | /// Kombination av två extractions rules i en. Den andra söker i resultatet av den första. | ||
16 | /// </summary> | ||
17 | [DisplayName("Nested Extraction")] | ||
18 | [Description("(C) Copyright 2011 LIGHTS IN LINE AB\r\nKombination av två extractions där den andra söker i resultatet av den första.")] | ||
19 | public class NestedExtractionRule : ExtractionRule | ||
20 | { | ||
21 | // Indata | ||
22 | private string start1; | ||
23 | [DisplayName("Extraction 1 Starts With")] | ||
24 | [Description("")] | ||
25 | public string Start1 | ||
26 | { | ||
27 | get { return start1; } | ||
28 | set { start1 = value; } | ||
29 | } | ||
30 | |||
31 | private string end1; | ||
32 | [DisplayName("Extraction 1 Ends With")] | ||
33 | [Description("")] | ||
34 | public string End1 | ||
35 | { | ||
36 | get { return end1; } | ||
37 | set { end1 = value; } | ||
38 | } | ||
39 | |||
40 | private string start2; | ||
41 | [DisplayName("Extraction 2 Starts With")] | ||
42 | [Description("")] | ||
43 | public string Start2 | ||
44 | { | ||
45 | get { return start2; } | ||
46 | set { start2 = value; } | ||
47 | } | ||
48 | |||
49 | private string end2; | ||
50 | [DisplayName("Exctration 2 Ends With")] | ||
51 | [Description("")] | ||
52 | public string End2 | ||
53 | { | ||
54 | get { return end2; } | ||
55 | set { end2 = value; } | ||
56 | } | ||
57 | |||
58 | public override void Extract(object sender, ExtractionEventArgs e) | ||
59 | { | ||
60 | // Find the first extraction | ||
61 | // TODO: Du behöver spola fram till att börja sökningen av end1 EFTER start1! | ||
62 | string extraction1; | ||
63 | int s1, s2, e1, e2; | ||
64 | |||
65 | s1 = e.Response.BodyString.IndexOf(start1) + start1.Length; | ||
66 | e1 = e.Response.BodyString.IndexOf(end1); | ||
67 | |||
68 | // Validate | ||
69 | if (s1 > e.Response.BodyString.Length || (e1 - s1 < 1)) | ||
70 | { | ||
71 | // Error | ||
72 | e.Success = false; | ||
73 | return; | ||
74 | } | ||
75 | |||
76 | extraction1 = e.Response.BodyString.Substring(s1, e1 - s1); | ||
77 | |||
78 | // Find the second extraction | ||
79 | // TODO: Du behöver spola fram till att börja sökningen av end2 EFTER start2! | ||
80 | string extraction2; | ||
81 | |||
82 | s2 = extraction1.IndexOf(start2) + start2.Length; | ||
83 | e2 = extraction1.IndexOf(end2); | ||
84 | |||
85 | // Validate | ||
86 | if (s2 > extraction1.Length || (e2 - s2 < 1)) | ||
87 | { | ||
88 | // Error | ||
89 | e.Success = false; | ||
90 | return; | ||
91 | } | ||
92 | |||
93 | extraction2 = extraction1.Substring(s2, e2 - s2); | ||
94 | |||
95 | |||
96 | e.WebTest.Context.Add(this.ContextParameterName, extraction2); | ||
97 | e.Success = true; | ||
98 | } | ||
99 | } | ||
100 | } |
LIL_VSTT_Plugins/LIL_VSTT_Plugins.csproj
0 → 100644
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
3 | <PropertyGroup> | ||
4 | <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
5 | <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
6 | <ProductVersion>8.0.30703</ProductVersion> | ||
7 | <SchemaVersion>2.0</SchemaVersion> | ||
8 | <ProjectGuid>{06A22593-601E-4386-917A-9835DE30E14E}</ProjectGuid> | ||
9 | <OutputType>Library</OutputType> | ||
10 | <AppDesignerFolder>Properties</AppDesignerFolder> | ||
11 | <RootNamespace>LIL_VSTT_Plugins</RootNamespace> | ||
12 | <AssemblyName>LIL_VSTT_Plugins</AssemblyName> | ||
13 | <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> | ||
14 | <FileAlignment>512</FileAlignment> | ||
15 | </PropertyGroup> | ||
16 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
17 | <DebugSymbols>true</DebugSymbols> | ||
18 | <DebugType>full</DebugType> | ||
19 | <Optimize>false</Optimize> | ||
20 | <OutputPath>bin\Debug\</OutputPath> | ||
21 | <DefineConstants>DEBUG;TRACE</DefineConstants> | ||
22 | <ErrorReport>prompt</ErrorReport> | ||
23 | <WarningLevel>4</WarningLevel> | ||
24 | </PropertyGroup> | ||
25 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
26 | <DebugType>pdbonly</DebugType> | ||
27 | <Optimize>true</Optimize> | ||
28 | <OutputPath>bin\Release\</OutputPath> | ||
29 | <DefineConstants>TRACE</DefineConstants> | ||
30 | <ErrorReport>prompt</ErrorReport> | ||
31 | <WarningLevel>4</WarningLevel> | ||
32 | </PropertyGroup> | ||
33 | <ItemGroup> | ||
34 | <Reference Include="Microsoft.VisualStudio.QualityTools.LoadTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" /> | ||
35 | <Reference Include="Microsoft.VisualStudio.QualityTools.WebTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" /> | ||
36 | <Reference Include="System" /> | ||
37 | <Reference Include="System.Core" /> | ||
38 | <Reference Include="System.Xml.Linq" /> | ||
39 | <Reference Include="System.Data.DataSetExtensions" /> | ||
40 | <Reference Include="Microsoft.CSharp" /> | ||
41 | <Reference Include="System.Data" /> | ||
42 | <Reference Include="System.Xml" /> | ||
43 | </ItemGroup> | ||
44 | <ItemGroup> | ||
45 | <Compile Include="ValidationRules.cs" /> | ||
46 | <Compile Include="ExtractionRules.cs" /> | ||
47 | <Compile Include="Swedbank.cs" /> | ||
48 | <Compile Include="WebTestPlugins.cs" /> | ||
49 | <Compile Include="LoadTestPlugins.cs" /> | ||
50 | <Compile Include="Properties\AssemblyInfo.cs" /> | ||
51 | </ItemGroup> | ||
52 | <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
53 | <!-- To modify your build process, add your task inside one of the targets below and uncomment it. | ||
54 | Other similar extension points exist, see Microsoft.Common.targets. | ||
55 | <Target Name="BeforeBuild"> | ||
56 | </Target> | ||
57 | <Target Name="AfterBuild"> | ||
58 | </Target> | ||
59 | --> | ||
60 | </Project> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
LIL_VSTT_Plugins/LoadTestPlugins.cs
0 → 100644
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Linq; | ||
4 | using System.Text; | ||
5 | using Microsoft.VisualStudio.TestTools.LoadTesting; | ||
6 | using System.ComponentModel; | ||
7 | using System.IO; | ||
8 | using System.Collections.Specialized; | ||
9 | |||
10 | namespace LIL_VSTT_Plugins | ||
11 | { | ||
12 | |||
13 | /// <summary> | ||
14 | /// LoadTest Context Copy | ||
15 | /// </summary> | ||
16 | [DisplayName("LoadTest Context Copy")] | ||
17 | [Description("(C) Copyright 2011 LIGHTS IN LINE AB\r\nKopierar context parametrar satta i loadtestet till alla test context i test mixen.")] | ||
18 | public class LoadTestPluginCopier : ILoadTestPlugin | ||
19 | { | ||
20 | //store the load test object. | ||
21 | LoadTest mLoadTest; | ||
22 | |||
23 | public void Initialize(LoadTest loadTest) | ||
24 | { | ||
25 | mLoadTest = loadTest; | ||
26 | |||
27 | //connect to the TestStarting event. | ||
28 | mLoadTest.TestStarting += new EventHandler<TestStartingEventArgs>(mLoadTest_TestStarting); | ||
29 | } | ||
30 | |||
31 | |||
32 | void mLoadTest_TestStarting(object sender, TestStartingEventArgs e) | ||
33 | { | ||
34 | //When the test starts, copy the load test context parameters to | ||
35 | //the test context parameters | ||
36 | foreach (string key in mLoadTest.Context.Keys) | ||
37 | { | ||
38 | e.TestContextProperties.Add(key, mLoadTest.Context[key]); | ||
39 | } | ||
40 | } | ||
41 | } | ||
42 | |||
43 | /// <summary> | ||
44 | /// Service Manager Plugin | ||
45 | /// </summary> | ||
46 | [DisplayName("Service Manager Config")] | ||
47 | [Description("(C) Copyright 2015 LIGHTS IN LINE AB\r\nSätter config värden i Service Manager instansen för hela testet.")] | ||
48 | public class ServiceManagerPlugin : ILoadTestPlugin | ||
49 | { | ||
50 | [DisplayName("Use Expect 100 Behaviour"), DefaultValue(true)] | ||
51 | public bool exp100 { get; set; } | ||
52 | |||
53 | [DisplayName("Max Connection Idle Time"), DefaultValue(100)] | ||
54 | public int maxIdle { get; set; } | ||
55 | |||
56 | [DisplayName("TCP Keep Alive"), DefaultValue(false)] | ||
57 | public bool keepAlive { get; set; } | ||
58 | |||
59 | [DisplayName("TCP Keep Alive Timeout (ms)"), DefaultValue(5000)] | ||
60 | public int timeOut { get; set; } | ||
61 | |||
62 | [DisplayName("TCP Keep Alive Interval"), DefaultValue(1000)] | ||
63 | public int interVal { get; set; } | ||
64 | |||
65 | [DisplayName("Use Nagle Algorithm"), DefaultValue(false)] | ||
66 | public bool useNagle { get; set; } | ||
67 | |||
68 | public void Initialize(LoadTest loadTest) | ||
69 | { | ||
70 | System.Net.ServicePointManager.Expect100Continue = exp100; | ||
71 | System.Net.ServicePointManager.MaxServicePointIdleTime = maxIdle; | ||
72 | System.Net.ServicePointManager.SetTcpKeepAlive(keepAlive, timeOut, interVal); | ||
73 | System.Net.ServicePointManager.UseNagleAlgorithm = useNagle; | ||
74 | //System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls; Needs .net 4.5 in order to enable high security protocols | ||
75 | } | ||
76 | |||
77 | } | ||
78 | |||
79 | [DisplayName("Set Test Context Parameters")] | ||
80 | [Description("(C) Copyright 2011 LIGHTS IN LINE AB\r\nSätter parametrar i testcontextet för tester i mixen hämtat från en CSV fil")] | ||
81 | public class SetTestParameter : ILoadTestPlugin | ||
82 | { | ||
83 | // Summary: | ||
84 | // Initializes the load test plug-in. | ||
85 | // | ||
86 | // Parameters: | ||
87 | // loadTest: | ||
88 | // The load test to be executed. | ||
89 | |||
90 | private string myConnectionString = ""; | ||
91 | private string myLogFileString = ""; | ||
92 | private string myParameterName = ""; | ||
93 | private string myTestNames = ""; | ||
94 | private string myScenarioNames = ""; | ||
95 | private string myAgentNames = ""; | ||
96 | private string myColNames = ""; | ||
97 | private bool myUseRandom = true; | ||
98 | private bool myUseUnique = false; | ||
99 | private bool myUseUniqueIteration = false; | ||
100 | private bool myLogToFile = false; | ||
101 | private bool myLogAppendID = false; | ||
102 | private bool myLogAppendName = false; | ||
103 | private bool mySeqLoop = false; | ||
104 | private bool myHasColName = false; | ||
105 | private bool myUseAutoSplit = false; | ||
106 | |||
107 | private StringCollection myParams = new StringCollection(); | ||
108 | private Random random = new Random(); | ||
109 | private LoadTest m_loadTest; | ||
110 | |||
111 | [DisplayName("CSV filens sökväg")] | ||
112 | [Description("Ange den fullständiga sökvägen till CSV filen. Observera att filen behöver finnas på alla agenterna också om du inte kör lokalt.")] | ||
113 | [DefaultValue("C:\\Userdata.csv")] | ||
114 | public string Connection_String | ||
115 | { | ||
116 | get { return myConnectionString; } | ||
117 | set { myConnectionString = value; } | ||
118 | } | ||
119 | |||
120 | [DisplayName("CSV filen har kolumnamn")] | ||
121 | [Description("Ange om csv filen har rubriker i form av kolumnnamn. Om du sätter True kommer kolmnens rubrik att användas som parameternamn istället.")] | ||
122 | [DefaultValue(false)] | ||
123 | public bool Has_col_name | ||
124 | { | ||
125 | get { return myHasColName; } | ||
126 | set { myHasColName = value; } | ||
127 | } | ||
128 | |||
129 | [DisplayName("CSV Autosplit per agent")] | ||
130 | [Description("Ange True om du vill att filen automatiskt ska splittas mellan alla aktiva agenter.")] | ||
131 | [DefaultValue(false)] | ||
132 | public bool Autosplit | ||
133 | { | ||
134 | get { return myUseAutoSplit; } | ||
135 | set { myUseAutoSplit = value; } | ||
136 | } | ||
137 | |||
138 | [DisplayName("Context Parameter Namn")] | ||
139 | [Description("Ange namnet på parametern som vi ska lägga till i TestContext, om det är flera använd CSV format.")] | ||
140 | [DefaultValue("UserName")] | ||
141 | public string Parameter_Name | ||
142 | { | ||
143 | get { return myParameterName; } | ||
144 | set { myParameterName = value; } | ||
145 | } | ||
146 | |||
147 | [DisplayName("Loggfilens namn")] | ||
148 | [Description("Ange den fullständiga sökvägen till logg filen. Om filen finns kommer den inte skrivas över utan läggas till i slutet.")] | ||
149 | [DefaultValue("C:\\Temp\\Fungerande.log")] | ||
150 | public string LogFilePathString | ||
151 | { | ||
152 | get { return myLogFileString; } | ||
153 | set { myLogFileString = value; } | ||
154 | } | ||
155 | |||
156 | [DisplayName("Loggfilens namn: Lägg till ID")] | ||
157 | [Description("Ange True om du vill att Agent ID samt VU ID läggs till automatiskt i slutet på filnamnet.")] | ||
158 | [DefaultValue(false)] | ||
159 | public bool LogFileAppendID | ||
160 | { | ||
161 | get { return myLogAppendID; } | ||
162 | set { myLogAppendID = value; } | ||
163 | } | ||
164 | |||
165 | [DisplayName("Loggfilens namn: Lägg till Namn")] | ||
166 | [Description("Ange True om du vill att Scenario Name samt Test Name läggs till automatiskt i slutet på filnamnet.")] | ||
167 | [DefaultValue(false)] | ||
168 | public bool LogFileAppendName | ||
169 | { | ||
170 | get { return myLogAppendName; } | ||
171 | set { myLogAppendName = value; } | ||
172 | } | ||
173 | |||
174 | [DisplayName("Välj slumpmässigt?")] | ||
175 | [Description("Ange True om du vill välja en slumpmässig användare. False går igenom listan sekventiellt.")] | ||
176 | [DefaultValue(true)] | ||
177 | public bool Use_Random | ||
178 | { | ||
179 | get { return myUseRandom; } | ||
180 | set { myUseRandom = value; } | ||
181 | } | ||
182 | |||
183 | [DisplayName("Välj unikt per VU?")] | ||
184 | [Description("Ange True om du vill att varje LoadTest VU ska ha sitt eget unika värde och återanvända detta i varje iteration. Stänger av slumpmässigt val.")] | ||
185 | [DefaultValue(false)] | ||
186 | public bool Use_Unique | ||
187 | { | ||
188 | get { return myUseUnique; } | ||
189 | set { myUseUnique = value; } | ||
190 | } | ||
191 | |||
192 | [DisplayName("Välj unikt per Iteration?")] | ||
193 | [Description("Ange True om du vill att varje LoadTest VU ska ha sitt eget unika värde för varje iteration, dvs aldrig återanvändas av någon under testet.")] | ||
194 | [DefaultValue(false)] | ||
195 | public bool Use_UniqueIteration | ||
196 | { | ||
197 | get { return myUseUniqueIteration; } | ||
198 | set { myUseUniqueIteration = value; } | ||
199 | } | ||
200 | |||
201 | [DisplayName("Välj sekventiell loop?")] | ||
202 | [Description("Ange true om du vill börja om från början om sekventiell läsning får slut på värden. Gäller även Unik läsning.")] | ||
203 | [DefaultValue(false)] | ||
204 | public bool Use_Loop | ||
205 | { | ||
206 | get { return mySeqLoop; } | ||
207 | set { mySeqLoop = value; } | ||
208 | } | ||
209 | |||
210 | [DisplayName("Logga fungerande till fil?")] | ||
211 | [Description("Ange True om du vill att poster vars tester slutar i Pass ska loggas till fil (c:\\fungerande.log). Om filen redan finns läggs de till i slutet.")] | ||
212 | [DefaultValue(false)] | ||
213 | public bool Log_To_File | ||
214 | { | ||
215 | get { return myLogToFile; } | ||
216 | set { myLogToFile = value; } | ||
217 | } | ||
218 | |||
219 | [DisplayName("Endast dessa Tester")] | ||
220 | [Description("Parametrar sätts endast på tester i test mixen där namnet eller del av namnet för testet finns i denna lista. Lämna blankt för att sätta i alla tester.")] | ||
221 | [DefaultValue("")] | ||
222 | public string Test_Names | ||
223 | { | ||
224 | get { return myTestNames; } | ||
225 | set { myTestNames = value; } | ||
226 | } | ||
227 | |||
228 | [DisplayName("Endast dessa Scenarios")] | ||
229 | [Description("Parametrar sätts endast på Scenarion där namnet eller del av namnet för scenariot finns i denna lista. Lämna blankt för att sätta i alla scenarion.")] | ||
230 | [DefaultValue("")] | ||
231 | public string Scenario_Names | ||
232 | { | ||
233 | get { return myScenarioNames; } | ||
234 | set { myScenarioNames = value; } | ||
235 | } | ||
236 | |||
237 | [DisplayName("Endast dessa Agenter")] | ||
238 | [Description("Parametrar sätts endast på Agenter där namnet eller del av namnet för agenten finns i denna lista. Lämna blankt för att sätta i alla agenter.")] | ||
239 | [DefaultValue("")] | ||
240 | public string Agent_Names | ||
241 | { | ||
242 | get { return myAgentNames; } | ||
243 | set { myAgentNames = value; } | ||
244 | } | ||
245 | |||
246 | public void Initialize(LoadTest loadTest) | ||
247 | { | ||
248 | // Only run on specific agents if specified | ||
249 | if (myAgentNames.Length > 0 && !myAgentNames.ToLower().Contains(loadTest.Context.AgentName.ToLower())) return; | ||
250 | |||
251 | // Vi bör läsa in alla värden här | ||
252 | this.initUserArray(myConnectionString, loadTest.Context.AgentCount, loadTest.Context.AgentId); | ||
253 | |||
254 | if (myParams.Count > 0) | ||
255 | { | ||
256 | m_loadTest = loadTest; | ||
257 | if (myUseUniqueIteration) | ||
258 | m_loadTest.TestStarting += new EventHandler<TestStartingEventArgs>(loadTestStartingUniqueIteration); | ||
259 | else if (myUseUnique) | ||
260 | m_loadTest.TestStarting += new EventHandler<TestStartingEventArgs>(loadTestStartingUnique); | ||
261 | else if (myUseRandom) | ||
262 | m_loadTest.TestStarting += new EventHandler<TestStartingEventArgs>(loadTestStartingRandom); | ||
263 | else | ||
264 | m_loadTest.TestStarting += new EventHandler<TestStartingEventArgs>(loadTestStartingSeq); | ||
265 | } | ||
266 | if (myLogToFile) | ||
267 | { | ||
268 | m_loadTest.TestFinished += new EventHandler<TestFinishedEventArgs>(loadTestEndLogger); | ||
269 | } | ||
270 | } | ||
271 | |||
272 | void loadTestEndLogger(object sender, TestFinishedEventArgs e) | ||
273 | { | ||
274 | // Log the user to logfile if the test is passed | ||
275 | if (e.Result.Passed && shouldRun(e)) | ||
276 | { | ||
277 | string fileName = myLogFileString; | ||
278 | if (myLogAppendID) fileName = fileName + ".Agent" + m_loadTest.Context.AgentId + ".Vu" + e.UserContext.UserId; | ||
279 | if (myLogAppendName) fileName = fileName + "." + e.UserContext.ScenarioName + "." + e.TestName; | ||
280 | string[] allNames; | ||
281 | if (myHasColName) allNames = myColNames.Split(','); else allNames = myParameterName.Split(','); | ||
282 | string row = ""; | ||
283 | foreach (string name in allNames) | ||
284 | { | ||
285 | if(e.UserContext.Keys.Contains(name)) { | ||
286 | if (row.Length == 0) | ||
287 | row += e.UserContext[name]; | ||
288 | else | ||
289 | row += "," + e.UserContext[name]; | ||
290 | } | ||
291 | } | ||
292 | File.AppendAllText(fileName + ".csv", row + "\r\n"); | ||
293 | } | ||
294 | } | ||
295 | |||
296 | void loadTestStartingRandom(object sender, TestStartingEventArgs e) | ||
297 | { | ||
298 | setParameters(this.getRandomUser(), e); | ||
299 | } | ||
300 | |||
301 | void loadTestStartingSeq(object sender, TestStartingEventArgs e) | ||
302 | { | ||
303 | setParameters(this.getSeqUser(e.UserContext.CompletedTestCount), e); | ||
304 | } | ||
305 | |||
306 | void loadTestStartingUnique(object sender, TestStartingEventArgs e) | ||
307 | { | ||
308 | setParameters(this.getSeqUser(e.UserContext.UserId), e); | ||
309 | } | ||
310 | |||
311 | void loadTestStartingUniqueIteration(object sender, TestStartingEventArgs e) | ||
312 | { | ||
313 | setParameters(this.getSeqUser(e.TestIterationNumber - 1), e); | ||
314 | } | ||
315 | |||
316 | void setParameters(string user, TestStartingEventArgs e) | ||
317 | { | ||
318 | if (shouldRun(e)) | ||
319 | { | ||
320 | // Add context parameters to the starting test | ||
321 | int numParams = 1; | ||
322 | if (myHasColName == true && myColNames.Contains(',')) numParams = countColumns(myColNames); | ||
323 | if (myHasColName == false && myParameterName.Contains(',')) numParams = countColumns(myParameterName); | ||
324 | //e.TestContextProperties.Add("LIL_LogValue", user); | ||
325 | //e.UserContext["LIL_LogValue"] = user; | ||
326 | string[] allParams = user.Split(','); | ||
327 | string[] allNames; | ||
328 | if (myHasColName) allNames = myColNames.Split(','); else allNames = myParameterName.Split(','); | ||
329 | for (int i = 0; i < numParams; i++) | ||
330 | { | ||
331 | e.TestContextProperties.Add(allNames[i], allParams[i]); | ||
332 | e.UserContext[allNames[i]] = allParams[i]; | ||
333 | } | ||
334 | } | ||
335 | } | ||
336 | |||
337 | int countColumns(string input) | ||
338 | { | ||
339 | int count = 1; | ||
340 | for (int i = 0; i < input.Length; i++) | ||
341 | { | ||
342 | if (input[i] == ',') count++; | ||
343 | } | ||
344 | return count; | ||
345 | } | ||
346 | |||
347 | bool shouldRun(TestStartingEventArgs e) | ||
348 | { | ||
349 | bool doRun = true; | ||
350 | if (myTestNames.Length > 0 && !myTestNames.ToLower().Contains(e.TestName.ToLower())) doRun = false; | ||
351 | if (myScenarioNames.Length > 0 && !myScenarioNames.ToLower().Contains(e.ScenarioName.ToLower())) doRun = false; | ||
352 | return doRun; | ||
353 | } | ||
354 | |||
355 | bool shouldRun(TestFinishedEventArgs e) | ||
356 | { | ||
357 | bool doRun = true; | ||
358 | if (myTestNames.Length > 0 && !myTestNames.ToLower().Contains(e.TestName.ToLower())) doRun = false; | ||
359 | if (myScenarioNames.Length > 0 && !myScenarioNames.ToLower().Contains(e.ScenarioName.ToLower())) doRun = false; | ||
360 | return doRun; | ||
361 | } | ||
362 | |||
363 | string getRandomUser() | ||
364 | { | ||
365 | int randomIndex = random.Next(myParams.Count - 1); | ||
366 | return myParams[randomIndex]; | ||
367 | } | ||
368 | |||
369 | string getSeqUser(int seqIndex) | ||
370 | { | ||
371 | if (seqIndex < myParams.Count) | ||
372 | return myParams[seqIndex]; | ||
373 | else | ||
374 | { | ||
375 | if (mySeqLoop) | ||
376 | return myParams[seqIndex % myParams.Count]; | ||
377 | else | ||
378 | return myParams[myParams.Count - 1]; | ||
379 | } | ||
380 | } | ||
381 | |||
382 | bool initUserArray(string path, int agentCount, int agentId) | ||
383 | { | ||
384 | if (path.Length > 0) | ||
385 | { | ||
386 | //StreamReader re = File.OpenText(path); | ||
387 | StreamReader re = new StreamReader(path, System.Text.Encoding.Default); | ||
388 | string input = null; | ||
389 | int lineNum = 0; | ||
390 | int dataNum = 0; | ||
391 | while ((input = re.ReadLine()) != null) | ||
392 | { | ||
393 | lineNum++; | ||
394 | if (lineNum == 1 && myHasColName == true) | ||
395 | { | ||
396 | // First line is column names | ||
397 | myColNames = input.TrimEnd(); | ||
398 | } | ||
399 | else | ||
400 | { | ||
401 | if (myUseAutoSplit) | ||
402 | { | ||
403 | int ifAgentId = 0; | ||
404 | if (dataNum >= agentCount) ifAgentId = (dataNum % agentCount) + 1; | ||
405 | else ifAgentId = dataNum + 1; | ||
406 | if (ifAgentId == agentId) | ||
407 | { | ||
408 | myParams.Add(input.TrimEnd()); | ||
409 | } | ||
410 | dataNum++; | ||
411 | } | ||
412 | else | ||
413 | { | ||
414 | myParams.Add(input.TrimEnd()); | ||
415 | } | ||
416 | } | ||
417 | } | ||
418 | re.Close(); | ||
419 | return true; | ||
420 | } | ||
421 | else { | ||
422 | return false; | ||
423 | } | ||
424 | } | ||
425 | } | ||
426 | } |
LIL_VSTT_Plugins/Properties/AssemblyInfo.cs
0 → 100644
1 | using System.Reflection; | ||
2 | using System.Runtime.CompilerServices; | ||
3 | using System.Runtime.InteropServices; | ||
4 | |||
5 | // General Information about an assembly is controlled through the following | ||
6 | // set of attributes. Change these attribute values to modify the information | ||
7 | // associated with an assembly. | ||
8 | [assembly: AssemblyTitle("LIL_VSTT_Plugins")] | ||
9 | [assembly: AssemblyDescription("Plugins for Web and Load Tests")] | ||
10 | [assembly: AssemblyConfiguration("")] | ||
11 | [assembly: AssemblyCompany("LIGHTS IN LINE AB")] | ||
12 | [assembly: AssemblyProduct("Visual Studio 2010 Ultimate")] | ||
13 | [assembly: AssemblyCopyright("© LIGHTS IN LINE AB 2014")] | ||
14 | [assembly: AssemblyTrademark("All Rights Reserved")] | ||
15 | [assembly: AssemblyCulture("")] | ||
16 | |||
17 | // Setting ComVisible to false makes the types in this assembly not visible | ||
18 | // to COM components. If you need to access a type in this assembly from | ||
19 | // COM, set the ComVisible attribute to true on that type. | ||
20 | [assembly: ComVisible(false)] | ||
21 | |||
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM | ||
23 | [assembly: Guid("eb453bc6-d339-4a51-9cd4-44478831db9a")] | ||
24 | |||
25 | // Version information for an assembly consists of the following four values: | ||
26 | // | ||
27 | // Major Version | ||
28 | // Minor Version | ||
29 | // Build Number | ||
30 | // Revision | ||
31 | // | ||
32 | // You can specify all the values or you can default the Build and Revision Numbers | ||
33 | // by using the '*' as shown below: | ||
34 | // [assembly: AssemblyVersion("1.0.*")] | ||
35 | [assembly: AssemblyVersion("1.3.0.0")] | ||
36 | [assembly: AssemblyFileVersion("1.3.0.0")] |
LIL_VSTT_Plugins/Swedbank.cs
0 → 100644
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Linq; | ||
4 | using System.Text; | ||
5 | using Microsoft.VisualStudio.TestTools.WebTesting; | ||
6 | using System.ComponentModel; | ||
7 | using Microsoft.VisualStudio.TestTools.WebTesting.Rules; | ||
8 | using System.Text.RegularExpressions; | ||
9 | using System.IO; | ||
10 | using Microsoft.VisualStudio.TestTools.LoadTesting; | ||
11 | |||
12 | namespace LIL_VSTT_Plugins | ||
13 | { | ||
14 | [DisplayName("Set Request Think Time"), Description("Changes the thinktime on requests with a set thinktime over 0 to the value of the ThinkTime context parameter")] | ||
15 | public class SetRequestThinkTime : WebTestPlugin | ||
16 | { | ||
17 | public override void PreRequest(object sender, PreRequestEventArgs e) | ||
18 | { | ||
19 | WebTestContext ctx = e.WebTest.Context; | ||
20 | |||
21 | if (ctx.ContainsKey("ThinkTime")) | ||
22 | { | ||
23 | int tt = Int32.Parse(ctx["ThinkTime"].ToString()); | ||
24 | if (e.Request.ThinkTime > 0) | ||
25 | { | ||
26 | e.Request.ThinkTime = tt; | ||
27 | } | ||
28 | } | ||
29 | } | ||
30 | } | ||
31 | |||
32 | [DisplayName("Clear Cookies"), Description("Clears all cookies from previous iterations of this webtest")] | ||
33 | public class ClearCookies : WebTestPlugin | ||
34 | { | ||
35 | public override void PreWebTest(object sender, PreWebTestEventArgs e) | ||
36 | { | ||
37 | e.WebTest.Context.CookieContainer = new System.Net.CookieContainer(); | ||
38 | } | ||
39 | } | ||
40 | |||
41 | [DisplayName("Think Time Emulator 10/190"), Description("Sets a context parameter named ThinkTime in each starting test to a random value between 10%-190% of the specified value.")] | ||
42 | public class ThinkTimeEmulator10190 : ILoadTestPlugin | ||
43 | { | ||
44 | [DisplayName("Think Time"), DefaultValue(0), Description("The Think Time to be used seconds. Default is 0.")] | ||
45 | public int ThinkTime { get; set; } | ||
46 | |||
47 | //store the load test object. | ||
48 | LoadTest mLoadTest; | ||
49 | Random rnd = new Random(); | ||
50 | |||
51 | public void Initialize(LoadTest loadTest) | ||
52 | { | ||
53 | mLoadTest = loadTest; | ||
54 | |||
55 | //connect to the TestStarting event. | ||
56 | mLoadTest.TestStarting += new EventHandler<TestStartingEventArgs>(mLoadTest_TestStarting); | ||
57 | } | ||
58 | |||
59 | |||
60 | void mLoadTest_TestStarting(object sender, TestStartingEventArgs e) | ||
61 | { | ||
62 | // Set the think time parameter in the tests context to a new value | ||
63 | int min = ThinkTime/10; | ||
64 | int max = ThinkTime*2 - min; | ||
65 | e.TestContextProperties.Add("ThinkTime", rnd.Next(min, max)); | ||
66 | } | ||
67 | } | ||
68 | |||
69 | [DisplayName("Set Cookie from Query String"), Description("Sets a cookie with given name from the value of a given Query String parameter if found in the current request")] | ||
70 | public class SetCookieFromQueryString : WebTestPlugin | ||
71 | { | ||
72 | [DisplayName("Cookie name"), Description("Name of the cookie to set")] | ||
73 | public String CookieName { get; set; } | ||
74 | |||
75 | [DisplayName("Query String parameter name"), Description("Name of the query string parameter to look for")] | ||
76 | public String ParamName { get; set; } | ||
77 | |||
78 | public override void PreRequest(object sender, PreRequestEventArgs e) | ||
79 | { | ||
80 | base.PreRequest(sender, e); | ||
81 | QueryStringParameterCollection col = e.Request.QueryStringParameters; | ||
82 | for(int x=0; x < col.Count; x++) | ||
83 | { | ||
84 | if (col[x].Name == ParamName) | ||
85 | { | ||
86 | e.Request.Cookies.Add(new System.Net.Cookie(CookieName, col[x].Value)); | ||
87 | return; | ||
88 | } | ||
89 | } | ||
90 | } | ||
91 | |||
92 | public override void PostRequest(object sender, PostRequestEventArgs e) | ||
93 | { | ||
94 | base.PostRequest(sender, e); | ||
95 | if (e.Request.HasDependentRequests) | ||
96 | { | ||
97 | foreach (WebTestRequest item in e.Request.DependentRequests) | ||
98 | { | ||
99 | QueryStringParameterCollection col = item.QueryStringParameters; | ||
100 | for (int x = 0; x < col.Count; x++) | ||
101 | { | ||
102 | if (col[x].Name == ParamName) | ||
103 | { | ||
104 | item.Cookies.Add(new System.Net.Cookie(CookieName, col[x].Value)); | ||
105 | } | ||
106 | } | ||
107 | } | ||
108 | } | ||
109 | } | ||
110 | } | ||
111 | |||
112 | [DisplayName("Add Header"), Description("Adds the specified header to all requests matching a given URL regex")] | ||
113 | public class AddHeader : WebTestPlugin | ||
114 | { | ||
115 | [DisplayName("Header Name"), Description("Name of the header to set")] | ||
116 | public String HeaderName { get; set; } | ||
117 | |||
118 | [DisplayName("Header Value"), Description("Value of the header to set")] | ||
119 | public String HeaderValue { get; set; } | ||
120 | |||
121 | [DisplayName("URL RegEx"), Description("Regular Expression to match on the URL. Empty matches all requests.")] | ||
122 | public String RegEx { get; set; } | ||
123 | |||
124 | public override void PreRequest(object sender, PreRequestEventArgs e) | ||
125 | { | ||
126 | base.PreRequest(sender, e); | ||
127 | if (Regex.Match(e.Request.Url, RegEx).Success || RegEx.Length == 0) | ||
128 | { | ||
129 | e.Request.Headers.Add(HeaderName, HeaderValue); | ||
130 | } | ||
131 | } | ||
132 | |||
133 | public override void PostRequest(object sender, PostRequestEventArgs e) | ||
134 | { | ||
135 | base.PostRequest(sender, e); | ||
136 | if (e.Request.HasDependentRequests) | ||
137 | { | ||
138 | foreach (WebTestRequest item in e.Request.DependentRequests) | ||
139 | { | ||
140 | if (Regex.Match(item.Url, RegEx).Success || RegEx.Length == 0) | ||
141 | { | ||
142 | item.Headers.Add(HeaderName, HeaderValue); | ||
143 | } | ||
144 | } | ||
145 | } | ||
146 | } | ||
147 | } | ||
148 | |||
149 | [DisplayName("Log Context Arrays to File"), Description("Logs the specified context parameter arrays to file after each test iteration, one row for each array value")] | ||
150 | public class LogContextArrayToFile : WebTestPlugin | ||
151 | { | ||
152 | [DisplayName("Parameter arrays"), Description("Comma separated list of array parameters to log")] | ||
153 | public String Params { get; set; } | ||
154 | |||
155 | [DisplayName("File Name"), Description("The file name to use for logging")] | ||
156 | public String Filename { get; set; } | ||
157 | |||
158 | private bool header = true; | ||
159 | private string[] paramlist = null; | ||
160 | |||
161 | public override void PostWebTest(object sender, PostWebTestEventArgs e) | ||
162 | { | ||
163 | if (Params.Length == 0 || Filename.Length == 0) return; | ||
164 | if (paramlist == null) paramlist = Params.Split(','); | ||
165 | if (header) | ||
166 | { | ||
167 | File.AppendAllText(Filename, Params + "\r\n"); | ||
168 | header = false; | ||
169 | } | ||
170 | // Check that the first param array has a count | ||
171 | int count = 0; | ||
172 | WebTestContext ctx = e.WebTest.Context; | ||
173 | if (ctx.ContainsKey(paramlist[0] + "_count")) count = Int32.Parse(ctx[paramlist[0] + "_count"].ToString()); | ||
174 | for (int i = 1; i <= count; i++) | ||
175 | { | ||
176 | string row = ""; | ||
177 | foreach (string param in paramlist) | ||
178 | { | ||
179 | if (row.Length > 0) row += ","; | ||
180 | if (ctx.ContainsKey(param + "_" + i)) row += ctx[param + "_" + i].ToString(); | ||
181 | } | ||
182 | File.AppendAllText(Filename, row + "\r\n"); | ||
183 | } | ||
184 | base.PostWebTest(sender, e); | ||
185 | } | ||
186 | } | ||
187 | |||
188 | [DisplayName("Log Context to File"), Description("Logs the specified context parameters to file after each test iteration")] | ||
189 | public class LogContextToFile : WebTestPlugin | ||
190 | { | ||
191 | [DisplayName("Regular Expression"), Description("The RegEx to use to match context parameter names")] | ||
192 | public String myRegex { get; set; } | ||
193 | |||
194 | [DisplayName("File Name"), Description("The file name to use for logging")] | ||
195 | public String Filename { get; set; } | ||
196 | |||
197 | [DisplayName("Write header"), DefaultValue(false), Description("Writes the parameter names as a header. Will write a new header for each user (dont use in loadtest)")] | ||
198 | public bool useHeader { get; set; } | ||
199 | |||
200 | [DisplayName("Log if passed"), DefaultValue(true), Description("Logs the parameters if the webtest passed")] | ||
201 | public bool logPassed { get; set; } | ||
202 | |||
203 | [DisplayName("Log if failed"), DefaultValue(true), Description("Logs the parameters if the webtest failed")] | ||
204 | public bool logFailed { get; set; } | ||
205 | |||
206 | private bool header = true; | ||
207 | |||
208 | public override void PostWebTest(object sender, PostWebTestEventArgs e) | ||
209 | { | ||
210 | if ((e.WebTest.Outcome == Outcome.Pass && logPassed) || (e.WebTest.Outcome == Outcome.Fail && logFailed)) { | ||
211 | string row = ""; | ||
212 | string hrow = ""; | ||
213 | |||
214 | foreach (KeyValuePair<string, object> pair in e.WebTest.Context) | ||
215 | { | ||
216 | if (Regex.Match(pair.Key, myRegex).Success) | ||
217 | { | ||
218 | if (header && useHeader) | ||
219 | { | ||
220 | if (hrow.Length == 0) hrow = pair.Key.ToString(); | ||
221 | else hrow += "," + pair.Key.ToString(); | ||
222 | } | ||
223 | if (row.Length == 0) row = pair.Value.ToString(); | ||
224 | else row += "," + pair.Value.ToString(); | ||
225 | } | ||
226 | } | ||
227 | if (header && useHeader) | ||
228 | { | ||
229 | File.AppendAllText(Filename + e.WebTest.Context.WebTestUserId + ".log", hrow + "\r\n"); | ||
230 | header = false; | ||
231 | } | ||
232 | File.AppendAllText(Filename + e.WebTest.Context.WebTestUserId + ".log", row + "\r\n"); | ||
233 | base.PostWebTest(sender, e); | ||
234 | } | ||
235 | } | ||
236 | } | ||
237 | |||
238 | [DisplayName("Multi Regular Expression"), Description("Saves all matches for a regular expression including a count")] | ||
239 | public class MultiRegExExtract : ExtractionRule | ||
240 | { | ||
241 | [DisplayName("Regular Expression"), Description("The RegEx to use, supports grouping, for example (.+?)")] | ||
242 | public String Regex { get; set; } | ||
243 | |||
244 | [DisplayName("Group Name"), DefaultValue("1"), Description("The group to use as the value for the parameter, default is 1")] | ||
245 | public String GroupName { get; set; } | ||
246 | |||
247 | [DisplayName("Pass if not found"), DefaultValue(false), Description("Wherever this extration rule should pass even if no matches are found. Default false.")] | ||
248 | public bool PassIfNotFound { get; set; } | ||
249 | |||
250 | public override void Extract(object sender, ExtractionEventArgs e) | ||
251 | { | ||
252 | MatchCollection matches = System.Text.RegularExpressions.Regex.Matches( | ||
253 | e.Response.BodyString, | ||
254 | Regex, | ||
255 | RegexOptions.IgnoreCase); | ||
256 | int index = 0; | ||
257 | foreach (Match match in matches) | ||
258 | { | ||
259 | index++; | ||
260 | e.WebTest.Context[ContextParameterName + "_" + index] = match.Groups[GroupName].Value; | ||
261 | } | ||
262 | if (index > 0) | ||
263 | { | ||
264 | e.WebTest.Context[ContextParameterName + "_count"] = index.ToString(); | ||
265 | e.Success = true; | ||
266 | e.Message = "Found " + index + " matches"; | ||
267 | } | ||
268 | else | ||
269 | { | ||
270 | e.WebTest.Context[ContextParameterName + "_count"] = index.ToString(); | ||
271 | e.Success = PassIfNotFound; | ||
272 | e.Message = "No matches found. Body size is " + e.Response.BodyString.Length; | ||
273 | } | ||
274 | } | ||
275 | } | ||
276 | |||
277 | [DisplayName("Extract Count"), Description("Counts all matches for a given RegEx and saves the count to the specified parameter")] | ||
278 | public class ExtractCount : ExtractionRule | ||
279 | { | ||
280 | [DisplayName("Regular Expression"), Description("The RegEx to use")] | ||
281 | public String Regex { get; set; } | ||
282 | |||
283 | [DisplayName("Fail on zero count"), DefaultValue(false), Description("Wherever this extration rule should fail if no matches are found")] | ||
284 | public bool FailOnZero { get; set; } | ||
285 | |||
286 | public override void Extract(object sender, ExtractionEventArgs e) | ||
287 | { | ||
288 | MatchCollection matches = System.Text.RegularExpressions.Regex.Matches( | ||
289 | e.Response.BodyString, | ||
290 | Regex, | ||
291 | RegexOptions.IgnoreCase); | ||
292 | |||
293 | e.WebTest.Context[ContextParameterName] = matches.Count.ToString(); | ||
294 | e.Message = "Found " + matches.Count + " matches"; | ||
295 | if (FailOnZero && matches.Count == 0) | ||
296 | { | ||
297 | e.Success = false; | ||
298 | } | ||
299 | } | ||
300 | } | ||
301 | |||
302 | [DisplayName("Regular Expression Loop"), Description("Loop Condition that matches once on each regexp in previous response body")] | ||
303 | public class RegExpLoop : ConditionalRule | ||
304 | { | ||
305 | private Int32 CurrentMatch { get; set; } | ||
306 | private String LastUrl { get; set; } | ||
307 | private MatchCollection Matches { get; set; } | ||
308 | |||
309 | [DisplayName("Context parameter"), IsContextParameterName(true), | ||
310 | Description("Name of context parameter where the current value should be set in each loop")] | ||
311 | public string ContextParameterName { get; set; } | ||
312 | |||
313 | [DisplayName("Regex"), Description("The RegEx to use, supports grouping, for example (.+?)")] | ||
314 | public String Regex { get; set; } | ||
315 | |||
316 | [DisplayName("GroupName"), Description("The group to use as the value for the parameter if several are specified, default is 1")] | ||
317 | public String GroupName { get; set; } | ||
318 | |||
319 | // Methods | ||
320 | public override void CheckCondition(object sender, ConditionalEventArgs e) | ||
321 | { | ||
322 | if (CurrentMatch < Matches.Count) | ||
323 | { | ||
324 | e.WebTest.Context[ContextParameterName] = | ||
325 | Matches[CurrentMatch].Groups[GroupName].Value; | ||
326 | e.IsMet = true; | ||
327 | CurrentMatch++; | ||
328 | return; | ||
329 | } | ||
330 | |||
331 | e.IsMet = false; | ||
332 | } | ||
333 | |||
334 | public override void Initialize(object sender, ConditionalEventArgs e) | ||
335 | { | ||
336 | CurrentMatch = 0; | ||
337 | Matches = System.Text.RegularExpressions.Regex.Matches( | ||
338 | e.WebTest.LastResponse.BodyString, | ||
339 | Regex, | ||
340 | RegexOptions.IgnoreCase); | ||
341 | } | ||
342 | |||
343 | public override string StringRepresentation() | ||
344 | { | ||
345 | return "Regex condition " + Regex; | ||
346 | } | ||
347 | } | ||
348 | } |
LIL_VSTT_Plugins/ValidationRules.cs
0 → 100644
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Linq; | ||
4 | using System.Text; | ||
5 | using System.Net; | ||
6 | using Microsoft.VisualStudio.TestTools.WebTesting; | ||
7 | using Microsoft.VisualStudio.TestTools.LoadTesting; | ||
8 | using System.IO; | ||
9 | using System.ComponentModel; | ||
10 | using System.Text.RegularExpressions; | ||
11 | |||
12 | namespace LIL_VSTT_Plugins | ||
13 | { | ||
14 | /// <summary> | ||
15 | /// Count Validation | ||
16 | /// Räknar hur många gånger ett visst reguljärt utryck finns i svaret och validerar detta | ||
17 | /// </summary> | ||
18 | [DisplayName("Count Validation")] | ||
19 | [Description("(C) Copyright 2011 LIGHTS IN LINE AB\r\nValiderar att ett reguljärt utryck finns minst ett visst antal gånger i svaret, eller inte.")] | ||
20 | public class CountValidation : ValidationRule | ||
21 | { | ||
22 | [DisplayName("RegEx"), Description("Regular Expression to match on the response.")] | ||
23 | public String RegEx { get; set; } | ||
24 | |||
25 | [DisplayName("Condition"), Description("Valid conditions are =,>,<,>=,<=")] | ||
26 | [DefaultValue("=")] | ||
27 | public String myCon { get; set; } | ||
28 | |||
29 | [DisplayName("Count"), Description("Expected count of occurences")] | ||
30 | public int Count { get; set; } | ||
31 | |||
32 | [DisplayName("Pass"), Description("Pass or fail if count matches. True passes if the count matches, False fails if the count matches")] | ||
33 | [DefaultValue(true)] | ||
34 | public bool Pass { get; set; } | ||
35 | |||
36 | public override void Validate(object sender, ValidationEventArgs e) | ||
37 | { | ||
38 | MatchCollection matches = System.Text.RegularExpressions.Regex.Matches( | ||
39 | e.Response.BodyString, | ||
40 | RegEx, | ||
41 | RegexOptions.IgnoreCase); | ||
42 | |||
43 | switch (myCon) { | ||
44 | case "=": | ||
45 | if (matches.Count == Count) { e.IsValid = Pass; e.Message = "Number of matches equal to count. Valid set to " + Pass.ToString(); } | ||
46 | break; | ||
47 | case "<": | ||
48 | if (matches.Count < Count) { e.IsValid = Pass; e.Message = "Number of matches less than count. Valid set to " + Pass.ToString(); } | ||
49 | break; | ||
50 | case ">": | ||
51 | if (matches.Count > Count) { e.IsValid = Pass; e.Message = "Number of matches higher than count. Valid set to " + Pass.ToString(); } | ||
52 | break; | ||
53 | case "<=": | ||
54 | if (matches.Count <= Count) { e.IsValid = Pass; e.Message = "Number of matches less or equal to count. Valid set to " + Pass.ToString(); } | ||
55 | break; | ||
56 | case ">=": | ||
57 | if (matches.Count >= Count) { e.IsValid = Pass; e.Message = "Number of matches higher or equal to count. Valid set to " + Pass.ToString(); } | ||
58 | break; | ||
59 | default: | ||
60 | e.IsValid = true; e.Message = "Invalid condition specified. Validation will pass."; | ||
61 | break; | ||
62 | } | ||
63 | } | ||
64 | } | ||
65 | } | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
LIL_VSTT_Plugins/WebTestPlugins.cs
0 → 100644
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Linq; | ||
4 | using System.Text; | ||
5 | using System.Net; | ||
6 | using Microsoft.VisualStudio.TestTools.WebTesting; | ||
7 | using Microsoft.VisualStudio.TestTools.LoadTesting; | ||
8 | using System.IO; | ||
9 | using System.ComponentModel; | ||
10 | |||
11 | namespace LIL_VSTT_Plugins | ||
12 | { | ||
13 | |||
14 | |||
15 | /// <summary> | ||
16 | /// Datasource Unique Once | ||
17 | /// </summary> | ||
18 | [DisplayName("Datasource Unique Once")] | ||
19 | [Description("(C) Copyright 2011 LIGHTS IN LINE AB\r\nOBS! Läs hela! Styr datasource selection till att endast göras en gång per VU. Du måste ändra i din datasource Access Metod till Do Not Move Automatically! WebTestUserId används för att välja rad. Använder de datasources som finns definerade i webtestet. Använd test mix based on users starting tests samt 0 percent new users.")] | ||
20 | public class UniqueOnce : WebTestPlugin | ||
21 | { | ||
22 | string dataSourceName; | ||
23 | string dataTableName; | ||
24 | int offset; | ||
25 | |||
26 | [DisplayName("Datakällans namn")] | ||
27 | [Description("Ange namnet på datakällan i ditt webtest, tex DataSource1")] | ||
28 | [DefaultValue("DataSource1")] | ||
29 | public string DataSourceName | ||
30 | { | ||
31 | get { return dataSourceName; } | ||
32 | set { dataSourceName = value; } | ||
33 | } | ||
34 | |||
35 | [DisplayName("Tabellens namn")] | ||
36 | [Description("Ange namnet på den tabell som ska användas, tex Userdata#csv")] | ||
37 | public string DataSourceTableName | ||
38 | { | ||
39 | get { return dataTableName; } | ||
40 | set { dataTableName = value; } | ||
41 | } | ||
42 | |||
43 | [DisplayName("Offset")] | ||
44 | [Description("Används för att hoppa över ett visst antal rader från början på datakällan så de inte används.")] | ||
45 | [DefaultValue(0)] | ||
46 | public int Offset | ||
47 | { | ||
48 | get { return offset; } | ||
49 | set { offset = value; } | ||
50 | } | ||
51 | |||
52 | public override void PreWebTest(object sender, PreWebTestEventArgs e) | ||
53 | { | ||
54 | base.PreWebTest(sender, e); | ||
55 | int index = e.WebTest.Context.WebTestUserId + offset; | ||
56 | e.WebTest.MoveDataTableCursor(dataSourceName, dataTableName, index); | ||
57 | e.WebTest.AddCommentToResult("Selected row number " + index + " from datasource " + dataSourceName + " and table " + dataTableName + "."); | ||
58 | } | ||
59 | } | ||
60 | |||
61 | /// <summary> | ||
62 | /// Filtrar bort oönskade objekt från sidor. | ||
63 | /// Samtliga objekt vars URL börjar med den angivna strängen kommer ignoreras och inte laddas ner. | ||
64 | /// </summary> | ||
65 | [DisplayName("Dynamisk URL exclude filter")] | ||
66 | [Description("(C) Copyright 2011 LIGHTS IN LINE AB\r\nFilter för att ignorera vissa objekt på websidor så de inte laddas ner automatiskt.")] | ||
67 | public class WebTestDependentFilter : WebTestPlugin | ||
68 | { | ||
69 | string m_startsWith; | ||
70 | |||
71 | /// <summary> | ||
72 | /// Fullständig URL (inkl http://) som börjar med FilterString kommer att ignoreras. | ||
73 | |||
74 | [DisplayName("URL börjar med")] | ||
75 | [Description("Dynamiska (dependent) objekt som hittas kommer endast att laddas ner om de INTE börjar med denna sträng.\r\nTex: https://www.excludedsite.com")] | ||
76 | public string FilterString | ||
77 | { | ||
78 | get { return m_startsWith; } | ||
79 | set { m_startsWith = value; } | ||
80 | } | ||
81 | |||
82 | public override void PostRequest(object sender, PostRequestEventArgs e) | ||
83 | { | ||
84 | WebTestRequestCollection depsToRemove = new WebTestRequestCollection(); | ||
85 | Boolean hasRun = false; | ||
86 | |||
87 | foreach (WebTestRequest r in e.Request.DependentRequests) | ||
88 | { | ||
89 | if (!string.IsNullOrEmpty(m_startsWith) && | ||
90 | r.Url.StartsWith(m_startsWith)) | ||
91 | { | ||
92 | depsToRemove.Add(r); | ||
93 | hasRun = true; | ||
94 | } | ||
95 | } | ||
96 | foreach (WebTestRequest r in depsToRemove) | ||
97 | { | ||
98 | e.Request.DependentRequests.Remove(r); | ||
99 | } | ||
100 | |||
101 | if (hasRun) | ||
102 | { | ||
103 | //e.WebTest.AddCommentToResult("WebTestDependentFilter has run"); | ||
104 | } | ||
105 | } | ||
106 | } | ||
107 | |||
108 | /// <summary> | ||
109 | /// Filtrar bort oönskade objekt från sidor. | ||
110 | /// Samtliga objekt vars URL börjar med den angivna strängen kommer ignoreras och inte laddas ner. | ||
111 | /// </summary> | ||
112 | [DisplayName("Dynamisk URL include filter")] | ||
113 | [Description("(C) Copyright 2011 LIGHTS IN LINE AB\r\nFilter för att ignorera vissa objekt på websidor så de inte laddas ner automatiskt.")] | ||
114 | public class WebTestDependentIncludeFilter : WebTestPlugin | ||
115 | { | ||
116 | string m_startsWith; | ||
117 | |||
118 | /// <summary> | ||
119 | /// Fullständig URL (inkl http://) som börjar med FilterString kommer att ignoreras. | ||
120 | |||
121 | [DisplayName("URL börjar med")] | ||
122 | [Description("Alla dynamiska (dependent) objekt som hittas kommer endast att laddas ner OM DE BÖRJAR med denna sträng.\r\nTex: https://www.onlythissite.com")] | ||
123 | public string FilterString | ||
124 | { | ||
125 | get { return m_startsWith; } | ||
126 | set { m_startsWith = value; } | ||
127 | } | ||
128 | |||
129 | public override void PostRequest(object sender, PostRequestEventArgs e) | ||
130 | { | ||
131 | WebTestRequestCollection depsToRemove = new WebTestRequestCollection(); | ||
132 | Boolean hasRun = false; | ||
133 | |||
134 | foreach (WebTestRequest r in e.Request.DependentRequests) | ||
135 | { | ||
136 | if (!string.IsNullOrEmpty(m_startsWith) && | ||
137 | !r.Url.StartsWith(m_startsWith)) | ||
138 | { | ||
139 | depsToRemove.Add(r); | ||
140 | hasRun = true; | ||
141 | } | ||
142 | } | ||
143 | foreach (WebTestRequest r in depsToRemove) | ||
144 | { | ||
145 | e.Request.DependentRequests.Remove(r); | ||
146 | } | ||
147 | |||
148 | if (hasRun) | ||
149 | { | ||
150 | //e.WebTest.AddCommentToResult("WebTestDependentFilter has run"); | ||
151 | } | ||
152 | } | ||
153 | } | ||
154 | |||
155 | |||
156 | |||
157 | /// <summary> | ||
158 | /// WebTest plugin som tar bort expected-100 headern från post requests | ||
159 | /// Beta | ||
160 | /// </summary> | ||
161 | [DisplayName("Expect 100 Off")] | ||
162 | [Description("(C) Copyright 2011 LIGHTS IN LINE AB\r\nStänger av .NET expected-100 headern i posts.")] | ||
163 | public class expect100Off : WebTestPlugin | ||
164 | { | ||
165 | public override void PreWebTest(object sender, PreWebTestEventArgs e) | ||
166 | { | ||
167 | base.PreWebTest(sender, e); | ||
168 | System.Net.ServicePointManager.Expect100Continue = false; | ||
169 | System.Net.ServicePointManager.MaxServicePointIdleTime = 30; | ||
170 | } | ||
171 | } | ||
172 | |||
173 | /// <summary> | ||
174 | /// WebTest Plugin Template | ||
175 | /// </summary> | ||
176 | [DisplayName("Randomize each page")] | ||
177 | [Description("(C) Copyright 2011 LIGHTS IN LINE AB\r\nVäljer en ny slumpmässig rad i din datasource vid varje sida/page i skriptet.")] | ||
178 | public class randomOnEachPage : WebTestPlugin | ||
179 | { | ||
180 | string dataSourceName; | ||
181 | string dataTableName; | ||
182 | int datasourceSize = 0; | ||
183 | Random RandomNumber = new Random(System.DateTime.Now.Millisecond); | ||
184 | |||
185 | [DisplayName("Datakällans namn")] | ||
186 | [Description("Ange namnet på datakällan i ditt webtest, tex DataSource1")] | ||
187 | [DefaultValue("DataSource1")] | ||
188 | public string DataSourceName | ||
189 | { | ||
190 | get { return dataSourceName; } | ||
191 | set { dataSourceName = value; } | ||
192 | } | ||
193 | |||
194 | [DisplayName("Tabellens namn")] | ||
195 | [Description("Ange namnet på den tabell som ska användas, tex Userdata#csv")] | ||
196 | public string DataSourceTableName | ||
197 | { | ||
198 | get { return dataTableName; } | ||
199 | set { dataTableName = value; } | ||
200 | } | ||
201 | |||
202 | public override void PrePage(object sender, PrePageEventArgs e) | ||
203 | { | ||
204 | base.PrePage(sender, e); | ||
205 | if (datasourceSize == 0) { | ||
206 | int size = e.WebTest.GetDataTableRowCount(dataSourceName, dataTableName); | ||
207 | if(size > 0) | ||
208 | datasourceSize = size; | ||
209 | else | ||
210 | return; | ||
211 | } | ||
212 | if (datasourceSize > 0) | ||
213 | { | ||
214 | int index = RandomNumber.Next(0, datasourceSize - 1); | ||
215 | e.WebTest.MoveDataTableCursor(dataSourceName, dataTableName, index); | ||
216 | //e.WebTest.AddCommentToResult("Selected row number " + index + " from datasource " + dataSourceName + " and table " + dataTableName + "."); | ||
217 | } | ||
218 | } | ||
219 | } | ||
220 | |||
221 | |||
222 | ///<summary> | ||
223 | ///WebTest Plugin Data Generator | ||
224 | ///</summary> | ||
225 | [DisplayName("Data Generator Timestamp")] | ||
226 | [Description("(C) Copyright 2011 LIGHTS IN LINE AB\r\nGenererar en timestamp som context parameter")] | ||
227 | public class dataGenTimestamp : WebTestPlugin | ||
228 | { | ||
229 | private string paramName; | ||
230 | [DisplayName("Parameter namn")] | ||
231 | [Description("Ange namnet på parametern i ditt webtest, tex TimeStampParameter1")] | ||
232 | [DefaultValue("TimeStampParameter1")] | ||
233 | public string ParamNameVal | ||
234 | { | ||
235 | get { return paramName; } | ||
236 | set { paramName = value; } | ||
237 | } | ||
238 | |||
239 | private bool millis = false; | ||
240 | [DisplayName("Använd millisekunder")] | ||
241 | [Description("Sätt till true om du vill ha värdet i millisekunder istället för sekunder.")] | ||
242 | [DefaultValue(false)] | ||
243 | public bool MillisecondsVal | ||
244 | { | ||
245 | get { return millis; } | ||
246 | set { millis = value; } | ||
247 | } | ||
248 | |||
249 | private bool prePage = false; | ||
250 | [DisplayName("Uppdatera på varje Page")] | ||
251 | [Description("Sätt till true om du vill ha värdet uppdaterat inför varje ny sida som laddas i testet.")] | ||
252 | [DefaultValue(false)] | ||
253 | public bool PrePageVal | ||
254 | { | ||
255 | get { return prePage; } | ||
256 | set { prePage = value; } | ||
257 | } | ||
258 | |||
259 | private bool preTrans = false; | ||
260 | [DisplayName("Uppdatera på varje Transaktion")] | ||
261 | [Description("Sätt till true om du vill ha värdet uppdaterat inför varje ny transaktion i testet.")] | ||
262 | [DefaultValue(false)] | ||
263 | public bool PreTransactionVal | ||
264 | { | ||
265 | get { return preTrans; } | ||
266 | set { preTrans = value; } | ||
267 | } | ||
268 | |||
269 | private bool preReq = false; | ||
270 | [DisplayName("Uppdatera på varje Request")] | ||
271 | [Description("Sätt till true om du vill ha värdet uppdaterat inför varje nytt request i testet.")] | ||
272 | [DefaultValue(false)] | ||
273 | public bool PreRequestVal | ||
274 | { | ||
275 | get { return preReq; } | ||
276 | set { preReq = value; } | ||
277 | } | ||
278 | |||
279 | public override void PreWebTest(object sender, PreWebTestEventArgs e) | ||
280 | { | ||
281 | update(e.WebTest.Context); | ||
282 | base.PreWebTest(sender, e); | ||
283 | } | ||
284 | |||
285 | public override void PrePage(object sender, PrePageEventArgs e) | ||
286 | { | ||
287 | if (prePage) update(e.WebTest.Context); | ||
288 | base.PrePage(sender, e); | ||
289 | } | ||
290 | |||
291 | public override void PreRequestDataBinding(object sender, PreRequestDataBindingEventArgs e) | ||
292 | { | ||
293 | if (preReq) update(e.WebTest.Context); | ||
294 | base.PreRequestDataBinding(sender, e); | ||
295 | } | ||
296 | |||
297 | public override void PreTransaction(object sender, PreTransactionEventArgs e) | ||
298 | { | ||
299 | if (preTrans) update(e.WebTest.Context); | ||
300 | base.PreTransaction(sender, e); | ||
301 | } | ||
302 | |||
303 | private void update(WebTestContext context) | ||
304 | { | ||
305 | TimeSpan span = (DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc)); | ||
306 | if (millis) context[paramName] = ((Int64) span.TotalMilliseconds).ToString(); | ||
307 | else context[paramName] = ((Int64) span.TotalSeconds).ToString(); | ||
308 | } | ||
309 | } | ||
310 | |||
311 | |||
312 | /* | ||
313 | /// <summary> | ||
314 | /// WebTest Plugin Template | ||
315 | /// </summary> | ||
316 | [DisplayName("Plugin Namn")] | ||
317 | [Description("(C) Copyright 2011 LIGHTS IN LINE AB\r\nFörklaring")] | ||
318 | public class myPlugin : WebTestPlugin | ||
319 | { | ||
320 | public override void PreWebTest(object sender, PreWebTestEventArgs e) | ||
321 | { | ||
322 | base.PreWebTest(sender, e); | ||
323 | e.WebTest.Context.CookieContainer = new myCookieContainer(); | ||
324 | } | ||
325 | } | ||
326 | */ | ||
327 | |||
328 | } |
Local.testsettings
0 → 100644
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <TestSettings name="Local" id="f9146b42-ca07-41ed-9af4-6ec2afc90583" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010"> | ||
3 | <Description>These are default test settings for a local test run.</Description> | ||
4 | <Deployment enabled="false" /> | ||
5 | <Execution> | ||
6 | <TestTypeSpecific /> | ||
7 | <AgentRule name="Execution Agents"> | ||
8 | </AgentRule> | ||
9 | </Execution> | ||
10 | </TestSettings> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
TestProject1/LoadTest1.loadtest
0 → 100644
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <LoadTest Name="LoadTest1" Description="" Owner="" storage="c:\users\gerdes\documents\visual studio 2010\lil_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> | ||
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" /> | ||
6 | <LoadProfile Pattern="Constant" InitialUsers="10" /> | ||
7 | <TestMix> | ||
8 | <TestProfile Name="WebTest1" Path="webtest1.webtest" Id="c649760b-6dd8-4210-8a6d-3c6596d08668" Percentage="100" Type="Microsoft.VisualStudio.TestTools.WebStress.DeclarativeWebTestElement, Microsoft.VisualStudio.QualityTools.LoadTest, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> | ||
9 | </TestMix> | ||
10 | <BrowserMix> | ||
11 | <BrowserProfile Percentage="100"> | ||
12 | <Browser Name="Internet Explorer 7.0" MaxConnections="2"> | ||
13 | <Headers> | ||
14 | <Header Name="User-Agent" Value="Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)" /> | ||
15 | <Header Name="Accept" Value="*/*" /> | ||
16 | <Header Name="Accept-Language" Value="{{$IEAcceptLanguage}}" /> | ||
17 | <Header Name="Accept-Encoding" Value="GZIP" /> | ||
18 | </Headers> | ||
19 | </Browser> | ||
20 | </BrowserProfile> | ||
21 | </BrowserMix> | ||
22 | <NetworkMix> | ||
23 | <NetworkProfile Percentage="100"> | ||
24 | <Network Name="LAN" BandwidthInKbps="1000000" NetworkProfileConfigurationXml="<Emulation><VirtualChannel name="defaultChannel"><FilterList/><VirtualLink instances="1" name="defaultLink"><LinkRule dir="upstream"><Bandwidth><Speed unit="kbps">1000000</Speed></Bandwidth></LinkRule><LinkRule dir="downstream"><Bandwidth><Speed unit="kbps">1000000</Speed></Bandwidth></LinkRule></VirtualLink></VirtualChannel></Emulation>" /> | ||
25 | </NetworkProfile> | ||
26 | </NetworkMix> | ||
27 | </Scenario> | ||
28 | </Scenarios> | ||
29 | <CounterSets> | ||
30 | <CounterSet Name="LoadTest" CounterSetType="LoadTest" LocId=""> | ||
31 | <CounterCategories> | ||
32 | <CounterCategory Name="LoadTest:Scenario"> | ||
33 | <Counters> | ||
34 | <Counter Name="User Load" HigherIsBetter="true" /> | ||
35 | <Counter Name="Tests Running" HigherIsBetter="true" /> | ||
36 | </Counters> | ||
37 | </CounterCategory> | ||
38 | <CounterCategory Name="LoadTest:Test"> | ||
39 | <Counters> | ||
40 | <Counter Name="Total Tests" HigherIsBetter="true" /> | ||
41 | <Counter Name="Passed Tests" HigherIsBetter="true" /> | ||
42 | <Counter Name="Failed Tests" /> | ||
43 | <Counter Name="Tests/Sec" HigherIsBetter="true" /> | ||
44 | <Counter Name="Passed Tests/Sec" HigherIsBetter="true" /> | ||
45 | <Counter Name="Failed Tests/Sec" /> | ||
46 | <Counter Name="Avg. Requests/Test" HigherIsBetter="true" /> | ||
47 | <Counter Name="Avg. Test Time" /> | ||
48 | <Counter Name="% Time in LoadTestPlugin" /> | ||
49 | <Counter Name="% Time in WebTest code" /> | ||
50 | <Counter Name="% Time in Rules" /> | ||
51 | </Counters> | ||
52 | </CounterCategory> | ||
53 | <CounterCategory Name="LoadTest:Transaction"> | ||
54 | <Counters> | ||
55 | <Counter Name="Total Transactions" HigherIsBetter="true" /> | ||
56 | <Counter Name="Avg. Transaction Time" /> | ||
57 | <Counter Name="Avg. Response Time" /> | ||
58 | <Counter Name="Transactions/Sec" HigherIsBetter="true" /> | ||
59 | </Counters> | ||
60 | </CounterCategory> | ||
61 | <CounterCategory Name="LoadTest:Errors"> | ||
62 | <Counters> | ||
63 | <Counter Name="Http Errors" /> | ||
64 | <Counter Name="Validation Rule Errors" /> | ||
65 | <Counter Name="Extraction Rule Errors" /> | ||
66 | <Counter Name="Requests Timed Out" /> | ||
67 | <Counter Name="Exceptions" /> | ||
68 | <Counter Name="Total Errors" /> | ||
69 | <Counter Name="Errors/Sec" /> | ||
70 | <Counter Name="Threshold Violations/Sec" /> | ||
71 | </Counters> | ||
72 | </CounterCategory> | ||
73 | <CounterCategory Name="LoadTest:Page"> | ||
74 | <Counters> | ||
75 | <Counter Name="Total Pages" HigherIsBetter="true" /> | ||
76 | <Counter Name="Avg. Page Time" /> | ||
77 | <Counter Name="Page Response Time Goal" HigherIsBetter="true" /> | ||
78 | <Counter Name="% Pages Meeting Goal" HigherIsBetter="true" /> | ||
79 | <Counter Name="Pages/Sec" HigherIsBetter="true" /> | ||
80 | </Counters> | ||
81 | </CounterCategory> | ||
82 | <CounterCategory Name="LoadTest:Request"> | ||
83 | <Counters> | ||
84 | <Counter Name="Total Requests" HigherIsBetter="true" /> | ||
85 | <Counter Name="Passed Requests" HigherIsBetter="true" /> | ||
86 | <Counter Name="Failed Requests" /> | ||
87 | <Counter Name="Cached Requests" HigherIsBetter="true" /> | ||
88 | <Counter Name="Requests/Sec" HigherIsBetter="true" /> | ||
89 | <Counter Name="Passed Requests/Sec" HigherIsBetter="true" /> | ||
90 | <Counter Name="Failed Requests/Sec" /> | ||
91 | <Counter Name="Avg. First Byte Time" /> | ||
92 | <Counter Name="Avg. Response Time" /> | ||
93 | <Counter Name="Avg. Connection Wait Time"> | ||
94 | <ThresholdRules> | ||
95 | <ThresholdRule Classname="Microsoft.VisualStudio.TestTools.WebStress.Rules.ThresholdRuleCompareCounters, Microsoft.VisualStudio.QualityTools.LoadTest, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> | ||
96 | <RuleParameters> | ||
97 | <RuleParameter Name="DependentCategory" Value="LoadTest:Page" /> | ||
98 | <RuleParameter Name="DependentCounter" Value="Avg. Page Time" /> | ||
99 | <RuleParameter Name="DependentInstance" Value="_Total" /> | ||
100 | <RuleParameter Name="AlertIfOver" Value="True" /> | ||
101 | <RuleParameter Name="WarningThreshold" Value="0.25" /> | ||
102 | <RuleParameter Name="CriticalThreshold" Value="0.5" /> | ||
103 | </RuleParameters> | ||
104 | </ThresholdRule> | ||
105 | </ThresholdRules> | ||
106 | </Counter> | ||
107 | <Counter Name="Avg. Content Length" /> | ||
108 | </Counters> | ||
109 | </CounterCategory> | ||
110 | <CounterCategory Name="LoadTest:LogEntries"> | ||
111 | <Counters> | ||
112 | <Counter Name="Total Log Entries" /> | ||
113 | <Counter Name="Log Entries/Sec" /> | ||
114 | </Counters> | ||
115 | </CounterCategory> | ||
116 | </CounterCategories> | ||
117 | </CounterSet> | ||
118 | <CounterSet Name="Controller" CounterSetType="Controller" LocId="CounterSet_Controller"> | ||
119 | <CounterCategories> | ||
120 | <CounterCategory Name="Memory"> | ||
121 | <Counters> | ||
122 | <Counter Name="% Committed Bytes In Use" Range="100" /> | ||
123 | <Counter Name="Available MBytes" RangeGroup="Memory Bytes" HigherIsBetter="true"> | ||
124 | <ThresholdRules> | ||
125 | <ThresholdRule Classname="Microsoft.VisualStudio.TestTools.WebStress.Rules.ThresholdRuleCompareConstant, Microsoft.VisualStudio.QualityTools.LoadTest"> | ||
126 | <RuleParameters> | ||
127 | <RuleParameter Name="AlertIfOver" Value="False" /> | ||
128 | <RuleParameter Name="WarningThreshold" Value="100" /> | ||
129 | <RuleParameter Name="CriticalThreshold" Value="50" /> | ||
130 | </RuleParameters> | ||
131 | </ThresholdRule> | ||
132 | </ThresholdRules> | ||
133 | </Counter> | ||
134 | <Counter Name="Page Faults/sec" /> | ||
135 | <Counter Name="Pages/sec" /> | ||
136 | <Counter Name="Pool Paged Bytes" RangeGroup="Memory Bytes" /> | ||
137 | <Counter Name="Pool Nonpaged bytes" RangeGroup="Memory Bytes" /> | ||
138 | </Counters> | ||
139 | </CounterCategory> | ||
140 | <CounterCategory Name="Network Interface"> | ||
141 | <Counters> | ||
142 | <Counter Name="Bytes Received/sec" RangeGroup="Network Bytes" /> | ||
143 | <Counter Name="Bytes Sent/sec" RangeGroup="Network Bytes" /> | ||
144 | <Counter Name="Output Queue Length"> | ||
145 | <ThresholdRules> | ||
146 | <ThresholdRule Classname="Microsoft.VisualStudio.TestTools.WebStress.Rules.ThresholdRuleCompareConstant, Microsoft.VisualStudio.QualityTools.LoadTest"> | ||
147 | <RuleParameters> | ||
148 | <RuleParameter Name="AlertIfOver" Value="True" /> | ||
149 | <RuleParameter Name="WarningThreshold" Value="1.5" /> | ||
150 | <RuleParameter Name="CriticalThreshold" Value="2" /> | ||
151 | </RuleParameters> | ||
152 | </ThresholdRule> | ||
153 | </ThresholdRules> | ||
154 | </Counter> | ||
155 | <Counter Name="Packets Received/sec" RangeGroup="Network Packets" /> | ||
156 | <Counter Name="Packets Sent/sec" RangeGroup="Network Packets" /> | ||
157 | <Counter Name="Current Bandwidth" RangeGroup="Network Bytes" /> | ||
158 | <Counter Name="Bytes Total/sec" RangeGroup="Network Bytes"> | ||
159 | <ThresholdRules> | ||
160 | <ThresholdRule Classname="Microsoft.VisualStudio.TestTools.WebStress.Rules.ThresholdRuleCompareCounters, Microsoft.VisualStudio.QualityTools.LoadTest, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> | ||
161 | <RuleParameters> | ||
162 | <RuleParameter Name="DependentCategory" Value="Network Interface" /> | ||
163 | <RuleParameter Name="DependentCounter" Value="Current Bandwidth" /> | ||
164 | <RuleParameter Name="DependentInstance" Value="" /> | ||
165 | <RuleParameter Name="AlertIfOver" Value="True" /> | ||
166 | <RuleParameter Name="WarningThreshold" Value="0.6" /> | ||
167 | <RuleParameter Name="CriticalThreshold" Value="0.7" /> | ||
168 | </RuleParameters> | ||
169 | </ThresholdRule> | ||
170 | </ThresholdRules> | ||
171 | </Counter> | ||
172 | </Counters> | ||
173 | <Instances> | ||
174 | <Instance Name="*" /> | ||
175 | </Instances> | ||
176 | </CounterCategory> | ||
177 | <CounterCategory Name="PhysicalDisk"> | ||
178 | <Counters> | ||
179 | <Counter Name="% Disk Read Time" Range="100" /> | ||
180 | <Counter Name="% Disk Time" Range="100" /> | ||
181 | <Counter Name="% Disk Write Time" Range="100" /> | ||
182 | <Counter Name="% Idle Time" Range="100" HigherIsBetter="true"> | ||
183 | <ThresholdRules> | ||
184 | <ThresholdRule Classname="Microsoft.VisualStudio.TestTools.WebStress.Rules.ThresholdRuleCompareConstant, Microsoft.VisualStudio.QualityTools.LoadTest"> | ||
185 | <RuleParameters> | ||
186 | <RuleParameter Name="AlertIfOver" Value="False" /> | ||
187 | <RuleParameter Name="WarningThreshold" Value="40" /> | ||
188 | <RuleParameter Name="CriticalThreshold" Value="20" /> | ||
189 | </RuleParameters> | ||
190 | </ThresholdRule> | ||
191 | </ThresholdRules> | ||
192 | </Counter> | ||
193 | <Counter Name="Avg. Disk Bytes/Read" RangeGroup="DiskBytesRate" /> | ||
194 | <Counter Name="Avg. Disk Bytes/Transfer" RangeGroup="DiskBytesRate" /> | ||
195 | <Counter Name="Avg. Disk Bytes/Write" RangeGroup="DiskBytesRate" /> | ||
196 | <Counter Name="Avg. Disk Queue Length" RangeGroup="Disk Queue Length" /> | ||
197 | <Counter Name="Avg. Disk Read Queue Length" RangeGroup="Disk Queue Length" /> | ||
198 | <Counter Name="Avg. Disk Write Queue Length" RangeGroup="Disk Queue Length" /> | ||
199 | <Counter Name="Current Disk Queue Length" RangeGroup="Disk Queue Length" /> | ||
200 | <Counter Name="Avg. Disk sec/Read" RangeGroup="Disk sec" /> | ||
201 | <Counter Name="Avg. Disk sec/Transfer" RangeGroup="Disk sec" /> | ||
202 | <Counter Name="Avg. Disk sec/Write" RangeGroup="Disk sec" /> | ||
203 | <Counter Name="Disk Bytes/sec" RangeGroup="Disk Bytes sec" /> | ||
204 | <Counter Name="Disk Read Bytes/sec" RangeGroup="Disk Bytes sec" /> | ||
205 | <Counter Name="Disk Reads/sec" RangeGroup="Disk Transfers sec" /> | ||
206 | <Counter Name="Disk Transfers/sec" RangeGroup="Disk Transfers sec" /> | ||
207 | <Counter Name="Disk Write Bytes/sec" RangeGroup="Disk Bytes sec" /> | ||
208 | <Counter Name="Disk Writes/sec" RangeGroup="Disk Transfers sec" /> | ||
209 | <Counter Name="Split IO/Sec" RangeGroup="Disk Transfers sec" /> | ||
210 | </Counters> | ||
211 | <Instances> | ||
212 | <Instance Name="*" /> | ||
213 | </Instances> | ||
214 | </CounterCategory> | ||
215 | <CounterCategory Name="Processor"> | ||
216 | <Counters> | ||
217 | <Counter Name="% Processor Time" Range="100"> | ||
218 | <ThresholdRules> | ||
219 | <ThresholdRule Classname="Microsoft.VisualStudio.TestTools.WebStress.Rules.ThresholdRuleCompareConstant, Microsoft.VisualStudio.QualityTools.LoadTest"> | ||
220 | <RuleParameters> | ||
221 | <RuleParameter Name="AlertIfOver" Value="True" /> | ||
222 | <RuleParameter Name="WarningThreshold" Value="75" /> | ||
223 | <RuleParameter Name="CriticalThreshold" Value="90" /> | ||
224 | </RuleParameters> | ||
225 | </ThresholdRule> | ||
226 | </ThresholdRules> | ||
227 | </Counter> | ||
228 | <Counter Name="% Privileged Time" Range="100" /> | ||
229 | <Counter Name="% User Time" Range="100" /> | ||
230 | </Counters> | ||
231 | <Instances> | ||
232 | <Instance Name="_Total" /> | ||
233 | </Instances> | ||
234 | </CounterCategory> | ||
235 | <CounterCategory Name="System"> | ||
236 | <Counters> | ||
237 | <Counter Name="Context Switches/sec" /> | ||
238 | <Counter Name="Processes" /> | ||
239 | <Counter Name="Processor Queue Length" /> | ||
240 | <Counter Name="Threads" /> | ||
241 | </Counters> | ||
242 | </CounterCategory> | ||
243 | <CounterCategory Name="Process"> | ||
244 | <Counters> | ||
245 | <Counter Name="% Processor Time" RangeGroup="Processor Time" /> | ||
246 | <Counter Name="% Privileged Time" RangeGroup="Processor Time" /> | ||
247 | <Counter Name="% User Time" RangeGroup="Processor Time" /> | ||
248 | <Counter Name="Handle Count" /> | ||
249 | <Counter Name="Thread Count" /> | ||
250 | <Counter Name="Private Bytes" RangeGroup="Memory Bytes" /> | ||
251 | <Counter Name="Virtual Bytes" RangeGroup="Memory Bytes" /> | ||
252 | <Counter Name="Working Set" RangeGroup="Memory Bytes" /> | ||
253 | </Counters> | ||
254 | <Instances> | ||
255 | <Instance Name="QTController" /> | ||
256 | </Instances> | ||
257 | </CounterCategory> | ||
258 | </CounterCategories> | ||
259 | <DefaultCountersForAutomaticGraphs> | ||
260 | <DefaultCounter CategoryName="Processor" CounterName="% Processor Time" InstanceName="_Total" GraphName="" /> | ||
261 | <DefaultCounter CategoryName="Memory" CounterName="Available MBytes" InstanceName="" GraphName="" /> | ||
262 | </DefaultCountersForAutomaticGraphs> | ||
263 | </CounterSet> | ||
264 | <CounterSet Name="Agent" CounterSetType="Agent" LocId="CounterSet_Agent"> | ||
265 | <CounterCategories> | ||
266 | <CounterCategory Name="Memory"> | ||
267 | <Counters> | ||
268 | <Counter Name="% Committed Bytes In Use" Range="100" /> | ||
269 | <Counter Name="Available MBytes" RangeGroup="Memory Bytes" HigherIsBetter="true"> | ||
270 | <ThresholdRules> | ||
271 | <ThresholdRule Classname="Microsoft.VisualStudio.TestTools.WebStress.Rules.ThresholdRuleCompareConstant, Microsoft.VisualStudio.QualityTools.LoadTest"> | ||
272 | <RuleParameters> | ||
273 | <RuleParameter Name="AlertIfOver" Value="False" /> | ||
274 | <RuleParameter Name="WarningThreshold" Value="100" /> | ||
275 | <RuleParameter Name="CriticalThreshold" Value="50" /> | ||
276 | </RuleParameters> | ||
277 | </ThresholdRule> | ||
278 | </ThresholdRules> | ||
279 | </Counter> | ||
280 | <Counter Name="Page Faults/sec" /> | ||
281 | <Counter Name="Pages/sec" /> | ||
282 | <Counter Name="Pool Paged Bytes" RangeGroup="Memory Bytes" /> | ||
283 | <Counter Name="Pool Nonpaged bytes" RangeGroup="Memory Bytes" /> | ||
284 | </Counters> | ||
285 | </CounterCategory> | ||
286 | <CounterCategory Name="Network Interface"> | ||
287 | <Counters> | ||
288 | <Counter Name="Bytes Received/sec" RangeGroup="Network Bytes" /> | ||
289 | <Counter Name="Bytes Sent/sec" RangeGroup="Network Bytes" /> | ||
290 | <Counter Name="Output Queue Length"> | ||
291 | <ThresholdRules> | ||
292 | <ThresholdRule Classname="Microsoft.VisualStudio.TestTools.WebStress.Rules.ThresholdRuleCompareConstant, Microsoft.VisualStudio.QualityTools.LoadTest"> | ||
293 | <RuleParameters> | ||
294 | <RuleParameter Name="AlertIfOver" Value="True" /> | ||
295 | <RuleParameter Name="WarningThreshold" Value="1.5" /> | ||
296 | <RuleParameter Name="CriticalThreshold" Value="2" /> | ||
297 | </RuleParameters> | ||
298 | </ThresholdRule> | ||
299 | </ThresholdRules> | ||
300 | </Counter> | ||
301 | <Counter Name="Packets Received/sec" RangeGroup="Network Packets" /> | ||
302 | <Counter Name="Packets Sent/sec" RangeGroup="Network Packets" /> | ||
303 | <Counter Name="Current Bandwidth" RangeGroup="Network Bytes" /> | ||
304 | <Counter Name="Bytes Total/sec" RangeGroup="Network Bytes"> | ||
305 | <ThresholdRules> | ||
306 | <ThresholdRule Classname="Microsoft.VisualStudio.TestTools.WebStress.Rules.ThresholdRuleCompareCounters, Microsoft.VisualStudio.QualityTools.LoadTest, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> | ||
307 | <RuleParameters> | ||
308 | <RuleParameter Name="DependentCategory" Value="Network Interface" /> | ||
309 | <RuleParameter Name="DependentCounter" Value="Current Bandwidth" /> | ||
310 | <RuleParameter Name="DependentInstance" Value="" /> | ||
311 | <RuleParameter Name="AlertIfOver" Value="True" /> | ||
312 | <RuleParameter Name="WarningThreshold" Value="0.6" /> | ||
313 | <RuleParameter Name="CriticalThreshold" Value="0.7" /> | ||
314 | </RuleParameters> | ||
315 | </ThresholdRule> | ||
316 | </ThresholdRules> | ||
317 | </Counter> | ||
318 | </Counters> | ||
319 | <Instances> | ||
320 | <Instance Name="*" /> | ||
321 | </Instances> | ||
322 | </CounterCategory> | ||
323 | <CounterCategory Name="PhysicalDisk"> | ||
324 | <Counters> | ||
325 | <Counter Name="% Disk Read Time" Range="100" /> | ||
326 | <Counter Name="% Disk Time" Range="100" /> | ||
327 | <Counter Name="% Disk Write Time" Range="100" /> | ||
328 | <Counter Name="% Idle Time" Range="100" HigherIsBetter="true"> | ||
329 | <ThresholdRules> | ||
330 | <ThresholdRule Classname="Microsoft.VisualStudio.TestTools.WebStress.Rules.ThresholdRuleCompareConstant, Microsoft.VisualStudio.QualityTools.LoadTest"> | ||
331 | <RuleParameters> | ||
332 | <RuleParameter Name="AlertIfOver" Value="False" /> | ||
333 | <RuleParameter Name="WarningThreshold" Value="40" /> | ||
334 | <RuleParameter Name="CriticalThreshold" Value="20" /> | ||
335 | </RuleParameters> | ||
336 | </ThresholdRule> | ||
337 | </ThresholdRules> | ||
338 | </Counter> | ||
339 | <Counter Name="Avg. Disk Bytes/Read" RangeGroup="DiskBytesRate" /> | ||
340 | <Counter Name="Avg. Disk Bytes/Transfer" RangeGroup="DiskBytesRate" /> | ||
341 | <Counter Name="Avg. Disk Bytes/Write" RangeGroup="DiskBytesRate" /> | ||
342 | <Counter Name="Avg. Disk Queue Length" RangeGroup="Disk Queue Length" /> | ||
343 | <Counter Name="Avg. Disk Read Queue Length" RangeGroup="Disk Queue Length" /> | ||
344 | <Counter Name="Avg. Disk Write Queue Length" RangeGroup="Disk Queue Length" /> | ||
345 | <Counter Name="Current Disk Queue Length" RangeGroup="Disk Queue Length" /> | ||
346 | <Counter Name="Avg. Disk sec/Read" RangeGroup="Disk sec" /> | ||
347 | <Counter Name="Avg. Disk sec/Transfer" RangeGroup="Disk sec" /> | ||
348 | <Counter Name="Avg. Disk sec/Write" RangeGroup="Disk sec" /> | ||
349 | <Counter Name="Disk Bytes/sec" RangeGroup="Disk Bytes sec" /> | ||
350 | <Counter Name="Disk Read Bytes/sec" RangeGroup="Disk Bytes sec" /> | ||
351 | <Counter Name="Disk Reads/sec" RangeGroup="Disk Transfers sec" /> | ||
352 | <Counter Name="Disk Transfers/sec" RangeGroup="Disk Transfers sec" /> | ||
353 | <Counter Name="Disk Write Bytes/sec" RangeGroup="Disk Bytes sec" /> | ||
354 | <Counter Name="Disk Writes/sec" RangeGroup="Disk Transfers sec" /> | ||
355 | <Counter Name="Split IO/Sec" RangeGroup="Disk Transfers sec" /> | ||
356 | </Counters> | ||
357 | <Instances> | ||
358 | <Instance Name="*" /> | ||
359 | </Instances> | ||
360 | </CounterCategory> | ||
361 | <CounterCategory Name="Processor"> | ||
362 | <Counters> | ||
363 | <Counter Name="% Processor Time" Range="100"> | ||
364 | <ThresholdRules> | ||
365 | <ThresholdRule Classname="Microsoft.VisualStudio.TestTools.WebStress.Rules.ThresholdRuleCompareConstant, Microsoft.VisualStudio.QualityTools.LoadTest"> | ||
366 | <RuleParameters> | ||
367 | <RuleParameter Name="AlertIfOver" Value="True" /> | ||
368 | <RuleParameter Name="WarningThreshold" Value="75" /> | ||
369 | <RuleParameter Name="CriticalThreshold" Value="90" /> | ||
370 | </RuleParameters> | ||
371 | </ThresholdRule> | ||
372 | </ThresholdRules> | ||
373 | </Counter> | ||
374 | <Counter Name="% Privileged Time" Range="100" /> | ||
375 | <Counter Name="% User Time" Range="100" /> | ||
376 | </Counters> | ||
377 | <Instances> | ||
378 | <Instance Name="0" /> | ||
379 | <Instance Name="_Total" /> | ||
380 | </Instances> | ||
381 | </CounterCategory> | ||
382 | <CounterCategory Name="System"> | ||
383 | <Counters> | ||
384 | <Counter Name="Context Switches/sec" /> | ||
385 | <Counter Name="Processes" /> | ||
386 | <Counter Name="Processor Queue Length" /> | ||
387 | <Counter Name="Threads" /> | ||
388 | </Counters> | ||
389 | </CounterCategory> | ||
390 | <CounterCategory Name="Process"> | ||
391 | <Counters> | ||
392 | <Counter Name="% Processor Time" RangeGroup="Processor Time" /> | ||
393 | <Counter Name="% Privileged Time" RangeGroup="Processor Time" /> | ||
394 | <Counter Name="% User Time" RangeGroup="Processor Time" /> | ||
395 | <Counter Name="Handle Count" /> | ||
396 | <Counter Name="Thread Count" /> | ||
397 | <Counter Name="Private Bytes" RangeGroup="Memory Bytes" /> | ||
398 | <Counter Name="Virtual Bytes" RangeGroup="Memory Bytes" /> | ||
399 | <Counter Name="Working Set" RangeGroup="Memory Bytes" /> | ||
400 | </Counters> | ||
401 | <Instances> | ||
402 | <Instance Name="devenv" /> | ||
403 | <Instance Name="QTAgentService" /> | ||
404 | <Instance Name="QTAgent" /> | ||
405 | <Instance Name="QTAgent32" /> | ||
406 | <Instance Name="QTDCAgent" /> | ||
407 | <Instance Name="QTDCAgent32" /> | ||
408 | </Instances> | ||
409 | </CounterCategory> | ||
410 | </CounterCategories> | ||
411 | <DefaultCountersForAutomaticGraphs> | ||
412 | <DefaultCounter CategoryName="Processor" CounterName="% Processor Time" InstanceName="0" GraphName="" RunType="Local" /> | ||
413 | <DefaultCounter CategoryName="Processor" CounterName="% Processor Time" InstanceName="_Total" GraphName="" RunType="Remote" /> | ||
414 | <DefaultCounter CategoryName="Memory" CounterName="Available MBytes" InstanceName="" GraphName="" /> | ||
415 | </DefaultCountersForAutomaticGraphs> | ||
416 | </CounterSet> | ||
417 | </CounterSets> | ||
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="20" WebTestConnectionModel="ConnectionPerUser" WebTestConnectionPoolSize="50" SampleRate="5" ValidationLevel="High" SqlTracingConnectString="" SqlTracingConnectStringDisplayValue="" SqlTracingDirectory="" SqlTracingEnabled="false" SqlTracingMinimumDuration="500" RunUnitTestsInAppDomain="true"> | ||
420 | <CounterSetMappings> | ||
421 | <CounterSetMapping ComputerName="[CONTROLLER MACHINE]"> | ||
422 | <CounterSetReferences> | ||
423 | <CounterSetReference CounterSetName="LoadTest" /> | ||
424 | <CounterSetReference CounterSetName="Controller" /> | ||
425 | </CounterSetReferences> | ||
426 | </CounterSetMapping> | ||
427 | <CounterSetMapping ComputerName="[AGENT MACHINES]"> | ||
428 | <CounterSetReferences> | ||
429 | <CounterSetReference CounterSetName="Agent" /> | ||
430 | </CounterSetReferences> | ||
431 | </CounterSetMapping> | ||
432 | </CounterSetMappings> | ||
433 | </RunConfiguration> | ||
434 | </RunConfigurations> | ||
435 | </LoadTest> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
TestProject1/LoadTest2.loadtest
0 → 100644
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <LoadTest Name="LoadTest2" Description="" Owner="" storage="c:\users\gerdes\documents\visual studio 2010\lil_vstt_plugins\testproject1\loadtest2.loadtest" Priority="2147483647" Enabled="true" CssProjectStructure="" CssIteration="" DeploymentItemsEditable="" WorkItemIds="" TraceLevel="None" CurrentRunConfig="Run Settings1" Id="fc290026-ccfc-431e-9205-3b60d7d6f429" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010"> | ||
3 | <Scenarios> | ||
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" /> | ||
6 | <LoadProfile Pattern="Constant" InitialUsers="1" /> | ||
7 | <TestMix> | ||
8 | <TestProfile Name="TestMethod1" Path="bin\release\testproject1.dll" Id="59863143-3238-122e-4d8a-637b491cc755" Percentage="100" Type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> | ||
9 | </TestMix> | ||
10 | <BrowserMix> | ||
11 | <BrowserProfile Percentage="100"> | ||
12 | <Browser Name="Internet Explorer 7.0" MaxConnections="2"> | ||
13 | <Headers> | ||
14 | <Header Name="User-Agent" Value="Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)" /> | ||
15 | <Header Name="Accept" Value="*/*" /> | ||
16 | <Header Name="Accept-Language" Value="{{$IEAcceptLanguage}}" /> | ||
17 | <Header Name="Accept-Encoding" Value="GZIP" /> | ||
18 | </Headers> | ||
19 | </Browser> | ||
20 | </BrowserProfile> | ||
21 | </BrowserMix> | ||
22 | <NetworkMix> | ||
23 | <NetworkProfile Percentage="100"> | ||
24 | <Network Name="LAN" BandwidthInKbps="1000000" NetworkProfileConfigurationXml="<Emulation><VirtualChannel name="defaultChannel"><FilterList/><VirtualLink instances="1" name="defaultLink"><LinkRule dir="upstream"><Bandwidth><Speed unit="kbps">1000000</Speed></Bandwidth></LinkRule><LinkRule dir="downstream"><Bandwidth><Speed unit="kbps">1000000</Speed></Bandwidth></LinkRule></VirtualLink></VirtualChannel></Emulation>" /> | ||
25 | </NetworkProfile> | ||
26 | </NetworkMix> | ||
27 | </Scenario> | ||
28 | </Scenarios> | ||
29 | <CounterSets> | ||
30 | <CounterSet Name="LoadTest" CounterSetType="LoadTest" LocId=""> | ||
31 | <CounterCategories> | ||
32 | <CounterCategory Name="LoadTest:Scenario"> | ||
33 | <Counters> | ||
34 | <Counter Name="User Load" HigherIsBetter="true" /> | ||
35 | <Counter Name="Tests Running" HigherIsBetter="true" /> | ||
36 | </Counters> | ||
37 | </CounterCategory> | ||
38 | <CounterCategory Name="LoadTest:Test"> | ||
39 | <Counters> | ||
40 | <Counter Name="Total Tests" HigherIsBetter="true" /> | ||
41 | <Counter Name="Passed Tests" HigherIsBetter="true" /> | ||
42 | <Counter Name="Failed Tests" /> | ||
43 | <Counter Name="Tests/Sec" HigherIsBetter="true" /> | ||
44 | <Counter Name="Passed Tests/Sec" HigherIsBetter="true" /> | ||
45 | <Counter Name="Failed Tests/Sec" /> | ||
46 | <Counter Name="Avg. Requests/Test" HigherIsBetter="true" /> | ||
47 | <Counter Name="Avg. Test Time" /> | ||
48 | <Counter Name="% Time in LoadTestPlugin" /> | ||
49 | <Counter Name="% Time in WebTest code" /> | ||
50 | <Counter Name="% Time in Rules" /> | ||
51 | </Counters> | ||
52 | </CounterCategory> | ||
53 | <CounterCategory Name="LoadTest:Transaction"> | ||
54 | <Counters> | ||
55 | <Counter Name="Total Transactions" HigherIsBetter="true" /> | ||
56 | <Counter Name="Avg. Transaction Time" /> | ||
57 | <Counter Name="Avg. Response Time" /> | ||
58 | <Counter Name="Transactions/Sec" HigherIsBetter="true" /> | ||
59 | </Counters> | ||
60 | </CounterCategory> | ||
61 | <CounterCategory Name="LoadTest:Errors"> | ||
62 | <Counters> | ||
63 | <Counter Name="Http Errors" /> | ||
64 | <Counter Name="Validation Rule Errors" /> | ||
65 | <Counter Name="Extraction Rule Errors" /> | ||
66 | <Counter Name="Requests Timed Out" /> | ||
67 | <Counter Name="Exceptions" /> | ||
68 | <Counter Name="Total Errors" /> | ||
69 | <Counter Name="Errors/Sec" /> | ||
70 | <Counter Name="Threshold Violations/Sec" /> | ||
71 | </Counters> | ||
72 | </CounterCategory> | ||
73 | <CounterCategory Name="LoadTest:Page"> | ||
74 | <Counters> | ||
75 | <Counter Name="Total Pages" HigherIsBetter="true" /> | ||
76 | <Counter Name="Avg. Page Time" /> | ||
77 | <Counter Name="Page Response Time Goal" HigherIsBetter="true" /> | ||
78 | <Counter Name="% Pages Meeting Goal" HigherIsBetter="true" /> | ||
79 | <Counter Name="Pages/Sec" HigherIsBetter="true" /> | ||
80 | </Counters> | ||
81 | </CounterCategory> | ||
82 | <CounterCategory Name="LoadTest:Request"> | ||
83 | <Counters> | ||
84 | <Counter Name="Total Requests" HigherIsBetter="true" /> | ||
85 | <Counter Name="Passed Requests" HigherIsBetter="true" /> | ||
86 | <Counter Name="Failed Requests" /> | ||
87 | <Counter Name="Cached Requests" HigherIsBetter="true" /> | ||
88 | <Counter Name="Requests/Sec" HigherIsBetter="true" /> | ||
89 | <Counter Name="Passed Requests/Sec" HigherIsBetter="true" /> | ||
90 | <Counter Name="Failed Requests/Sec" /> | ||
91 | <Counter Name="Avg. First Byte Time" /> | ||
92 | <Counter Name="Avg. Response Time" /> | ||
93 | <Counter Name="Avg. Connection Wait Time"> | ||
94 | <ThresholdRules> | ||
95 | <ThresholdRule Classname="Microsoft.VisualStudio.TestTools.WebStress.Rules.ThresholdRuleCompareCounters, Microsoft.VisualStudio.QualityTools.LoadTest, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> | ||
96 | <RuleParameters> | ||
97 | <RuleParameter Name="DependentCategory" Value="LoadTest:Page" /> | ||
98 | <RuleParameter Name="DependentCounter" Value="Avg. Page Time" /> | ||
99 | <RuleParameter Name="DependentInstance" Value="_Total" /> | ||
100 | <RuleParameter Name="AlertIfOver" Value="True" /> | ||
101 | <RuleParameter Name="WarningThreshold" Value="0.25" /> | ||
102 | <RuleParameter Name="CriticalThreshold" Value="0.5" /> | ||
103 | </RuleParameters> | ||
104 | </ThresholdRule> | ||
105 | </ThresholdRules> | ||
106 | </Counter> | ||
107 | <Counter Name="Avg. Content Length" /> | ||
108 | </Counters> | ||
109 | </CounterCategory> | ||
110 | <CounterCategory Name="LoadTest:LogEntries"> | ||
111 | <Counters> | ||
112 | <Counter Name="Total Log Entries" /> | ||
113 | <Counter Name="Log Entries/Sec" /> | ||
114 | </Counters> | ||
115 | </CounterCategory> | ||
116 | </CounterCategories> | ||
117 | </CounterSet> | ||
118 | <CounterSet Name="Controller" CounterSetType="Controller" LocId="CounterSet_Controller"> | ||
119 | <CounterCategories> | ||
120 | <CounterCategory Name="Memory"> | ||
121 | <Counters> | ||
122 | <Counter Name="% Committed Bytes In Use" Range="100" /> | ||
123 | <Counter Name="Available MBytes" RangeGroup="Memory Bytes" HigherIsBetter="true"> | ||
124 | <ThresholdRules> | ||
125 | <ThresholdRule Classname="Microsoft.VisualStudio.TestTools.WebStress.Rules.ThresholdRuleCompareConstant, Microsoft.VisualStudio.QualityTools.LoadTest"> | ||
126 | <RuleParameters> | ||
127 | <RuleParameter Name="AlertIfOver" Value="False" /> | ||
128 | <RuleParameter Name="WarningThreshold" Value="100" /> | ||
129 | <RuleParameter Name="CriticalThreshold" Value="50" /> | ||
130 | </RuleParameters> | ||
131 | </ThresholdRule> | ||
132 | </ThresholdRules> | ||
133 | </Counter> | ||
134 | <Counter Name="Page Faults/sec" /> | ||
135 | <Counter Name="Pages/sec" /> | ||
136 | <Counter Name="Pool Paged Bytes" RangeGroup="Memory Bytes" /> | ||
137 | <Counter Name="Pool Nonpaged bytes" RangeGroup="Memory Bytes" /> | ||
138 | </Counters> | ||
139 | </CounterCategory> | ||
140 | <CounterCategory Name="Network Interface"> | ||
141 | <Counters> | ||
142 | <Counter Name="Bytes Received/sec" RangeGroup="Network Bytes" /> | ||
143 | <Counter Name="Bytes Sent/sec" RangeGroup="Network Bytes" /> | ||
144 | <Counter Name="Output Queue Length"> | ||
145 | <ThresholdRules> | ||
146 | <ThresholdRule Classname="Microsoft.VisualStudio.TestTools.WebStress.Rules.ThresholdRuleCompareConstant, Microsoft.VisualStudio.QualityTools.LoadTest"> | ||
147 | <RuleParameters> | ||
148 | <RuleParameter Name="AlertIfOver" Value="True" /> | ||
149 | <RuleParameter Name="WarningThreshold" Value="1.5" /> | ||
150 | <RuleParameter Name="CriticalThreshold" Value="2" /> | ||
151 | </RuleParameters> | ||
152 | </ThresholdRule> | ||
153 | </ThresholdRules> | ||
154 | </Counter> | ||
155 | <Counter Name="Packets Received/sec" RangeGroup="Network Packets" /> | ||
156 | <Counter Name="Packets Sent/sec" RangeGroup="Network Packets" /> | ||
157 | <Counter Name="Current Bandwidth" RangeGroup="Network Bytes" /> | ||
158 | <Counter Name="Bytes Total/sec" RangeGroup="Network Bytes"> | ||
159 | <ThresholdRules> | ||
160 | <ThresholdRule Classname="Microsoft.VisualStudio.TestTools.WebStress.Rules.ThresholdRuleCompareCounters, Microsoft.VisualStudio.QualityTools.LoadTest, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> | ||
161 | <RuleParameters> | ||
162 | <RuleParameter Name="DependentCategory" Value="Network Interface" /> | ||
163 | <RuleParameter Name="DependentCounter" Value="Current Bandwidth" /> | ||
164 | <RuleParameter Name="DependentInstance" Value="" /> | ||
165 | <RuleParameter Name="AlertIfOver" Value="True" /> | ||
166 | <RuleParameter Name="WarningThreshold" Value="0.6" /> | ||
167 | <RuleParameter Name="CriticalThreshold" Value="0.7" /> | ||
168 | </RuleParameters> | ||
169 | </ThresholdRule> | ||
170 | </ThresholdRules> | ||
171 | </Counter> | ||
172 | </Counters> | ||
173 | <Instances> | ||
174 | <Instance Name="*" /> | ||
175 | </Instances> | ||
176 | </CounterCategory> | ||
177 | <CounterCategory Name="PhysicalDisk"> | ||
178 | <Counters> | ||
179 | <Counter Name="% Disk Read Time" Range="100" /> | ||
180 | <Counter Name="% Disk Time" Range="100" /> | ||
181 | <Counter Name="% Disk Write Time" Range="100" /> | ||
182 | <Counter Name="% Idle Time" Range="100" HigherIsBetter="true"> | ||
183 | <ThresholdRules> | ||
184 | <ThresholdRule Classname="Microsoft.VisualStudio.TestTools.WebStress.Rules.ThresholdRuleCompareConstant, Microsoft.VisualStudio.QualityTools.LoadTest"> | ||
185 | <RuleParameters> | ||
186 | <RuleParameter Name="AlertIfOver" Value="False" /> | ||
187 | <RuleParameter Name="WarningThreshold" Value="40" /> | ||
188 | <RuleParameter Name="CriticalThreshold" Value="20" /> | ||
189 | </RuleParameters> | ||
190 | </ThresholdRule> | ||
191 | </ThresholdRules> | ||
192 | </Counter> | ||
193 | <Counter Name="Avg. Disk Bytes/Read" RangeGroup="DiskBytesRate" /> | ||
194 | <Counter Name="Avg. Disk Bytes/Transfer" RangeGroup="DiskBytesRate" /> | ||
195 | <Counter Name="Avg. Disk Bytes/Write" RangeGroup="DiskBytesRate" /> | ||
196 | <Counter Name="Avg. Disk Queue Length" RangeGroup="Disk Queue Length" /> | ||
197 | <Counter Name="Avg. Disk Read Queue Length" RangeGroup="Disk Queue Length" /> | ||
198 | <Counter Name="Avg. Disk Write Queue Length" RangeGroup="Disk Queue Length" /> | ||
199 | <Counter Name="Current Disk Queue Length" RangeGroup="Disk Queue Length" /> | ||
200 | <Counter Name="Avg. Disk sec/Read" RangeGroup="Disk sec" /> | ||
201 | <Counter Name="Avg. Disk sec/Transfer" RangeGroup="Disk sec" /> | ||
202 | <Counter Name="Avg. Disk sec/Write" RangeGroup="Disk sec" /> | ||
203 | <Counter Name="Disk Bytes/sec" RangeGroup="Disk Bytes sec" /> | ||
204 | <Counter Name="Disk Read Bytes/sec" RangeGroup="Disk Bytes sec" /> | ||
205 | <Counter Name="Disk Reads/sec" RangeGroup="Disk Transfers sec" /> | ||
206 | <Counter Name="Disk Transfers/sec" RangeGroup="Disk Transfers sec" /> | ||
207 | <Counter Name="Disk Write Bytes/sec" RangeGroup="Disk Bytes sec" /> | ||
208 | <Counter Name="Disk Writes/sec" RangeGroup="Disk Transfers sec" /> | ||
209 | <Counter Name="Split IO/Sec" RangeGroup="Disk Transfers sec" /> | ||
210 | </Counters> | ||
211 | <Instances> | ||
212 | <Instance Name="*" /> | ||
213 | </Instances> | ||
214 | </CounterCategory> | ||
215 | <CounterCategory Name="Processor"> | ||
216 | <Counters> | ||
217 | <Counter Name="% Processor Time" Range="100"> | ||
218 | <ThresholdRules> | ||
219 | <ThresholdRule Classname="Microsoft.VisualStudio.TestTools.WebStress.Rules.ThresholdRuleCompareConstant, Microsoft.VisualStudio.QualityTools.LoadTest"> | ||
220 | <RuleParameters> | ||
221 | <RuleParameter Name="AlertIfOver" Value="True" /> | ||
222 | <RuleParameter Name="WarningThreshold" Value="75" /> | ||
223 | <RuleParameter Name="CriticalThreshold" Value="90" /> | ||
224 | </RuleParameters> | ||
225 | </ThresholdRule> | ||
226 | </ThresholdRules> | ||
227 | </Counter> | ||
228 | <Counter Name="% Privileged Time" Range="100" /> | ||
229 | <Counter Name="% User Time" Range="100" /> | ||
230 | </Counters> | ||
231 | <Instances> | ||
232 | <Instance Name="_Total" /> | ||
233 | </Instances> | ||
234 | </CounterCategory> | ||
235 | <CounterCategory Name="System"> | ||
236 | <Counters> | ||
237 | <Counter Name="Context Switches/sec" /> | ||
238 | <Counter Name="Processes" /> | ||
239 | <Counter Name="Processor Queue Length" /> | ||
240 | <Counter Name="Threads" /> | ||
241 | </Counters> | ||
242 | </CounterCategory> | ||
243 | <CounterCategory Name="Process"> | ||
244 | <Counters> | ||
245 | <Counter Name="% Processor Time" RangeGroup="Processor Time" /> | ||
246 | <Counter Name="% Privileged Time" RangeGroup="Processor Time" /> | ||
247 | <Counter Name="% User Time" RangeGroup="Processor Time" /> | ||
248 | <Counter Name="Handle Count" /> | ||
249 | <Counter Name="Thread Count" /> | ||
250 | <Counter Name="Private Bytes" RangeGroup="Memory Bytes" /> | ||
251 | <Counter Name="Virtual Bytes" RangeGroup="Memory Bytes" /> | ||
252 | <Counter Name="Working Set" RangeGroup="Memory Bytes" /> | ||
253 | </Counters> | ||
254 | <Instances> | ||
255 | <Instance Name="QTController" /> | ||
256 | </Instances> | ||
257 | </CounterCategory> | ||
258 | </CounterCategories> | ||
259 | <DefaultCountersForAutomaticGraphs> | ||
260 | <DefaultCounter CategoryName="Processor" CounterName="% Processor Time" InstanceName="_Total" GraphName="" /> | ||
261 | <DefaultCounter CategoryName="Memory" CounterName="Available MBytes" InstanceName="" GraphName="" /> | ||
262 | </DefaultCountersForAutomaticGraphs> | ||
263 | </CounterSet> | ||
264 | <CounterSet Name="Agent" CounterSetType="Agent" LocId="CounterSet_Agent"> | ||
265 | <CounterCategories> | ||
266 | <CounterCategory Name="Memory"> | ||
267 | <Counters> | ||
268 | <Counter Name="% Committed Bytes In Use" Range="100" /> | ||
269 | <Counter Name="Available MBytes" RangeGroup="Memory Bytes" HigherIsBetter="true"> | ||
270 | <ThresholdRules> | ||
271 | <ThresholdRule Classname="Microsoft.VisualStudio.TestTools.WebStress.Rules.ThresholdRuleCompareConstant, Microsoft.VisualStudio.QualityTools.LoadTest"> | ||
272 | <RuleParameters> | ||
273 | <RuleParameter Name="AlertIfOver" Value="False" /> | ||
274 | <RuleParameter Name="WarningThreshold" Value="100" /> | ||
275 | <RuleParameter Name="CriticalThreshold" Value="50" /> | ||
276 | </RuleParameters> | ||
277 | </ThresholdRule> | ||
278 | </ThresholdRules> | ||
279 | </Counter> | ||
280 | <Counter Name="Page Faults/sec" /> | ||
281 | <Counter Name="Pages/sec" /> | ||
282 | <Counter Name="Pool Paged Bytes" RangeGroup="Memory Bytes" /> | ||
283 | <Counter Name="Pool Nonpaged bytes" RangeGroup="Memory Bytes" /> | ||
284 | </Counters> | ||
285 | </CounterCategory> | ||
286 | <CounterCategory Name="Network Interface"> | ||
287 | <Counters> | ||
288 | <Counter Name="Bytes Received/sec" RangeGroup="Network Bytes" /> | ||
289 | <Counter Name="Bytes Sent/sec" RangeGroup="Network Bytes" /> | ||
290 | <Counter Name="Output Queue Length"> | ||
291 | <ThresholdRules> | ||
292 | <ThresholdRule Classname="Microsoft.VisualStudio.TestTools.WebStress.Rules.ThresholdRuleCompareConstant, Microsoft.VisualStudio.QualityTools.LoadTest"> | ||
293 | <RuleParameters> | ||
294 | <RuleParameter Name="AlertIfOver" Value="True" /> | ||
295 | <RuleParameter Name="WarningThreshold" Value="1.5" /> | ||
296 | <RuleParameter Name="CriticalThreshold" Value="2" /> | ||
297 | </RuleParameters> | ||
298 | </ThresholdRule> | ||
299 | </ThresholdRules> | ||
300 | </Counter> | ||
301 | <Counter Name="Packets Received/sec" RangeGroup="Network Packets" /> | ||
302 | <Counter Name="Packets Sent/sec" RangeGroup="Network Packets" /> | ||
303 | <Counter Name="Current Bandwidth" RangeGroup="Network Bytes" /> | ||
304 | <Counter Name="Bytes Total/sec" RangeGroup="Network Bytes"> | ||
305 | <ThresholdRules> | ||
306 | <ThresholdRule Classname="Microsoft.VisualStudio.TestTools.WebStress.Rules.ThresholdRuleCompareCounters, Microsoft.VisualStudio.QualityTools.LoadTest, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> | ||
307 | <RuleParameters> | ||
308 | <RuleParameter Name="DependentCategory" Value="Network Interface" /> | ||
309 | <RuleParameter Name="DependentCounter" Value="Current Bandwidth" /> | ||
310 | <RuleParameter Name="DependentInstance" Value="" /> | ||
311 | <RuleParameter Name="AlertIfOver" Value="True" /> | ||
312 | <RuleParameter Name="WarningThreshold" Value="0.6" /> | ||
313 | <RuleParameter Name="CriticalThreshold" Value="0.7" /> | ||
314 | </RuleParameters> | ||
315 | </ThresholdRule> | ||
316 | </ThresholdRules> | ||
317 | </Counter> | ||
318 | </Counters> | ||
319 | <Instances> | ||
320 | <Instance Name="*" /> | ||
321 | </Instances> | ||
322 | </CounterCategory> | ||
323 | <CounterCategory Name="PhysicalDisk"> | ||
324 | <Counters> | ||
325 | <Counter Name="% Disk Read Time" Range="100" /> | ||
326 | <Counter Name="% Disk Time" Range="100" /> | ||
327 | <Counter Name="% Disk Write Time" Range="100" /> | ||
328 | <Counter Name="% Idle Time" Range="100" HigherIsBetter="true"> | ||
329 | <ThresholdRules> | ||
330 | <ThresholdRule Classname="Microsoft.VisualStudio.TestTools.WebStress.Rules.ThresholdRuleCompareConstant, Microsoft.VisualStudio.QualityTools.LoadTest"> | ||
331 | <RuleParameters> | ||
332 | <RuleParameter Name="AlertIfOver" Value="False" /> | ||
333 | <RuleParameter Name="WarningThreshold" Value="40" /> | ||
334 | <RuleParameter Name="CriticalThreshold" Value="20" /> | ||
335 | </RuleParameters> | ||
336 | </ThresholdRule> | ||
337 | </ThresholdRules> | ||
338 | </Counter> | ||
339 | <Counter Name="Avg. Disk Bytes/Read" RangeGroup="DiskBytesRate" /> | ||
340 | <Counter Name="Avg. Disk Bytes/Transfer" RangeGroup="DiskBytesRate" /> | ||
341 | <Counter Name="Avg. Disk Bytes/Write" RangeGroup="DiskBytesRate" /> | ||
342 | <Counter Name="Avg. Disk Queue Length" RangeGroup="Disk Queue Length" /> | ||
343 | <Counter Name="Avg. Disk Read Queue Length" RangeGroup="Disk Queue Length" /> | ||
344 | <Counter Name="Avg. Disk Write Queue Length" RangeGroup="Disk Queue Length" /> | ||
345 | <Counter Name="Current Disk Queue Length" RangeGroup="Disk Queue Length" /> | ||
346 | <Counter Name="Avg. Disk sec/Read" RangeGroup="Disk sec" /> | ||
347 | <Counter Name="Avg. Disk sec/Transfer" RangeGroup="Disk sec" /> | ||
348 | <Counter Name="Avg. Disk sec/Write" RangeGroup="Disk sec" /> | ||
349 | <Counter Name="Disk Bytes/sec" RangeGroup="Disk Bytes sec" /> | ||
350 | <Counter Name="Disk Read Bytes/sec" RangeGroup="Disk Bytes sec" /> | ||
351 | <Counter Name="Disk Reads/sec" RangeGroup="Disk Transfers sec" /> | ||
352 | <Counter Name="Disk Transfers/sec" RangeGroup="Disk Transfers sec" /> | ||
353 | <Counter Name="Disk Write Bytes/sec" RangeGroup="Disk Bytes sec" /> | ||
354 | <Counter Name="Disk Writes/sec" RangeGroup="Disk Transfers sec" /> | ||
355 | <Counter Name="Split IO/Sec" RangeGroup="Disk Transfers sec" /> | ||
356 | </Counters> | ||
357 | <Instances> | ||
358 | <Instance Name="*" /> | ||
359 | </Instances> | ||
360 | </CounterCategory> | ||
361 | <CounterCategory Name="Processor"> | ||
362 | <Counters> | ||
363 | <Counter Name="% Processor Time" Range="100"> | ||
364 | <ThresholdRules> | ||
365 | <ThresholdRule Classname="Microsoft.VisualStudio.TestTools.WebStress.Rules.ThresholdRuleCompareConstant, Microsoft.VisualStudio.QualityTools.LoadTest"> | ||
366 | <RuleParameters> | ||
367 | <RuleParameter Name="AlertIfOver" Value="True" /> | ||
368 | <RuleParameter Name="WarningThreshold" Value="75" /> | ||
369 | <RuleParameter Name="CriticalThreshold" Value="90" /> | ||
370 | </RuleParameters> | ||
371 | </ThresholdRule> | ||
372 | </ThresholdRules> | ||
373 | </Counter> | ||
374 | <Counter Name="% Privileged Time" Range="100" /> | ||
375 | <Counter Name="% User Time" Range="100" /> | ||
376 | </Counters> | ||
377 | <Instances> | ||
378 | <Instance Name="0" /> | ||
379 | <Instance Name="_Total" /> | ||
380 | </Instances> | ||
381 | </CounterCategory> | ||
382 | <CounterCategory Name="System"> | ||
383 | <Counters> | ||
384 | <Counter Name="Context Switches/sec" /> | ||
385 | <Counter Name="Processes" /> | ||
386 | <Counter Name="Processor Queue Length" /> | ||
387 | <Counter Name="Threads" /> | ||
388 | </Counters> | ||
389 | </CounterCategory> | ||
390 | <CounterCategory Name="Process"> | ||
391 | <Counters> | ||
392 | <Counter Name="% Processor Time" RangeGroup="Processor Time" /> | ||
393 | <Counter Name="% Privileged Time" RangeGroup="Processor Time" /> | ||
394 | <Counter Name="% User Time" RangeGroup="Processor Time" /> | ||
395 | <Counter Name="Handle Count" /> | ||
396 | <Counter Name="Thread Count" /> | ||
397 | <Counter Name="Private Bytes" RangeGroup="Memory Bytes" /> | ||
398 | <Counter Name="Virtual Bytes" RangeGroup="Memory Bytes" /> | ||
399 | <Counter Name="Working Set" RangeGroup="Memory Bytes" /> | ||
400 | </Counters> | ||
401 | <Instances> | ||
402 | <Instance Name="devenv" /> | ||
403 | <Instance Name="QTAgentService" /> | ||
404 | <Instance Name="QTAgent" /> | ||
405 | <Instance Name="QTAgent32" /> | ||
406 | <Instance Name="QTDCAgent" /> | ||
407 | <Instance Name="QTDCAgent32" /> | ||
408 | </Instances> | ||
409 | </CounterCategory> | ||
410 | </CounterCategories> | ||
411 | <DefaultCountersForAutomaticGraphs> | ||
412 | <DefaultCounter CategoryName="Processor" CounterName="% Processor Time" InstanceName="0" GraphName="" RunType="Local" /> | ||
413 | <DefaultCounter CategoryName="Processor" CounterName="% Processor Time" InstanceName="_Total" GraphName="" RunType="Remote" /> | ||
414 | <DefaultCounter CategoryName="Memory" CounterName="Available MBytes" InstanceName="" GraphName="" /> | ||
415 | </DefaultCountersForAutomaticGraphs> | ||
416 | </CounterSet> | ||
417 | </CounterSets> | ||
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="20" WebTestConnectionModel="ConnectionPerUser" WebTestConnectionPoolSize="50" SampleRate="5" ValidationLevel="High" SqlTracingConnectString="" SqlTracingConnectStringDisplayValue="" SqlTracingDirectory="" SqlTracingEnabled="false" SqlTracingMinimumDuration="500" RunUnitTestsInAppDomain="true"> | ||
420 | <CounterSetMappings> | ||
421 | <CounterSetMapping ComputerName="[CONTROLLER MACHINE]"> | ||
422 | <CounterSetReferences> | ||
423 | <CounterSetReference CounterSetName="LoadTest" /> | ||
424 | <CounterSetReference CounterSetName="Controller" /> | ||
425 | </CounterSetReferences> | ||
426 | </CounterSetMapping> | ||
427 | <CounterSetMapping ComputerName="[AGENT MACHINES]"> | ||
428 | <CounterSetReferences> | ||
429 | <CounterSetReference CounterSetName="Agent" /> | ||
430 | </CounterSetReferences> | ||
431 | </CounterSetMapping> | ||
432 | </CounterSetMappings> | ||
433 | </RunConfiguration> | ||
434 | </RunConfigurations> | ||
435 | <LoadTestPlugins> | ||
436 | <LoadTestPlugin Classname="LIL_VSTT_Plugins.SetTestParameter, LIL_VSTT_Plugins, Version=1.2.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> | ||
438 | <RuleParameter Name="Connection_String" Value="C:\Users\gerdes\Userdata.csv" /> | ||
439 | <RuleParameter Name="Has_col_name" Value="True" /> | ||
440 | <RuleParameter Name="Autosplit" Value="False" /> | ||
441 | <RuleParameter Name="Parameter_Name" Value="UserName2" /> | ||
442 | <RuleParameter Name="LogFilePathString" Value="C:\Users\gerdes\Fungerande2.log" /> | ||
443 | <RuleParameter Name="LogFileAppendID" Value="True" /> | ||
444 | <RuleParameter Name="LogFileAppendName" Value="False" /> | ||
445 | <RuleParameter Name="Use_Random" Value="False" /> | ||
446 | <RuleParameter Name="Use_Unique" Value="False" /> | ||
447 | <RuleParameter Name="Use_UniqueIteration" Value="False" /> | ||
448 | <RuleParameter Name="Use_Loop" Value="True" /> | ||
449 | <RuleParameter Name="Log_To_File" Value="True" /> | ||
450 | <RuleParameter Name="Test_Names" Value="" /> | ||
451 | <RuleParameter Name="Scenario_Names" Value="" /> | ||
452 | <RuleParameter Name="Agent_Names" Value="" /> | ||
453 | </RuleParameters> | ||
454 | </LoadTestPlugin> | ||
455 | <LoadTestPlugin Classname="LIL_VSTT_Plugins.SetTestParameter, LIL_VSTT_Plugins, Version=1.2.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"> | ||
456 | <RuleParameters> | ||
457 | <RuleParameter Name="Connection_String" Value="C:\Users\gerdes\Userdata.csv" /> | ||
458 | <RuleParameter Name="Has_col_name" Value="True" /> | ||
459 | <RuleParameter Name="Autosplit" Value="False" /> | ||
460 | <RuleParameter Name="Parameter_Name" Value="UserName" /> | ||
461 | <RuleParameter Name="LogFilePathString" Value="C:\Users\gerdes\Fungerande.log" /> | ||
462 | <RuleParameter Name="LogFileAppendID" Value="True" /> | ||
463 | <RuleParameter Name="LogFileAppendName" Value="False" /> | ||
464 | <RuleParameter Name="Use_Random" Value="False" /> | ||
465 | <RuleParameter Name="Use_Unique" Value="False" /> | ||
466 | <RuleParameter Name="Use_UniqueIteration" Value="False" /> | ||
467 | <RuleParameter Name="Use_Loop" Value="True" /> | ||
468 | <RuleParameter Name="Log_To_File" Value="True" /> | ||
469 | <RuleParameter Name="Test_Names" Value="" /> | ||
470 | <RuleParameter Name="Scenario_Names" Value="" /> | ||
471 | <RuleParameter Name="Agent_Names" Value="" /> | ||
472 | </RuleParameters> | ||
473 | </LoadTestPlugin> | ||
474 | </LoadTestPlugins> | ||
475 | </LoadTest> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
TestProject1/Properties/AssemblyInfo.cs
0 → 100644
1 | using System.Reflection; | ||
2 | using System.Runtime.CompilerServices; | ||
3 | using System.Runtime.InteropServices; | ||
4 | |||
5 | // General Information about an assembly is controlled through the following | ||
6 | // set of attributes. Change these attribute values to modify the information | ||
7 | // associated with an assembly. | ||
8 | [assembly: AssemblyTitle("TestProject1")] | ||
9 | [assembly: AssemblyDescription("")] | ||
10 | [assembly: AssemblyConfiguration("")] | ||
11 | [assembly: AssemblyCompany("Microsoft")] | ||
12 | [assembly: AssemblyProduct("TestProject1")] | ||
13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] | ||
14 | [assembly: AssemblyTrademark("")] | ||
15 | [assembly: AssemblyCulture("")] | ||
16 | |||
17 | // Setting ComVisible to false makes the types in this assembly not visible | ||
18 | // to COM components. If you need to access a type in this assembly from | ||
19 | // COM, set the ComVisible attribute to true on that type. | ||
20 | [assembly: ComVisible(false)] | ||
21 | |||
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM | ||
23 | [assembly: Guid("c10cf0ce-1b37-49b2-8ef1-2b588d2fde1d")] | ||
24 | |||
25 | // Version information for an assembly consists of the following four values: | ||
26 | // | ||
27 | // Major Version | ||
28 | // Minor Version | ||
29 | // Build Number | ||
30 | // Revision | ||
31 | // | ||
32 | // You can specify all the values or you can default the Build and Revision Numbers | ||
33 | // by using the '*' as shown below: | ||
34 | [assembly: AssemblyVersion("1.0.0.0")] | ||
35 | [assembly: AssemblyFileVersion("1.0.0.0")] |
TestProject1/TestProject1.csproj
0 → 100644
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
3 | <PropertyGroup> | ||
4 | <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
5 | <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
6 | <ProductVersion> | ||
7 | </ProductVersion> | ||
8 | <SchemaVersion>2.0</SchemaVersion> | ||
9 | <ProjectGuid>{01CF59F6-F912-447A-91BC-0301FDA09C02}</ProjectGuid> | ||
10 | <OutputType>Library</OutputType> | ||
11 | <AppDesignerFolder>Properties</AppDesignerFolder> | ||
12 | <RootNamespace>TestProject1</RootNamespace> | ||
13 | <AssemblyName>TestProject1</AssemblyName> | ||
14 | <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> | ||
15 | <FileAlignment>512</FileAlignment> | ||
16 | <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> | ||
17 | <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion> | ||
18 | <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> | ||
19 | <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath> | ||
20 | <IsCodedUITest>False</IsCodedUITest> | ||
21 | <TestProjectType>WebTest</TestProjectType> | ||
22 | <FileUpgradeFlags> | ||
23 | </FileUpgradeFlags> | ||
24 | <UpgradeBackupLocation> | ||
25 | </UpgradeBackupLocation> | ||
26 | <OldToolsVersion>4.0</OldToolsVersion> | ||
27 | </PropertyGroup> | ||
28 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
29 | <DebugSymbols>true</DebugSymbols> | ||
30 | <DebugType>full</DebugType> | ||
31 | <Optimize>false</Optimize> | ||
32 | <OutputPath>bin\Debug\</OutputPath> | ||
33 | <DefineConstants>DEBUG;TRACE</DefineConstants> | ||
34 | <ErrorReport>prompt</ErrorReport> | ||
35 | <WarningLevel>4</WarningLevel> | ||
36 | </PropertyGroup> | ||
37 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
38 | <DebugType>pdbonly</DebugType> | ||
39 | <Optimize>true</Optimize> | ||
40 | <OutputPath>bin\Release\</OutputPath> | ||
41 | <DefineConstants>TRACE</DefineConstants> | ||
42 | <ErrorReport>prompt</ErrorReport> | ||
43 | <WarningLevel>4</WarningLevel> | ||
44 | </PropertyGroup> | ||
45 | <ItemGroup> | ||
46 | <Reference Include="Microsoft.VisualStudio.QualityTools.LoadTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> | ||
47 | <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" /> | ||
48 | <Reference Include="Microsoft.VisualStudio.QualityTools.WebTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> | ||
49 | <Reference Include="System" /> | ||
50 | <Reference Include="System.Core"> | ||
51 | <RequiredTargetFramework>3.5</RequiredTargetFramework> | ||
52 | </Reference> | ||
53 | </ItemGroup> | ||
54 | <ItemGroup> | ||
55 | <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies"> | ||
56 | <Visible>False</Visible> | ||
57 | </CodeAnalysisDependentAssemblyPaths> | ||
58 | </ItemGroup> | ||
59 | <ItemGroup> | ||
60 | <Compile Include="Properties\AssemblyInfo.cs" /> | ||
61 | <Compile Include="UnitTest1.cs" /> | ||
62 | <Compile Include="WebTest1Coded.cs" /> | ||
63 | </ItemGroup> | ||
64 | <ItemGroup> | ||
65 | <None Include="LoadTest2.loadtest"> | ||
66 | <CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
67 | </None> | ||
68 | <None Include="LoadTest1.loadtest"> | ||
69 | <CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
70 | </None> | ||
71 | <None Include="WebTest2.webtest"> | ||
72 | <CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
73 | </None> | ||
74 | <Shadow Include="Test References\LIL_VSTT_Plugins.accessor" /> | ||
75 | <None Include="Userdata.csv"> | ||
76 | <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
77 | </None> | ||
78 | <None Include="WebTest1.webtest"> | ||
79 | <CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
80 | </None> | ||
81 | </ItemGroup> | ||
82 | <ItemGroup> | ||
83 | <ProjectReference Include="..\LIL_VSTT_Plugins\LIL_VSTT_Plugins.csproj"> | ||
84 | <Project>{06A22593-601E-4386-917A-9835DE30E14E}</Project> | ||
85 | <Name>LIL_VSTT_Plugins</Name> | ||
86 | </ProjectReference> | ||
87 | </ItemGroup> | ||
88 | <Choose> | ||
89 | <When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'"> | ||
90 | <ItemGroup> | ||
91 | <Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> | ||
92 | <Private>False</Private> | ||
93 | </Reference> | ||
94 | <Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> | ||
95 | <Private>False</Private> | ||
96 | </Reference> | ||
97 | <Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> | ||
98 | <Private>False</Private> | ||
99 | </Reference> | ||
100 | <Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> | ||
101 | <Private>False</Private> | ||
102 | </Reference> | ||
103 | </ItemGroup> | ||
104 | </When> | ||
105 | </Choose> | ||
106 | <Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" /> | ||
107 | <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> | ||
108 | <!-- To modify your build process, add your task inside one of the targets below and uncomment it. | ||
109 | Other similar extension points exist, see Microsoft.Common.targets. | ||
110 | <Target Name="BeforeBuild"> | ||
111 | </Target> | ||
112 | <Target Name="AfterBuild"> | ||
113 | </Target> | ||
114 | --> | ||
115 | </Project> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
TestProject1/UnitTest1.cs
0 → 100644
1 | using System; | ||
2 | using System.Text; | ||
3 | using System.Collections.Generic; | ||
4 | using System.Linq; | ||
5 | using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
6 | |||
7 | namespace TestProject1 | ||
8 | { | ||
9 | /// <summary> | ||
10 | /// Summary description for UnitTest1 | ||
11 | /// </summary> | ||
12 | [TestClass] | ||
13 | public class UnitTest1 | ||
14 | { | ||
15 | public UnitTest1() | ||
16 | { | ||
17 | // | ||
18 | // TODO: Add constructor logic here | ||
19 | // | ||
20 | } | ||
21 | |||
22 | private TestContext testContextInstance; | ||
23 | |||
24 | /// <summary> | ||
25 | ///Gets or sets the test context which provides | ||
26 | ///information about and functionality for the current test run. | ||
27 | ///</summary> | ||
28 | public TestContext TestContext | ||
29 | { | ||
30 | get | ||
31 | { | ||
32 | return testContextInstance; | ||
33 | } | ||
34 | set | ||
35 | { | ||
36 | testContextInstance = value; | ||
37 | } | ||
38 | } | ||
39 | |||
40 | #region Additional test attributes | ||
41 | // | ||
42 | // You can use the following additional attributes as you write your tests: | ||
43 | // | ||
44 | // Use ClassInitialize to run code before running the first test in the class | ||
45 | // [ClassInitialize()] | ||
46 | // public static void MyClassInitialize(TestContext testContext) { } | ||
47 | // | ||
48 | // Use ClassCleanup to run code after all tests in a class have run | ||
49 | // [ClassCleanup()] | ||
50 | // public static void MyClassCleanup() { } | ||
51 | // | ||
52 | // Use TestInitialize to run code before running each test | ||
53 | // [TestInitialize()] | ||
54 | // public void MyTestInitialize() { } | ||
55 | // | ||
56 | // Use TestCleanup to run code after each test has run | ||
57 | // [TestCleanup()] | ||
58 | // public void MyTestCleanup() { } | ||
59 | // | ||
60 | #endregion | ||
61 | |||
62 | [TestMethod] | ||
63 | public void TestMethod1() | ||
64 | { | ||
65 | TestContext.WriteLine("Current Test Context parameters:"); | ||
66 | IDictionary<string, object> dic = (IDictionary<string, object>)TestContext.Properties; | ||
67 | foreach (KeyValuePair<string, object> pair in dic) | ||
68 | TestContext.WriteLine(pair.Key + ": " + pair.Value.ToString()); | ||
69 | TestContext.WriteLine("End of Current Test Context parameters."); | ||
70 | } | ||
71 | } | ||
72 | } |
TestProject1/Userdata.csv
0 → 100644
1 | UserName | ||
2 | anjo | ||
3 | anma | ||
4 | anro | ||
5 | arbt1 | ||
6 | arbt10 | ||
7 | arbt2 | ||
8 | arbt3 | ||
9 | arbt4 | ||
10 | arbt5 | ||
11 | arbt6 | ||
12 | arbt7 | ||
13 | arbt8 | ||
14 | arbt9 | ||
15 | bm1 | ||
16 | boba | ||
17 | caca | ||
18 | caca10 | ||
19 | caca3 | ||
20 | cami | ||
21 | dath | ||
22 | diet1 | ||
23 | diet2 | ||
24 | diet3 | ||
25 | diet4 | ||
26 | diet5 | ||
27 | ebin | ||
28 | edi | ||
29 | edi_user | ||
30 | eman | ||
31 | emla | ||
32 | emla2 | ||
33 | empe | ||
34 | emsu | ||
35 | emsv | ||
36 | kaur | ||
37 | kewa | ||
38 | kura1 | ||
39 | kura2 | ||
40 | kura3 | ||
41 | kura4 | ||
42 | kura5 | ||
43 | lak0000001 | ||
44 | lak0000002 | ||
45 | lak0000003 | ||
46 | lak0000004 | ||
47 | lak0000005 | ||
48 | lak0000006 | ||
49 | lak1 | ||
50 | lak10 | ||
51 | lak11 | ||
52 | lak12 | ||
53 | lak13 | ||
54 | lak14 | ||
55 | lak15 | ||
56 | lak16 | ||
57 | lak17 | ||
58 | lak18 | ||
59 | lak19 | ||
60 | lak2 | ||
61 | lak20 | ||
62 | lak3 | ||
63 | lak4 | ||
64 | lak5 | ||
65 | lak6 | ||
66 | lak7 | ||
67 | lak8 | ||
68 | lak9 | ||
69 | lakA | ||
70 | lakB | ||
71 | lakC | ||
72 | lakD | ||
73 | lego | ||
74 | lgry1 | ||
75 | lilu | ||
76 | logo1 | ||
77 | logo2 | ||
78 | logo3 | ||
79 | logo4 | ||
80 | logo5 | ||
81 | maan | ||
82 | maul | ||
83 | melior | ||
84 | nigr | ||
85 | olle | ||
86 | peka | ||
87 | pepe | ||
88 | pewi | ||
89 | pipe | ||
90 | psyk1 | ||
91 | psyk2 | ||
92 | psyk3 | ||
93 | psyk4 | ||
94 | psyk5 | ||
95 | saan | ||
96 | safe | ||
97 | saha | ||
98 | sajo | ||
99 | saka | ||
100 | sekr000001 | ||
101 | sekr000002 | ||
102 | sekr000003 | ||
103 | sekr000004 | ||
104 | sekr000005 | ||
105 | sekr000006 | ||
106 | sekr1 | ||
107 | sekr10 | ||
108 | sekr11 | ||
109 | sekr12 | ||
110 | sekr13 | ||
111 | sekr14 | ||
112 | sekr15 | ||
113 | sekr16 | ||
114 | sekr17 | ||
115 | sekr18 | ||
116 | sekr19 | ||
117 | sekr2 | ||
118 | sekr20 | ||
119 | sekr3 | ||
120 | sekr4 | ||
121 | sekr5 | ||
122 | sekr6 | ||
123 | sekr7 | ||
124 | sekr8 | ||
125 | sekr9 | ||
126 | sekrA | ||
127 | sekrB | ||
128 | sekrC | ||
129 | sekrD | ||
130 | sjgy1 | ||
131 | sjgy10 | ||
132 | sjgy2 | ||
133 | sjgy3 | ||
134 | sjgy4 | ||
135 | sjgy5 | ||
136 | sjgy6 | ||
137 | sjgy7 | ||
138 | sjgy8 | ||
139 | sjgy9 | ||
140 | sola | ||
141 | ssk0000001 | ||
142 | ssk0000002 | ||
143 | ssk0000003 | ||
144 | ssk0000004 | ||
145 | ssk0000005 | ||
146 | ssk0000006 | ||
147 | ssk1 | ||
148 | ssk10 | ||
149 | ssk11 | ||
150 | ssk12 | ||
151 | ssk13 | ||
152 | ssk14 | ||
153 | ssk15 | ||
154 | ssk16 | ||
155 | ssk17 | ||
156 | ssk18 | ||
157 | ssk19 | ||
158 | ssk2 | ||
159 | ssk20 | ||
160 | ssk3 | ||
161 | ssk4 | ||
162 | ssk5 | ||
163 | ssk6 | ||
164 | ssk7 | ||
165 | ssk8 | ||
166 | ssk9 | ||
167 | sskA | ||
168 | sskB | ||
169 | sskC | ||
170 | sskD | ||
171 | stji | ||
172 | sys | ||
173 | syslab | ||
174 | tst1 | ||
175 | ulkl | ||
176 | utb1 | ||
177 | utb2 | ||
178 | voklej | ||
179 | ydde1 | ||
180 | yddelak | ||
181 | yddessk | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
TestProject1/WebTest1.webtest
0 → 100644
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <WebTest Name="WebTest1" Id="c649760b-6dd8-4210-8a6d-3c6596d08668" Owner="" Priority="2147483647" Enabled="True" CssProjectStructure="" CssIteration="" Timeout="0" WorkItemIds="" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010" Description="" CredentialUserName="" CredentialPassword="" PreAuthenticate="True" Proxy="" StopOnError="False" RecordedResultFile="WebTest1.a5a27e2d-474c-43bb-be4d-1b12e85851a0.rec.webtestresult"> | ||
3 | <Items> | ||
4 | <Request Method="POST" Version="1.1" Url="http://www.lil.nu/" ThinkTime="0" Timeout="300" ParseDependentRequests="True" FollowRedirects="True" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8" ExpectedHttpStatusCode="0" ExpectedResponseUrl="" ReportingName=""> | ||
5 | <Headers> | ||
6 | <Header Name="Username" Value="{{DataSource1.Userdata#csv.UserName}}" /> | ||
7 | </Headers> | ||
8 | <ExtractionRules> | ||
9 | <ExtractionRule Classname="LIL_VSTT_Plugins.NestedExtractionRule, LIL_VSTT_Plugins, Version=1.0.0.1, Culture=neutral, PublicKeyToken=null" VariableName="TableRowTest" DisplayName="Nested Extraction" Description="(C) Copyright 2011 LIGHTS IN LINE AB
Kombination av två extractions där den andra söker i resultatet av den första."> | ||
10 | <RuleParameters> | ||
11 | <RuleParameter Name="Start1" Value="<table width="100%"" /> | ||
12 | <RuleParameter Name="End1" Value="</tr></table>" /> | ||
13 | <RuleParameter Name="Start2" Value="<td id="start" class="" /> | ||
14 | <RuleParameter Name="End2" Value="" onMouseOver" /> | ||
15 | </RuleParameters> | ||
16 | </ExtractionRule> | ||
17 | </ExtractionRules> | ||
18 | <FormPostHttpBody> | ||
19 | <FormPostParameter Name="TestParam" Value="LORRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR" RecordedValue="" CorrelationBinding="" UrlEncode="True" /> | ||
20 | </FormPostHttpBody> | ||
21 | </Request> | ||
22 | </Items> | ||
23 | <DataSources> | ||
24 | <DataSource Name="DataSource1" Provider="Microsoft.VisualStudio.TestTools.DataSource.CSV" Connection="|DataDirectory|\Userdata.csv"> | ||
25 | <Tables> | ||
26 | <DataSourceTable Name="Userdata#csv" SelectColumns="SelectOnlyBoundColumns" AccessMethod="DoNotMoveCursor" /> | ||
27 | </Tables> | ||
28 | </DataSource> | ||
29 | </DataSources> | ||
30 | <WebTestPlugins> | ||
31 | <WebTestPlugin Classname="LIL_VSTT_Plugins.UniqueOnce, LIL_VSTT_Plugins, Version=1.0.0.1, Culture=neutral, PublicKeyToken=null" DisplayName="Datasource Unique Once" Description="(C) Copyright 2011 LIGHTS IN LINE AB
OBS! Läs hela! Styr datasource selection till att endast göras en gång per iteration. Du måste ändra i din datasource Access Metod till Do Not Move Automatically! WebTestUserId används för att välja rad. Använder de datasources som finns definerade i webtestet. Använd test mix based on users starting tests samt 0 percent new users."> | ||
32 | <RuleParameters> | ||
33 | <RuleParameter Name="DataSourceName" Value="DataSource1" /> | ||
34 | <RuleParameter Name="DataSourceTableName" Value="Userdata#csv" /> | ||
35 | <RuleParameter Name="Offset" Value="0" /> | ||
36 | </RuleParameters> | ||
37 | </WebTestPlugin> | ||
38 | <WebTestPlugin Classname="LIL_VSTT_Plugins.myPlugin, LIL_VSTT_Plugins, Version=1.0.0.1, Culture=neutral, PublicKeyToken=null" DisplayName="Expect 100 Off" Description="(C) Copyright 2011 LIGHTS IN LINE AB
Stänger av .NET expected-100 headern i posts." /> | ||
39 | </WebTestPlugins> | ||
40 | </WebTest> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
TestProject1/WebTest1Coded.cs
0 → 100644
1 | //------------------------------------------------------------------------------ | ||
2 | // <auto-generated> | ||
3 | // This code was generated by a tool. | ||
4 | // Runtime Version:4.0.30128.1 | ||
5 | // | ||
6 | // Changes to this file may cause incorrect behavior and will be lost if | ||
7 | // the code is regenerated. | ||
8 | // </auto-generated> | ||
9 | //------------------------------------------------------------------------------ | ||
10 | |||
11 | namespace TestProject1 | ||
12 | { | ||
13 | using System; | ||
14 | using System.Collections.Generic; | ||
15 | using System.Text; | ||
16 | using Microsoft.VisualStudio.TestTools.WebTesting; | ||
17 | |||
18 | |||
19 | public class WebTest1Coded : WebTest | ||
20 | { | ||
21 | |||
22 | public WebTest1Coded() | ||
23 | { | ||
24 | this.PreAuthenticate = true; | ||
25 | } | ||
26 | |||
27 | public override IEnumerator<WebTestRequest> GetRequestEnumerator() | ||
28 | { | ||
29 | WebTestRequest request1 = new WebTestRequest("http://www.lil.nu/"); | ||
30 | request1.ParseDependentRequests = false; | ||
31 | request1.Encoding = System.Text.Encoding.GetEncoding("utf-8"); | ||
32 | request1.Headers.Add(new WebTestRequestHeader("Cookie", "TestCookie=\"test,test\"")); | ||
33 | yield return request1; | ||
34 | request1 = null; | ||
35 | } | ||
36 | } | ||
37 | } |
TestProject1/WebTest2.webtest
0 → 100644
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <WebTest Name="WebTest2" Id="9af8354e-b982-4f5a-80f9-777eaed55003" Owner="" Priority="2147483647" Enabled="True" CssProjectStructure="" CssIteration="" Timeout="0" WorkItemIds="" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010" Description="" CredentialUserName="" CredentialPassword="" PreAuthenticate="True" Proxy="" StopOnError="False" RecordedResultFile="WebTest2.0af40a55-b204-4b39-8847-71e26a47524d.rec.webtestresult"> | ||
3 | <Items> | ||
4 | <Request Method="GET" Guid="e02258d2-a380-44f4-891d-a8c829b5428c" Version="1.1" Url="http://www.lightsinline.se/" ThinkTime="0" Timeout="300" ParseDependentRequests="True" FollowRedirects="True" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8" ExpectedHttpStatusCode="0" ExpectedResponseUrl="" ReportingName="" /> | ||
5 | <TransactionTimer Name="Transaction2"> | ||
6 | <Items> | ||
7 | <Request Method="GET" Guid="e02258d2-a380-44f4-891d-a8c829b5428c" Version="1.1" Url="http://www.lightsinline.se/" ThinkTime="0" Timeout="300" ParseDependentRequests="True" FollowRedirects="True" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8" ExpectedHttpStatusCode="0" ExpectedResponseUrl="" ReportingName="" /> | ||
8 | <Request Method="GET" Guid="e02258d2-a380-44f4-891d-a8c829b5428c" Version="1.1" Url="http://www.lightsinline.se/" ThinkTime="0" Timeout="300" ParseDependentRequests="True" FollowRedirects="True" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8" ExpectedHttpStatusCode="0" ExpectedResponseUrl="" ReportingName="" /> | ||
9 | </Items> | ||
10 | </TransactionTimer> | ||
11 | </Items> | ||
12 | <WebTestPlugins> | ||
13 | <WebTestPlugin Classname="LIL_VSTT_Plugins.dataGenTimestamp, LIL_VSTT_Plugins, Version=1.2.0.0, Culture=neutral, PublicKeyToken=null" DisplayName="Data Generator Timestamp" Description="(C) Copyright 2011 LIGHTS IN LINE AB
Genererar en timestamp som context parameter"> | ||
14 | <RuleParameters> | ||
15 | <RuleParameter Name="ParamNameVal" Value="TimeStampParameter1" /> | ||
16 | <RuleParameter Name="MillisecondsVal" Value="True" /> | ||
17 | <RuleParameter Name="PrePageVal" Value="False" /> | ||
18 | <RuleParameter Name="PreTransactionVal" Value="False" /> | ||
19 | <RuleParameter Name="PreRequestVal" Value="True" /> | ||
20 | </RuleParameters> | ||
21 | </WebTestPlugin> | ||
22 | </WebTestPlugins> | ||
23 | </WebTest> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
TraceAndTestImpact.testsettings
0 → 100644
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <TestSettings name="Trace and Test Impact" id="b4128d8d-ffff-46f4-afae-98bb333d8b32" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010"> | ||
3 | <Description>These are test settings for Trace and Test Impact.</Description> | ||
4 | <Execution> | ||
5 | <TestTypeSpecific /> | ||
6 | <AgentRule name="Execution Agents"> | ||
7 | <DataCollectors> | ||
8 | <DataCollector uri="datacollector://microsoft/SystemInfo/1.0" assemblyQualifiedName="Microsoft.VisualStudio.TestTools.DataCollection.SystemInfo.SystemInfoDataCollector, Microsoft.VisualStudio.TestTools.DataCollection.SystemInfo, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" friendlyName="System Information"> | ||
9 | </DataCollector> | ||
10 | <DataCollector uri="datacollector://microsoft/ActionLog/1.0" assemblyQualifiedName="Microsoft.VisualStudio.TestTools.ManualTest.ActionLog.ActionLogPlugin, Microsoft.VisualStudio.TestTools.ManualTest.ActionLog, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" friendlyName="Actions"> | ||
11 | </DataCollector> | ||
12 | <DataCollector uri="datacollector://microsoft/HttpProxy/1.0" assemblyQualifiedName="Microsoft.VisualStudio.TraceCollector.HttpProxyCollector, Microsoft.VisualStudio.TraceCollector, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" friendlyName="ASP.NET Client Proxy for IntelliTrace and Test Impact"> | ||
13 | </DataCollector> | ||
14 | <DataCollector uri="datacollector://microsoft/TestImpact/1.0" assemblyQualifiedName="Microsoft.VisualStudio.TraceCollector.TestImpactDataCollector, Microsoft.VisualStudio.TraceCollector, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" friendlyName="Test Impact"> | ||
15 | </DataCollector> | ||
16 | <DataCollector uri="datacollector://microsoft/TraceDebugger/1.0" assemblyQualifiedName="Microsoft.VisualStudio.TraceCollector.TraceDebuggerDataCollector, Microsoft.VisualStudio.TraceCollector, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" friendlyName="IntelliTrace"> | ||
17 | </DataCollector> | ||
18 | </DataCollectors> | ||
19 | </AgentRule> | ||
20 | </Execution> | ||
21 | </TestSettings> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
-
Please register or sign in to post a comment