| || |
CodedUI - testing to see if we can get the response
We usually switch the enviornments and before running actual scripts, would like to see whether apps are up and running.
We have around 30 URLs, so came up with the following idea:
have a script which gets the responses//
var sURL = TestContext.DataRow["sURL"].ToString();
string Message = string.Empty;
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(sURL);
request.Method = "GET";
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
// only testing to see if we can get the response
catch (WebException ex)
Message += ((Message.Length > 0) ? "\n" : "") + ex.Message;
getting some error? if any other ideas, let me know/.