English 中文(简体)
视觉网站演播室 试验
原标题:Visual Studio Web Performance Test

I m running into a "bad request" error when playing back a test. I ve tracked it down to a comma and space in a button that has "Yes, Do" as its value. There is functionality in another page that runs based on this value. When I remove the comma and space in the both pages everything works perfectly. I ve tried toggling the url encode property for that field in the Web Perf Test to true, but it still fails. When I look at the details of the request it shows "Yes,+Do" as the querystring param. I can t change the control value in this situation. Any hints?

最佳回答

It seems odd that the value of a button is being passed as a query string parameter in the first place...

Is it set up where there is an extraction rule from a prior request and then that context parameter is used for a later request? If so, you can actually modify the value. You can either hard code the value in the later request, or if you still need to get it dynamically but just modify it, you can create a pretty simple plugin. Sample code for it would be:

public class StringCharsFromParam: WebTestRequestPlugin
{
    public override void PreRequest(object sender, PreRequestEventArgs e)
    {
        string ExtractParam =  ((string)e.WebTest.Context["NameOfContextParameter"]);
        if (ExtractParam != null && ExtractParam.Contains(", ")
        {
            e.WebTest.Context["NameOfContextParameter"] = ExtractParam.Replace(", ", "");
        }
    }
}

届时,你将把这一网站的《试验》。

问题回答

暂无回答




相关问题
Selenium not working with Firefox 3.x on linux

I am using selenium-server , selenium rc for UI testing in my application . My dev box is Windows with FireFox 3.5 and every thing is running fine and cool. But when i try to run selenium tests on my ...

Best browser for testing under Safari Mobile on Linux?

I have an iPhone web app I m producing on a Linux machine. What s the best browser I can use to most closely mimic the feature-limited version of Safari present on the iPhone? (It s a "slimmed down" ...

Code Coverage Tools & Visual Studio 2008 Pro

Just wondering what people are using for code coverage tools when using MS Visual Studio 2008 Pro. We are using the built-in MS test project and unit testing tool (the one that come pre-installed ...

Is there any error checking web app cralwers out there?

Wondering if there was some sort of crawler we could use to test and re-test everything when changes are made to the web app so we know some new change didn t error out any existing pages. Or maybe a ...

热门标签