selenium webdriver实现windows 身份验证

1.登陆需要windows 认证时,可以使用在URL中加入用户名和密码



语法:

http://username:password@url

例如:

http://admin:[email protected]/en.asp


2.使用AutoIT录制

脚本编辑器编辑

;ControlFocus("title","text",controlID)Edit1=Edit instance 1

ControlFocus("Windows 安全","","DirectUIHWND1")

; Wait 10 seconds for the Upload window toappear

WinWait("[CLASS:#32770]","",10)

; Set the File name text on the Edit field

ControlSetText("Windows 安全","", "Edit1", "用户名")

Sleep(2000)

ControlSetText("Windows 安全","", "Edit2", "密码")

; Click on the Open button

ControlClick("Windows 安全","","Button2");





你可能感兴趣的:(selenium webdriver实现windows 身份验证)