2012-11-02 82 views
0

我的WatiN应用程序通过几个网页自动完成。是否有可能在WatiN暂停?

是否有可能让自动化在特定时间点暂停,并且只有在用户这样说的时候才继续自动化(点击继续按钮)?

+0

你在用什么 - WinForms,WPF?看看事件 - 例如这一个http://msdn.microsoft.com/en-us/library/system.windows.forms.control.keypress.aspx – t3hn00b

回答

0

我在我的项目类似的东西,也许这可以帮助(我没有很好的测试这一点,但它可能为你指明正确的方向:d)

private System.Threading.AutoResetEvent arEvent = null; 
private System.Windows.Forms.NotifyIcon nIcon = null; 

public void WatinBreakpoint() 
{ 
    this.arEvent = new System.Threading.AutoResetEvent(false); 
    this.nIcon = new NotifyIcon(); 
    this.nIcon.Text = "Watin Breakpoint. Double click to continue"; 
    this.notifyIcon.DoubleClick += new EventHandler(notifyIcon_DoubleClick); 
    this.arEvent.WaitOne(); 
} 

private void notifyIcon_DoubleClick(object sender, EventArgs e) 
{ 
    this.arEvent.Set(); 
} 

HTH!