On 5 February 2010 05:48, Peter Gfader <[email protected]> wrote:
> E.g. WATIN
>         private void WebsiteLoginToWebsite(string username, string password)
>         {
>             // Browse to login page
>             browser.Div(Find.By("innertext", "Member Login")).Click();
>
>  browser.TextField(Find.ByName("ctl10$Header1$txtEmail")).TypeText(username);
>
>  
> browser.TextField(Find.ByName("ctl10$Header1$txtPassword")).TypeText(password);
>             browser.Button(Find.ByName("ctl10$Header1$btnLogin")).Click();
>         }

As an aside, piecemeal pushing and prodding of elements leads to very
brittle tests. You may like to look at WatiN's strongly-typed page
classes instead:

private void WebsiteLoginToWebsite(string username, string password)
{
        var page = browser.Page<LoginPage>();

        page.Email.TypeText(username);
        page.Password.TypeText(password);
        page.Login.Click();

        // etc
}

More: http://watinandmore.blogspot.com/2009/06/introducing-page-class.html

> Create a coded UI test for a whole user interaction with your web app?
> e.g. Register, Login, Browse, Find, Add to Shopping cart, Update Billing
> Address, Update Shipping Address, Checkout, Pay, See Order successful
> Create a coded UI tests for single screens
> e.g. Logon screen: Assert "Username", "Password" boxes and "Login" button
> are there

An acceptance (UI) test should be written for each user story.

--
Richard Dingwall
http://richarddingwall.name
_______________________________________________
oztfs mailing list
[email protected]
http://prdlxvm0001.codify.net/mailman/listinfo/oztfs

Reply via email to