开发者

automating asp.net testing

I have to test almost 20 asp.net web application everyday morning to ensure there is no issue in the web sites. so is ther any option to automate it ? There is data entry involved like entering username,password etc.

Note: I will not have the access to the code(only to the applicaiton URL).

开发者_如何学Go

Please suggest some option for this, so that we can avoid the manual effort involved in this. Thanks.

Regards, Jebli.


You should look into web automation tools like WatiN or Selenium.

From the WatiN documentation:

[Test]  
 public void SearchForWatiNOnGoogle() 

{

  using (var browser = new IE("http://www.google.com"))  
  {  
     browser.TextField(Find.ByName("q")).TypeText("WatiN");    
     browser.Button(Find.ByName("btnG")).Click();            
     Assert.IsTrue(browser.ContainsText("WatiN"));            
  }       
}    

From the Selenium Documentation:

using OpenQA.Selenium.Firefox;
using OpenQA.Selenium;

class GoogleSuggest
{

    static void Main(string[] args)
    {
        IWebDriver driver = new FirefoxDriver();

        //Notice navigation is slightly different than the Java version
        //This is because 'get' is a keyword in C#
        driver.Navigate().GoToUrl("http://www.google.com/");
        IWebElement query = driver.FindElement(By.Name("q"));
        query.SendKeys("Cheese");
        System.Console.WriteLine("Page title is: " + driver.Title);
        driver.Quit();
    }

}

WatiN and Selenium are Open Source


VSTT 2010 is a good bet.

Example demos How To: Functional Testing Automation Using Visual Studio 2010 - http://blogs.msdn.com/b/syedab/archive/2010/01/13/how-to-functional-testing-automation-using-visual-studio-2010.aspx

Data Driving Coded UI Tests - http://blogs.msdn.com/b/mathew_aniyan/archive/2009/03/17/data-driving-coded-ui-tests.aspx

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜