Click here to Skip to main content
15,888,026 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I am using WatiN for Automated Testing in Web applications.

MIDL
ie.TextField(Find.ByName("txt_UserName")).TypeText("Username");
            ie.TextField(Find.ByName("txt_Password")).TypeText("Password");
            ie.Button(Find.ByName("btnLogin")).Click();


In this code, the first two lines are working properly that the given texts are automatically typing in the respective Textboxes.

But when i click Login Button, it takes much time for loading the next .aspx page. Before that page gets loaded, i am getting TimeOutException error.

Can someone help me how to use WaitUntil() (or) WaitForComplete() functions to overcome this problem.

If you have any other idea also, please suggest me.

Thanks a lot!!!
Posted

1 solution

Hi Use the below code on Login button click event before you call the next .aspx page

System.Threading.Thread.Sleep(5000);


Where 5000 is 5 seconds, increae the sleep time accordingly
 
Share this answer
 

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