【发布时间】:2015-05-18 08:15:18
【问题描述】:
我遇到过以下情况 https://ipay.adp.com/iPay/login.jsf 单击页面中的登录按钮,我收到了无法处理的弹出窗口。 任何人都可以帮助我解决这种情况..
【问题讨论】:
标签: selenium-webdriver popup alert popupwindow window-handles
我遇到过以下情况 https://ipay.adp.com/iPay/login.jsf 单击页面中的登录按钮,我收到了无法处理的弹出窗口。 任何人都可以帮助我解决这种情况..
【问题讨论】:
标签: selenium-webdriver popup alert popupwindow window-handles
您可以使用autoit 自动弹出弹出窗口。
见:
然后你可以使用java调用exe文件
//click on the login button
Process process= Runtime.getRuntime().exec("C:\\Documents and Settings\\new.exe"); // Give path where the exe is saved.
process.waitFor();
process.destroy();
【讨论】:
请执行以下步骤:
1.下载AutoIT工具。可以从http://www.autoitscript.com/site/autoit/downloads/下载
注意:请下载 AutoIT 完整安装
您会注意到现在创建的 .exe 文件通过以下代码在您的 java 代码中使用此 .exe
Process process=Runtime.getRuntime().exec("exe的绝对路径"); 进程.waitFor(); 进程.destroy(); 或执行以下步骤打开记事本并粘贴下面提到的代码
函数 _Au3RecordSetup() Opt('WinWaitDelay',100) Opt('WinDetectHiddenText',1) Opt('MouseCoordMode',0) 本地 $aResult = DllCall('User32.dll', 'int', 'GetKeyboardLayoutNameW', 'wstr', '') 如果 $aResult[1] '00000409' 那么 MsgBox(64, 'Warning', '录音已经在不同的键盘布局下完成' & @CRLF & '(00000409->' & $aResult[1] & ')') 结束如果
结束函数
_AU3RecordSetup()
发送("testUsername{TAB}Testpasword{ENTER}")
将文件另存为“authenticationAD.au3”现在创建此文件的 exe,就像上面在步骤 11-12 中提到的相同步骤,请使用正确的更改 testUsername 和密码,但不要删除和 {Tab} {and Enter}
如果您仍然面临这个问题,请告诉我,我会通过电子邮件向您发送带有 auto it 脚本的 java 文件
【讨论】: