tags:

views:

126

answers:

0

Hello,

I was trying to search the archives so as not to post a question that might already have been answered. I am a newbie with WatiN and am facing a problem with text areas.

Using Visual Studio I am trying to automate a web page testing The test involves filling a box with user’s contact info and submit a request to be contacted

The test runs really quickly and the text areas are filled and immediately cleared! The submit button is clicked and the validation fails. The interesting thing is that the test only fails some of the times! And when it does, the error message points to different lines each time!

Interestingly, this does not happen when running the test in debug mode and using breakpoints.

Here’s the code:

//Submit a request to be contacted

            ie.TextField(Find.ByName("txtFirstName")).TypeText("Mickey");

            ie.TextField(Find.ByName("txtSurname")).TypeText("Mouse");

            ie.TextField(Find.ByName("txtEmail")).TypeText("[email protected]");                ie.TextField(Find.ByName("txtHomeWorkPhone")).TypeText("02070671500");
            ie.Button(Find.ByValue("Submit")).Click();
            ie.Div(Find.ById("Popup10002_Inner"));
            ie.Div("Popup10002_Inner").Text.CompareTo("Thank you");

Any suggestions?

Thanks in advance, Sarah Ancellotti