Hi,
I have written a single script(to work on different OS/different language) to open run Notepad ,send some keys and close and save to some location.
Below is the code:-
Run("notepad.exe")
$handle = WinWaitActive("[CLASS:Notepad]","")
WinSetState("[CLASS:Notepad]","",@SW_MAXIMIZE)
Send("Hello there")
WinClose($handle)
$handle = WinGetHandle("[ACTIVE]")
ControlClick($handle,"","[CLASS:Button; INSTANCE:1]")
$handle = WinWaitActive("[CLASS:#32770]","")
$hw = WinGetHandle("[ACTIVE]")
ControlSetText($hw, "", "ComboBox1", "c:\actual")
ControlSend($hw,"","ComboBox3","UTF-8")
ControlClick($hw,"","[CLASS:Button; INSTANCE:1]")
When i run the above script 2 out of 5 times it fails. I don't know whats wrong with this code.Most of the time it stops at SaveAs window where i am sending path to save the notepad.
Can you please review the code and help me .
Thanks!!