Guest User

Untitled

a guest
Jun 25th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. Opt("MouseCoordMode", 0)
  2. Opt("SendKeyDelay",50)
  3.  
  4. $dirPath = "C:\tempdir\"
  5. DirRemove($dirPath,1)
  6. DirCreate($dirPath)
  7.  
  8. Func SaveFile(ByRef $fileName, ByRef $testResult)
  9. Send("^s")
  10. ;WinWaitActive("Zapisywanie jako")
  11. Send($dirPath & $fileName & "{ENTER}")
  12. Sleep(1000)
  13.  
  14. ;$result = WinExists("Save As")
  15. $result = FileExists($dirPath & $fileName & ".txt")
  16.  
  17. If $result <> 0 Then
  18. $testResult = "Udany zapis pliku"
  19. Else
  20. $testResult = "Niedany zapis pliku"
  21. Send("{ENTER}{ESC}")
  22. EndIf
  23. EndFunc
  24.  
  25. $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ć?")
  26.  
  27. If $greeting = 7 Then
  28. MsgBox(0,"Notatnik - test automatyczny nr 2","Zakończenie pracy")
  29. Exit
  30. EndIf
  31.  
  32. Send("#r")
  33. ;WinWaitActive("Uruchom")
  34.  
  35. Send("notepad{ENTER}")
  36. Dim $fileNames[2] = ["{}:|<>?","qwertyuiopasdfghjklzxcvbnm"]
  37. Dim $saveResults[2]
  38.  
  39. For $i=0 to 1 Step +1
  40. SaveFile($fileNames[$i], $saveResults[$i])
  41. Next
  42.  
  43.  
  44. Dim $testResult = ""
  45. For $i=0 to 1 Step +1
  46. $testResult = $testResult & $fileNames[$i] & ": " & $saveResults[$i] & @LF
  47. Next
  48.  
  49. MsgBox(0, "Notatnik - test automatyczny nr 2", $testResult)
  50.  
  51. Sleep(500)
  52. Send("!{F4}")
  53. DirRemove($dirPath,1)
Add Comment
Please, Sign In to add comment