|
现在启动的浏览器默认的都是本机的用户,我希望用另外一个用户启动浏览器, 有谁知道怎么操作吗? 用.NET API是这样实现的:
SecureString ss = new SecureString();
char[] pass = new char[] { '1', '2', '3', '4', '5', '6', '7', '0', '1' };
foreach (char item in pass)
{
ss.AppendChar(item);
}
ProcessStartInfo psi = new ProcessStartInfo("C:\\Program Files (x86)\\Internet Explorer\\iexplore.exe");
psi.UserName = "";
psi.Domain = "";
psi.Password = ss;
psi.UseShellExecute = false;
psi.WorkingDirectory = "C:\\Program Files (x86)\\Internet Explorer";
try
{
Process.Start(psi);
}
catch (Exception e)
{
Console.WriteLine("Exception: " + e.Message);
}
Console.WriteLine("done");
webdriver有这样的方法吗? |
|