AutoIT是否与Mocha Selenium, Nodejs,Javascript一起工作?

Does AutoIT work WIth Mocha Selenium, Nodejs ,Javascript for windows Authtication

本文关键字:Javascript 一起 工作 Nodejs AutoIT Mocha Selenium 是否      更新时间:2023-09-26

我正在自动化一个应用程序,当我们点击按钮弹出windows身份验证时,我使用selenium, mocha, javascript进行自动化请帮助我——如何自动化认证

我尝试使用AutoIT,它启动了AutoIT exe,但无法输入用户名密码

请帮忙

编辑< AutoIT脚本/strong>

WinWaitActive("Authentication Required") 
Send("userid") 
Send("{TAB}") 
Send("password") 
Send("{ENTER}") 

编辑测试代码

  var testAuthencation =function(){ console.log("Auth started");
     var workerProcess = child_process.execFile('C:/AutoITScript/AutoITScrippt.exe', function(error, stdout, stderr)
     { if(error)
 { console.log("Error stack :: " + error.stack);
 console.log("Error code :: " + error.code); console.log("Signal :: " + error.signal);
 } console.log("stdout :: " + stdout);
 console.log("stderr :: " + stderr); }); workerProcess.on('exit',function(code){ console.log('CHild process exited :: Code :: ' + code) });
     } 

我不确定您浏览器上的身份验证窗口的标题是什么。为答案的自动it脚本添加了位改进的代码,因为它不适合注释部分。

WinWaitActive("","Authentication Required","120")
 If WinExists("","Authentication Required") Then
 Send("username{TAB}")
 Send("password{Enter}")
 EndIf

在这里,我试图识别文本目前在身份验证对话框的情况下,标题不被识别。

试一试。