2010-12-22 40 views
0

如何打開選項卡並轉到「http://anotherwisite.com」?我嘗試這樣做:使用Watin在IE中打開新選項卡

ie = new WatiN.Core.IE("https://somewebsite.com", true); 
ie.TextField(WatiN.Core.Find.ByName("user")).TypeText(User.getName()); 
ie.TextField(WatiN.Core.Find.ByName("password")).TypeText(User.getPassword()); 
ie.Button(WatiN.Core.Find.Any).Click(); 

(上面的代碼打開IE並登錄的人)

回答

0

有一個在華廷沒有內置的方法來做到這一點。

3

我可以打開一個新的標籤,並打開新的頁面,華廷

代碼:

var browser1 = new FireFox("http://www.omda.com"); 
SendKeys.SendWait("^{t}"); 
browser1.GoTo("http://www.omda2.com"); 

我使用鍵盤,按CTRL + T在Firefox。

0
System.Windows.Forms.SendKeys.SendWait("^{t}"); 
Thread.Sleep(400); 
//this is the new browser instance 
var newTab = Browser.AttachTo<IE>(Find.ByTitle(string.Empty)); 
相關問題