Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Opt("MouseCoordMode", 0)
- Opt("SendKeyDelay",50)
- $dirPath = "C:\tempdir\"
- DirRemove($dirPath,1)
- DirCreate($dirPath)
- Func SaveFile(ByRef $fileName, ByRef $testResult)
- Send("^s")
- ;WinWaitActive("Zapisywanie jako")
- Send($dirPath & $fileName & "{ENTER}")
- Sleep(1000)
- ;$result = WinExists("Save As")
- $result = FileExists($dirPath & $fileName & ".txt")
- If $result <> 0 Then
- $testResult = "Udany zapis pliku"
- Else
- $testResult = "Niedany zapis pliku"
- Send("{ENTER}{ESC}")
- EndIf
- EndFunc
- $greeting = MsgBox(4, "Notatnik - test automatyczny nr 2", "Skrypt uruchamia aplikację windowsową Notatnik po czym dokonuje próby zapisu pliku pod rónymi nazwami. Kontynuować?")
- If $greeting = 7 Then
- MsgBox(0,"Notatnik - test automatyczny nr 2","Zakończenie pracy")
- Exit
- EndIf
- Send("#r")
- ;WinWaitActive("Uruchom")
- Send("notepad{ENTER}")
- Dim $fileNames[2] = ["{}:|<>?","qwertyuiopasdfghjklzxcvbnm"]
- Dim $saveResults[2]
- For $i=0 to 1 Step +1
- SaveFile($fileNames[$i], $saveResults[$i])
- Next
- Dim $testResult = ""
- For $i=0 to 1 Step +1
- $testResult = $testResult & $fileNames[$i] & ": " & $saveResults[$i] & @LF
- Next
- MsgBox(0, "Notatnik - test automatyczny nr 2", $testResult)
- Sleep(500)
- Send("!{F4}")
- DirRemove($dirPath,1)
Add Comment
Please, Sign In to add comment