Answered by:
$filter requests are not recorded in the URL, but stored as querystring

Question
-
We are running a load test in visual studio ultimate and we use .webtest files. We are testing odata webservice . We are retrieving load test results from loadtest2010 database and creating a html report manually. Webservice test URLs are like http://serveraddress:8080/webservice/odata.svc/Pages?$filter=day(CreationDate)%20eq%204
When I run the test, in the result viewer I expect to see the URLs exactly as it was sent. But the URL gets converted to http://serveraddress:8080/webservice/odata.svc/Pages. Also in the loadtest2010 databse in webloadrequestmap table, the URI is http://serveraddress:8080/webservice/odata.svc/Pages. As different requests with $filter are shown as same request in the result database and result viewer, it is difficult for us to make a good report.
I would like to fetch the exact URL from the result file/db with the querystrings in the URL itself. Is it possible to get this somehow?
Thanks
Sambit
- Edited by sambit mahanta Monday, May 19, 2014 12:37 PM
Friday, May 16, 2014 2:07 PM
Answers
-
Hi Sambit
You might take a look at the Reporting Name Request Property and put the full URL in there. However I forsee another problem you may run into which is there's a cut off where it stops reporting page level information after a certain number of unique pages have been presented.
HTH
- Proposed as answer by Ian Holdsworth Automation Test Engineer Monday, May 19, 2014 3:57 PM
- Marked as answer by Amanda Zhu Tuesday, May 27, 2014 8:23 AM
Monday, May 19, 2014 1:41 PM -
Well, I found a solution. For example, my reporting name is "{{urlName}}" because I expect reporting name will be dynamically created based on urlName parameter.
First we have to generate code for the webtest file. Open the coded.cs file
Then you will see reporting names being stored as following:
request1.ReportingName = (this.Context["urlName"].ToString());
Now remove .ToString(). It should look as following:
request1.ReportingName = (this.Context["urlName"]);
Now it will dynamically generate the reporting name.
Use the the coded cs file for the load test.
sambit
- Marked as answer by Amanda Zhu Thursday, May 29, 2014 6:55 AM
Tuesday, May 27, 2014 3:32 PM -
Thanks for Ian’s helpful information.
Hi Sambit,
About testing web service, please see:
How to: Create a Web Service Test
We won’t record web service request like we record normal requests through opening the requests in browser. We add web service such as http://localhost/storecsvs/InstantOrder.asmxthrough Add Web Service Request in web test then right-click the Web service request and select Add URL QueryString Parameter.
I believe that recording filter parameters as query string parameters rather than recording exact request URL is the default behavior. Web test will detect parameters of a request automatically and record them as query string parameter or post form parameters.
Except you can’t get the exact request from web test result viewer, you can’t get it from load test result either.
In load test result database, only WebLoadTestRequestMap table provides us the request url information in web test through RequestUri field.
RequestUri (nvarchar (2048)): The Uri for the request. But this excludes the query string parameters except for those query string parameters with the property "
So currently using Reporting Name property to generate the report with exact request URLs is the only way.
Best regards,
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.- Proposed as answer by Amanda Zhu Friday, May 23, 2014 5:18 AM
- Marked as answer by Amanda Zhu Tuesday, May 27, 2014 8:23 AM
Tuesday, May 20, 2014 2:35 AM
All replies
-
Hi,
Please check the web test editor to see whether http://serveraddress:8080/webservice/odata.svc/Pages?$filter=day(CreationDate)%20eq%204 was recorded in web test. If such request was not recorded, however http://serveraddress:8080/webservice/odata.svc/Pages request was recorded, then what you see in web test result viewer and load test database is expected and correct.
You can try to use Fiddler tool to record request sessions. If the exact request and query string parameters are recorded with Fiddler, then you can convert those request sessions to web test and then run web test within load test from Visual Studio.
About the usage of Fiddler tool, please see:
VSTS Testing: Using Fiddler to record VSTS web tests
If I misunderstood anything, please feel free to let me know.
Best regards,
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.- Edited by Amanda Zhu Tuesday, May 20, 2014 2:14 AM edit
Monday, May 19, 2014 7:45 AM -
Thanks Crystal for the reply.
But it did not solve the problem.
When we record URLs with filter queries , web test recorder captures only the base URL and it puts filter queries as QueryString. This happens even when we manually add the URLS without recording. As a result all filter queries in test result look same although they are different requests.
I tried with Fiddler. Fiddler captures the exact URL. However when I export it as webtest file, it again gets broken down as base URL and query string.
I would appreciate if there are any other solution as it is blocking us from using visual studio as a test tool.
Thanks
Sambit
- Edited by sambit mahanta Monday, May 19, 2014 12:21 PM
Monday, May 19, 2014 12:20 PM -
Hi Sambit
You might take a look at the Reporting Name Request Property and put the full URL in there. However I forsee another problem you may run into which is there's a cut off where it stops reporting page level information after a certain number of unique pages have been presented.
HTH
- Proposed as answer by Ian Holdsworth Automation Test Engineer Monday, May 19, 2014 3:57 PM
- Marked as answer by Amanda Zhu Tuesday, May 27, 2014 8:23 AM
Monday, May 19, 2014 1:41 PM -
Thanks a lot. We can manage with this as we have around 100 pages to be tested by 1 user and 1 iteration
- Edited by sambit mahanta Monday, May 19, 2014 3:38 PM
Monday, May 19, 2014 3:38 PM -
Thanks for Ian’s helpful information.
Hi Sambit,
About testing web service, please see:
How to: Create a Web Service Test
We won’t record web service request like we record normal requests through opening the requests in browser. We add web service such as http://localhost/storecsvs/InstantOrder.asmxthrough Add Web Service Request in web test then right-click the Web service request and select Add URL QueryString Parameter.
I believe that recording filter parameters as query string parameters rather than recording exact request URL is the default behavior. Web test will detect parameters of a request automatically and record them as query string parameter or post form parameters.
Except you can’t get the exact request from web test result viewer, you can’t get it from load test result either.
In load test result database, only WebLoadTestRequestMap table provides us the request url information in web test through RequestUri field.
RequestUri (nvarchar (2048)): The Uri for the request. But this excludes the query string parameters except for those query string parameters with the property "
So currently using Reporting Name property to generate the report with exact request URLs is the only way.
Best regards,
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.- Proposed as answer by Amanda Zhu Friday, May 23, 2014 5:18 AM
- Marked as answer by Amanda Zhu Tuesday, May 27, 2014 8:23 AM
Tuesday, May 20, 2014 2:35 AM -
Does anybody know if it is possible to parameterize the ReportingName? Since the webservice requests are going to run against different app servers, I want to parameterize the Reporting name so that in WebLoadTestRequestMap table they are stored as different URIs.
sambit
- Edited by sambit mahanta Tuesday, May 27, 2014 2:50 PM
Tuesday, May 27, 2014 2:49 PM -
Hi Sambit
Sadly no you can't parametrise Reporting Name however if you write a request level plug-in you should be able to override it.
HTH
Tuesday, May 27, 2014 3:23 PM -
Well, I found a solution. For example, my reporting name is "{{urlName}}" because I expect reporting name will be dynamically created based on urlName parameter.
First we have to generate code for the webtest file. Open the coded.cs file
Then you will see reporting names being stored as following:
request1.ReportingName = (this.Context["urlName"].ToString());
Now remove .ToString(). It should look as following:
request1.ReportingName = (this.Context["urlName"]);
Now it will dynamically generate the reporting name.
Use the the coded cs file for the load test.
sambit
- Marked as answer by Amanda Zhu Thursday, May 29, 2014 6:55 AM
Tuesday, May 27, 2014 3:32 PM