Click here to Skip to main content
16,019,043 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Below is the method code used for unit test case:

[TestMethod]
[HostType("ASP.NET")]
[UrlToTest("https://login.live.com/login.srf?wa=wsignin1.0&rpsnv=11&ct=1311328495&rver=6.1.6206.0&wp=MCMBI&wreply=https:%2F%2Fmcp.microsoft.com%2FAuthenticate%2FMigrate%2FMigrate.aspx%3FReturnUrl%3Dhttps:%2F%2Fmcp.microsoft.com%2Fmcp%2Fdefault.mspx&lc=1033&cb=wizid%3Ddf57638e-b739-4667-8316-25dc173aef4b%26returnurl%3Dhttps%253a%252f%252fmcp.microsoft.com%252fAuthenticate%252fMigrate%252fMigrate.aspx%253fReturnUrl%253dhttps%253a%252f%252fmcp.microsoft.com%252fmcp%252fdefault.mspx%26wp%3DMCMBI%26lcid%3D1033&id=74335")]

        public void LoginCheck()
        {
            Page page = testContextInstance.RequestedPage;
            PrivateObject po = new PrivateObject(page);
            TextBox txt1 = (TextBox)page.FindControl("login");

            po.Invoke("Page_Load", page, EventArgs.Empty);

            Assert.AreEqual(txt1.Text, "", true);

        }


Error:

The URL specified ('https://login.live.com/login.srf?wa=wsignin1.0&rpsnv=11&ct=1.....(same as the url mentioned above)') does not correspond to a valid directory. Tests configured to run in ASP.NET in IIS require a valid directory to exist for the URL. The URL may be invalid or may not point to a valid Web application.

----------

Issue: The unit test case created in VS2008 accessing a url of project not hosted in local IIS, error's out the above message also FYI..though the same url is accessible through the browser. But when the same peice of code is executed with the url of the project i.e., "http://localhost/abc123", then the unit test case gets executed successfully.

How can we access a url of project not hosted in local IIS?
Posted
Updated 22-Jul-11 4:53am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900