2016-07-26 59 views
3

我使用AutoIt工具与硒。我正在做的是当我的应用程序中出现“另存为”对话框时,我得到一些默认值,该文件存储在我的系统中。我正在尝试将其重命名为'New',正如我在下面的代码中所述。但是我得到的问题是,文件名在对话框中被成功更改为'新',但是当我点击'保存'时,它将被保存为默认文件名。在保存为对话框中使用硒自动重命名文件名

$windowHandle = WinGetHandle("Enter name of file to save to…") 
WinActivate($windowHandle) 
ControlSetText("Enter name of file to save to…", "", "Edit1", "New") 
ControlClick("Enter name of file to save to…", "", "Button1") 
+0

谁能帮助我解决这个问题,谢谢! – testing

+0

尝试点击ControlSetText后的Edit1。 – Milos

+0

@Milos,我尝试了你的建议,它没有奏效 – testing

回答

0

它曾与此:

$windowHandle = WinGetHandle("Enter name of file to save to…") 
WinActivate($windowHandle) 

ControlSetText("Enter name of file to save to…", "", "Edit1", "2131221") 
ControlClick("Enter name of file to save to…", "", "Edit1") 
ControlSetText("Enter name of file to save to…", "", "Edit1", "5666") 
ControlClick("Enter name of file to save to…", "", "Edit1") 
ControlSetText("Enter name of file to save to…", "", "Edit1", Send(" {BACKSPACE}")) 
ControlSetText("Enter name of file to save to…", "", "Edit1", "New") 
ControlClick("Enter name of file to save to…", "", "Button1") 
相关问题