保存对话框无法交互-Selenium Webdriver与Java
以前,我是这个AutoIT的新手,我不熟悉这个,只是谷歌需要完成我的任务,如果我的AtotoIt有任何错误,请更正它 范围: 在从IEversion 9下载Xml的过程中,它将打开“您想打开还是保存”对话框,因此我想单击“保存”按钮将该Xml文件保存在默认的临时文件夹中 我的autoIT代码引用来自保存对话框无法交互-Selenium Webdriver与Java,selenium,selenium-webdriver,autoit,Selenium,Selenium Webdriver,Autoit,以前,我是这个AutoIT的新手,我不熟悉这个,只是谷歌需要完成我的任务,如果我的AtotoIt有任何错误,请更正它 范围: 在从IEversion 9下载Xml的过程中,它将打开“您想打开还是保存”对话框,因此我想单击“保存”按钮将该Xml文件保存在默认的临时文件夹中 我的autoIT代码引用来自 请帮助解决看看不使用AutoIT下载文件的其他方法 这对你有用吗?XMLDomWrapper.au3可以从 AutoItSetOption("WinTitleMatchMode","2") ;
请帮助解决看看不使用AutoIT下载文件的其他方法 这对你有用吗?XMLDomWrapper.au3可以从
AutoItSetOption("WinTitleMatchMode","2") ; set the select mode to select using substring
if $CmdLine[0] < 2 then
; Arguments are not enough
msgbox(0,"Error","Supply all the arguments, Dialog title,Run/Save/Cancel and Path to save(optional)")
Exit
EndIf
; wait Until dialog box appears
WinWait($CmdLine[1]) ; match the window with substring
$title = WinGetTitle($CmdLine[1]) ; retrives whole window title
WinActivate($title)
If (StringCompare($CmdLine[2],"Open",0) = 0) Then
WinActivate($title)
ControlClick($title,"","Button1")
EndIf
If (StringCompare($CmdLine[2],"Save",0) = 0) Then
WinWaitActive($title)
ControlClick($title,"","Button2")
; Wait for the new dialogbox to open
EndIf
If (StringCompare($CmdLine[2],"Cancel",0) = 0) Then
WinWaitActive($title)
ControlClick($title,"","Button3")
EndIf
WebElement downloadLink = driver.findElement(By
.xpath("(//img[@alt='Download'])[3]"));
downloadLink.click();
Thread.sleep(4000);
dialog = new String[] {
"C:\\Users\\Prabakar\\Desktop\\Save_Dialog_IE.exe", "Save" };
Runtime.getRuntime().exec(dialog);
#include <_XMLDomWrapper.au3>
#include <File.au3>
Global $oXML = ObjCreate("Microsoft.XMLHTTP")
$oXML.Open("GET", "YOUR URL LIKE: http://www.google.com", 0)
$oXML.Send
Global $sFile = _TempFile(@TempDir, '~', '.xml')
FileWrite($sFile, $oXML.responseText)