1
IEDriverServerを別のユーザーとして実行しています。IEブラウザを開き、既存のIEDriverServerに「接続」してください
RunAs("C:\\Exlporer/IEDriverServer.exe", "User","Password");
_webdriverIE = new InternetExplorerDriver();
var CustomerPage = new CRMLogin(_webdriverIE).GoToCRMURL("http://foo.com");
public void RunAs(string path, string username, string password)
{
ProcessStartInfo myProcess = new ProcessStartInfo(path);
myProcess.UserName = username;
myProcess.Password = MakeSecureString(password);
myProcess.UseShellExecute = false;
myProcess.LoadUserProfile = true;
myProcess.Verb = "runas";
myProcess.Domain = "DOM001";
Process.Start(myProcess);
}
public SecureString MakeSecureString(string text)
{
SecureString secure = new SecureString();
foreach (char c in text)
{
secure.AppendChar(c);
}
return secure;
}
私はIEブラウザを開きたいのですが、私は今開いている既存のドライバに "接続"します。
InternetExplorerDriver
に呼び出すとき、それは(もちろん)ドライバの新しいセッションを開き、前のものが認識要素などの面では意味を持たない。..
_webdriverIE = new InternetExplorerDriver();
私はANにブラウザを接続することができます既存のInternetExplorerDriver
?