Features

AutoIT

AutoIT is a scripting language, with syntax similar to BASIC, used to automate programs on Windows.
TestingBot has created a custom command, tb:autoit, which you can use during your Selenium WebDriver tests to automate parts of Windows and Windows GUI programs.

AutoIT is compatible with all versions of Windows and provides many automation features, including:

  • Manipulate windows and processes
  • Interact with standard Windows components
  • Simulate keystrokes and mouse movements

In the example below, we will show you a basic example of what an autoIT script looks like.

Copy code
MsgBox(0, "My Title", "Hello from AutoIT")

Running AutoIT during a Selenium WebDriver test

TestingBot has created a custom command, tb:autoit. You can use this command to send AutoIT scripts during your WebDriver test.

You could for example use AutoIT scripts to automate a native dialog, for example a file upload dialog, opened by the browser during your WebDriver test.

Copy code
payload = <<-EOF
  MsgBox(0, "My Title", "Hello from AutoIT")
EOF
driver.execute_script("tb:autoit", payload)
Copy code
String autoItContent = "MsgBox(0, \"My Title\", \"Hello from AutoIT\")";
((JavascriptExecutor) driver).executeScript("tb:autoit", autoItContent);
Copy code
$autoItScript = 'MsgBox(0, "My Title", "Hello from AutoIT")';
$driver->executeScript("tb:autoit", $autoItScript);
Copy code
autoItContent = "MsgBox(0, \"My Title\", \"Hello from AutoIT\")"
driver.execute_script("tb:autoit", autoItContent)
Copy code
browser.execute('tb:autoit', 'MsgBox(0, "My Title", "Hello from AutoIT")')
Copy code
((IJavaScriptExecutor)driver).ExecuteScript("tb:autoit", "MsgBox(0, \"My Title\", \"Hello from AutoIT\")");