AutoIt Scripting Language and SDK - Part Three

Understanding – Scripting Style – X control

  • The ActiveX control or dll’s can provide a extended support to the other scripting languages with the features AutoIt provides.
  • An example Notepad automation VBScript is shown here. –
    • Example WSH Script (VBScript)
    • Require Variants to be declared before used
    • Option Explicit
    • ' Declare Variables & Objects
    • Dim oShell
    • Dim oAutoIt
    • ' Initialise Variables & Objects
    • Set oShell = WScript.CreateObject("WScript.Shell“)
    • Set oAutoIt = WScript.CreateObject("AutoItX3.Control")
    • ' Start of Script
    • WScript.Echo "This script will run notepad and type in some text"
    • oShell.Run "notepad.exe", 1, FALSE
    • ' Wait for the Notepad window to become active
    • oAutoIt.WinWaitActive "Untitled - Notepad", ""
    • ' Send some keystokes to notepad
    • oAutoIt.Send "Hello, this is line 1{ENTER}“
    • oAutoIt.Send "This is line 2{ENTER}This is line 3“
    • oAutoIt.Sleep 1000
    • oAutoIt.Send "!{F4}“
    • oAutoIt.WinWaitActive "Notepad", "save the changes?“
    • oAutoIt.Send "!n“
    • oAutoIt.WinWaitClose "Untitled - Notepad", "“
    • WScript.Quit
Understanding - Usability of the tool/Script
  • It’s a Development tool that can be used as a test automation tool.
  • It’s free.
  • Good support available in the forum and in the documentations.
  • System load is very low. Features like taking snapshot’s are easy.
  • Data driven testing is also possible with custom build code for database, excel or test files.
  • We can build GUI through script to maintain the Test.
  • The power of regular expression can enhance the script capacity.
  • Web based testing also possible but need some time and work.It is recommended to use selenium and AutoIt as a combination to create a complete test infrastructure for web and windows.
Some points to remember -
  • Scripting language with BASIC-like structure for Windows Desktop Environment.
  • Add-on libraries and modules for specific applications.
  • On-line support forum for AutoIt users and developers.
  • Supports TCP and UDP protocols.
  • Supports COM (component object modeling) objects.
  • Call functions in Win32 DLLs.
  • Run console applications and access the standard streams.
  • Include files in the compiled file to be extracted when run.
  • GUI interfaces, create message and input boxes.
  • Play sounds, pause, resume, stop, seek, get the current position of the sound and get the length of the sound.
  • Simulate mouse movements.
  • Manipulate windows and processes.
  • Automate sending user input and keystrokes to applications, as well as to individual controls within an application.
  • Scripts can be compiled into standalone executables.
  • Unicode support from version 3.2.4.0.
  • 64 bit code support from version 3.2.10.0.
  • Supports regular expressions.
  • Works with Windows Vista's User Account Control.
Comparison with other automation tools –



Comments

Popular posts from this blog

Software Testing @ Microsoft

Trim / Remove spaces in Xpath?