4

I am just trying out Application Insights availability tests. I let them run over night to our public website and got only "fails"

When I drill in to the separate test runs, I see that the server responded with "200 OK", sending the expected html markup. But in "Exceptins" it says

System.UriFormatException: Invalid URI: The format of the URI could not be determined.System.UriFormatException: Invalid URI: The format of the URI could not be determined.
   at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
   at Microsoft.VisualStudio.TestTools.WebTesting.HtmlDocument.ParseForDependentRequests(Boolean urlsOnly)
   at Microsoft.VisualStudio.TestTools.WebStress.WebTestCaseVariation.BuildDependentRequestsList(WebTestInstrumentedTransaction instrumentedTransaction)
   at Microsoft.VisualStudio.TestTools.WebStress.WebTestCaseVariation.AddParsedDependentRequests(ExecutionState executionState)

this is what I see in azure portal

Does anyone have an idea what's going on there? What am I missing?

Alexander Marek
  • 479
  • 1
  • 7
  • 22
  • Can you please paste Availability Test configuration (url)? This error might occur, for instance, when there is a typo in provided URL. – ZakiMa Jan 28 '17 at 01:24
  • I do not want to post the url here. But believe me it is totally correct. For one I already tried to copy and paste it into a browser and that worked just fine. Secondly the response html shown in the screenshot (response body) is exactly the markup from that webpage. So the url must be correct. – Alexander Marek Jan 29 '17 at 19:12
  • Got it! Exception in ParseForDependentRequests most likely means that it tried to follow some resource mentioned on html page and it looks like it is complaining about that URL, not the main one. Do you have many references in html page? If not - is it possible to examine them? – ZakiMa Jan 30 '17 at 06:01
  • So, what's most likely going on: 1) server responds with 200 and html page; 2) web test parses it, identifies what appears to be dependent resources; 3) parses them, encounters bad URL (either incorrect dependency identification or a potential bug in html page); 4) fails a test and records an exception. – ZakiMa Jan 30 '17 at 06:02
  • hmmm... this is basically only the login screen of our web application written with asp.net and angular.js When I open it with fiddler running, the only "error" I get is a 404 for "/Content/fontawesome/fonts/fontawesome-webfont.woff2?v=4.3.0" which is known to us. But should that lead to a failed availability test??? Can I somehow configure the test to ignore "invalid links"? – Alexander Marek Jan 30 '17 at 12:52
  • It is possible to configure not to validate dependent requests. Note, you will not have coverage for them. So, if CDN stops returning script files webtest will not catch it. – ZakiMa Jan 30 '17 at 17:52
  • 404 - is different. Here WebTest failed during parsing html page and didn't start executing dependent requests. – ZakiMa Jan 30 '17 at 17:52

1 Answers1

5

Most likely this exception occurs when webtest engine tries to parse dependent requests information to validate resources. Either webtest incorrectly parses dependency resource or web page contains an invalid reference.

WebTest should give a better error explaining to which resource it is complaining.

To workaround this problem (if it is acceptable) - you can disable "Parse dependent requests" option (see below). Note - webtest will not be testing dependent resources.

enter image description here

ZakiMa
  • 5,637
  • 1
  • 24
  • 48
  • Thank you for the hint! I'll check that out and ping back :) – Alexander Marek Jan 31 '17 at 08:56
  • Locally, you can disable "ParseDependentRequests" by going to the properties of the request and setting it to false. Adding it here since it took me some time to figure that out. Hope it helps someone. – RKS Jul 11 '18 at 20:24