求助:如何执行ie弹出窗口按扭[已解决]
本帖最后由 xjxcd 于 2012-4-16 14:59 编辑执行_Ieaction($otext,"click")弹如上图对话框,如何发送命令确定点击,用send("{Enter}")、controlclick("Microsoft Inernet Explorer","您要删除此信息吗","")都未能执行 WinActivate("Microsoft Inernet Explorer")
send("{Enter}") 回复 2# haijie1223
试过WinActivate("Microsoft Inernet Explorer"),不启作用 可以尝试使用timer消息 回复 3# xjxcd
Opt("WinTitleMatchMode",1) 测试使用timer消息是有效果的
#include <IE.au3>
#include <Timers.au3>
$oIE = _IECreateEmbedded()
$gui = GUICreate("测试",600,600)
GUICtrlCreateObj($oIE,0,0,600,600)
GUISetState()
_IENavigate($oIE,@ScriptDir&"\test.html")
$iid = _Timer_SetTimer(0,250,"click")
_IELinkClickByText($oIE,"百度")
Do
Until GUIGetMsg()=-3
Func click($hwnd,$msg,$wPlate,$lPlate)
$handle = WinWait("")
ControlClick($handle,"","Button1")
_Timer_KillTimer(0,$iid)
EndFunc
test.html<html>
<body>
<a href="http://www.baidu.com" onclick=alert("ok")>百度</a>
</body>
</html> 谢谢两位的帮助,星期一上班后回去测试,结果将报告. 参考了http://www.autoitx.com/forum.php?mod=viewthread&tid=7128&highlight=ie%2B%B5%E3%BB%F7 解决了
$oForm = _IEFormGetObjByName ($oIE1, "WarForm")
$oText = _IEFormElementGetObjByName ($oForm, "DelSelect")
$hwnd = _IEPropertyGet($oIE1, "hwnd")
_IEAction ($oText, "focus")
ControlSend($hwnd, "", "", "{Enter}")
WinWait("Microsoft Internet Explorer", "")
ControlClick("Microsoft Internet Explorer", "", "") 标记下 JAVASCRIPT ALERT CONFIRM 弹出框 点击 卡住 脚本 IE
页:
[1]