Team System Developer Center >
Visual Studio Team System Forums
>
Visual Studio Team System - Testing
>
"Parse Dependant Requests" but don't parse "Google Analytics" requests
"Parse Dependant Requests" but don't parse "Google Analytics" requests
- I don't want my web test to parse google analytics tracking script.
<script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); </script>
Is there a way to do this with coded web tests or with other methods?
Answers
- Hello Milonguero,
As I know, we could utilize the web test request level plug in to achieve the goal.
I did some tests on my machine and everthing went well. Here are the related codes you may refer to:
public class Class1:WebTestRequestPlugin
Here is an article about how to resolve this issue you can refer to.
{
public override void PostRequest(object sender, PostRequestEventArgs e)
{
List<WebTestRequest> remove=new List<WebTestRequest>();
foreach(WebTestRequest t in e.Request.DependentRequests)
{
if(t.Url==@"http://localhost:40915/WebSite53/JScript.js")
{
remove.Add(t);
}
}
foreach(WebTestRequest m in remove)
e.Request.DependentRequests.Remove(m);
}
}
More detailed information about request level plug in, you can refer to the following article:
http://msdn.microsoft.com/en-us/library/bb514192.aspx
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Send us any feedback you have about the help from MSFT at fbmsdn@microsoft.com.- Marked As Answer byEdwer FangMSFT, ModeratorWednesday, November 11, 2009 5:59 AM
All Replies
- Hello Milonguero,
As I know, we could utilize the web test request level plug in to achieve the goal.
I did some tests on my machine and everthing went well. Here are the related codes you may refer to:
public class Class1:WebTestRequestPlugin
Here is an article about how to resolve this issue you can refer to.
{
public override void PostRequest(object sender, PostRequestEventArgs e)
{
List<WebTestRequest> remove=new List<WebTestRequest>();
foreach(WebTestRequest t in e.Request.DependentRequests)
{
if(t.Url==@"http://localhost:40915/WebSite53/JScript.js")
{
remove.Add(t);
}
}
foreach(WebTestRequest m in remove)
e.Request.DependentRequests.Remove(m);
}
}
More detailed information about request level plug in, you can refer to the following article:
http://msdn.microsoft.com/en-us/library/bb514192.aspx
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Send us any feedback you have about the help from MSFT at fbmsdn@microsoft.com.- Marked As Answer byEdwer FangMSFT, ModeratorWednesday, November 11, 2009 5:59 AM


