WebTest export - ReportingName

5 posts, 2 answers
  1. 48
    48 avatar
    2 posts
    Member since:
    Mar 2015

    Posted 16 Mar 2015 Link to this post

    I am attempting to create a plugin to allow the WebTest export to enable me to achieve the following:

    1. Add the ReportingName to each WebTest request from using a combination of form element values.
    2. Replace a value with a WebTest parameter: {{exampleParameter}}

    Current issue:
    1. I can't seem to retrieve the ReportingName setter from the IFiddlerWebTestPlugin interface?
    2. I believe I can do this with current functionality as it's a simple transform from one value to another prior to saving the request.

    Any help gratefully received.

    I have attached a simple WebTest file with a snippet below (you'll need to convert the .jpeg to a .webtest (or .txt).

    WebTest snippet:

      <Items>
        <Request Method="GET" Guid="c2bdeaaa-352c-4835-ad7b-ea7d723cdfa8" Version="1.1" Url="http://www.google.co.uk/" ThinkTime="0" Timeout="300" ParseDependentRequests="True" FollowRedirects="True" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8" ExpectedHttpStatusCode="0" ExpectedResponseUrl="https://www.google.co.uk/?gws_rd=ssl" ReportingName="Navigate to Google" IgnoreHttpStatusCode="False">
  2. Eric Lawrence
    Admin
    Eric Lawrence avatar
    833 posts

    Posted 17 Mar 2015 Link to this post

    Unfortunately, I don't think the WebTest Export extensibility enables the level of customization you seek. The extensibility model enables plugins to skip writing certain steps to the test, and add extraction/validation rules, but it doesn't provide any mechanism to change the XML of the step as it's written to the file.

    Fiddler does promote the Session's ui-comments flag to a CommentText element in the XML, but I assume that Visual Studio isn't smart enough to fallback to the comment if the ReportingName isn't set?

    I could probably tweak the code such that Fiddler sets the ReportingName attribute if the your plugin sets a WebTest-ReportingName flag on the Session?


    With regard to the "replace a value with a WebTest parameter"-- I don't know enough about your scenario to understand what this would entail? It may already be possible to do this with your PreWebTestSave event handler...

    Regards,
    Eric Lawrence
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. Answer
    Adrian
    Adrian avatar
    4 posts
    Member since:
    Nov 2012

    Posted 18 Mar 2015 in reply to Eric Lawrence Link to this post

    Reporting names and comments are quite separate in Visual Studio. Empty or unset reporting names are set from the URL, taking the value after the right-most "/"; query strings are ignored. Reporting names can be set at run time in Visual Studio using a plugin; these values are also trimmed to just the item after the right-most "/".

    The two changes you want to make could, I believe, be achieved by modifying the ".webtest" file after Fiddler has written it. The Visual Studio ".webtest" file is just XML. I have used a text editor to set and to modify reporting names in the XML. I have also written both C# and Perl programs to do simple manipulations of the XML when I wanted to do the same action several times and so a text editor would be unsuitable.
  4. Answer
    Eric Lawrence
    Admin
    Eric Lawrence avatar
    833 posts

    Posted 19 Mar 2015 Link to this post

    Fiddler 2.5/4.5 promote a "WebTest-ReportingName" flag from the Session to the target attribute in the XML.

    As no further information has been provided about the "WebTest parameter", that aspect is unchanged for now.

    Regards,
    Eric Lawrence
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  5. 48
    48 avatar
    2 posts
    Member since:
    Mar 2015

    Posted 24 Mar 2015 Link to this post

    Thank you both for your replies. I have some time between projects to have another go. It is simply xml file manipulation that could be achieved using many tools outside of Fiddler. I just wondered if there were any built in hooks.

    Thanks again.
Back to Top