2012-11-02 35 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!