Transactions.ExportModal exportModal = transactions.new ExportModal();
exportModal.CSVFormat.click();
Thread.sleep(10000);
Runtime.getRuntime().exec("C:\\Users\\20722\\eclipse-workspace\\project\\libs\\ClickOnSave.exe");
String FileName = getLatestFilefromDir();
AssertVerify(FileName.startsWith("Transactions_"),true);
AssertVerify(FileName.endsWith("csv"), true);
ClickOnSave.exe:
Local $hIE = WinGetHandle("[Class:IEFrame]");
Local $hCtrl = ControlGetHandle($hIE, "", "[ClassNN:DirectUIHWND1]");
If WinExists($hIE,"") Then
WinActivate($hIE,"");
ControlSend($hIE ,"",$hCtrl,"{F6}");
Sleep(1500);
ControlSend($hIE ,"",$hCtrl,"{TAB}");
Sleep(1500);
ControlSend($hIE ,"",$hCtrl,"{ENTER}");
EndIf
Sleep(5000);
If WinExists($hIE,"") Then
WinActivate($hIE,"");
ControlSend($hIE ,"",$hCtrl,"{F6}");
Sleep(1500);
ControlSend($hIE ,"",$hCtrl,"{TAB}");
Sleep(1500);
ControlSend($hIE ,"",$hCtrl,"{TAB}");
Sleep(1500);
ControlSend($hIE ,"",$hCtrl,"{TAB}");
Sleep(1500);
ControlSend($hIE ,"",$hCtrl,"{ENTER}");
EndIf
Sleep(5000);
当我直接运行exe时,它会保存文件,但是当与脚本一起运行时,它不起作用。
调试时,控件不会在exportModal.CSVFormat.click();
之后出现
看起来该控件不会下载提示。。我尝试了swithTo activeElement和switchTo警报。在此步骤之后,exportModal.CSVFormat.click();它没有运行..没有对任何东西抛出任何异常。
任何建议都会有所帮助