我需要编写一个脚本,将用户名和密码传递给Windows安全身份验证弹出窗口。这是测试其他凭据所必需的,因为我不想使用我自己的凭证。
答案 0 :(得分:0)
使用VBScript,我创建了以下函数:
set IE = CreateObject("InternetExplorer.Application")
set WshShell = WScript.CreateObject("WScript.shell")
IE.visible = 1
IE.navigate("http://website")
WshShell.AppActivate "Windows Internet Explorer"
WScript.Sleep 1000
WshShell.SendKeys "UserNAME"
WScript.Sleep 500
WshShell.SendKeys "{TAB}"
WScript.Sleep 500
WshShell.SendKeys "Password"
WScript.Sleep 500
WshShell.SendKeys "{TAB}"
WScript.Sleep 500
WshShell.SendKeys "{TAB}"
WScript.Sleep 500
WshShell.SendKeys "{ENTER}"
WScript.Sleep 2000
IE.Quit