WatiN TimeOutException错误 [英] WatiN TimeOutException error

查看:65
本文介绍了WatiN TimeOutException错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在使用WatiN在Web应用程序中进行自动化测试.

Hi All,

I am using WatiN for Automated Testing in Web applications.

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



在此代码中,前两行正常工作,给定文本将在相应的文本框中自动键入.

但是,当我单击登录按钮"时,将花费很多时间来加载下一个.aspx页.在加载该页面之前,我遇到了TimeOutException错误.

有人可以帮助我如何使用WaitUntil()(或)WaitForComplete()函数来解决此问题.

如果您还有其他想法,请提出建议.

非常感谢!!!!



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!!!

推荐答案

嗨 在调用下一个.aspx页之前,在登录按钮单击事件上使用以下代码

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

System.Threading.Thread.Sleep(5000);



5000是5秒,请相应地增加睡眠时间



Where 5000 is 5 seconds, increae the sleep time accordingly


这篇关于WatiN TimeOutException错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆