---
title: Using AutoIT with Selenium WebDriver
description: Using AutoIT automation in combination with Selenium Webdriver to automate
  on Windows.
source_url:
  html: https://testingbot.com/support/web-automate/selenium/auto-it
  md: https://testingbot.com/support/web-automate/selenium/auto-it.md
---

# 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.

```bash
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.

[Java](https://testingbot.com#) [Python](https://testingbot.com#) [NodeJS](https://testingbot.com#) [Ruby](https://testingbot.com#) [PHP](https://testingbot.com#) [C#](https://testingbot.com#)

```java
String autoItContent = "MsgBox(0, \"My Title\", \"Hello from AutoIT\")";
((JavascriptExecutor) driver).executeScript("tb:autoit", autoItContent);
```

```python
autoItContent = "MsgBox(0, \"My Title\", \"Hello from AutoIT\")"
driver.execute_script("tb:autoit", autoItContent)
```

```javascript
const autoItContent = 'MsgBox(0, "My Title", "Hello from AutoIT")';
await driver.executeScript("tb:autoit", autoItContent);
```

```ruby
payload = <<-EOF
  MsgBox(0, "My Title", "Hello from AutoIT")
EOF
driver.execute_script("tb:autoit", payload)
```

```php
$autoItScript = 'MsgBox(0, "My Title", "Hello from AutoIT")';
$driver->executeScript("tb:autoit", $autoItScript);
```

```csharp
((IJavaScriptExecutor)driver).ExecuteScript("tb:autoit", "MsgBox(0, \"My Title\", \"Hello from AutoIT\")");
```

### Specifying a URL to AutoIT script

Instead of specifying the AutoIT commands in the `tb:autoit` command, you can also specify a URL to a file that contains all the AutoIT commands:

[Java](https://testingbot.com#) [Python](https://testingbot.com#) [NodeJS](https://testingbot.com#) [Ruby](https://testingbot.com#) [PHP](https://testingbot.com#) [C#](https://testingbot.com#)

```java
((JavascriptExecutor) driver).executeScript("tb:autoit", "https://testingbot.com/autoit/example.au3");
```

```python
driver.execute_script("tb:autoit", "https://testingbot.com/autoit/example.au3")
```

```javascript
await driver.executeScript("tb:autoit", "https://testingbot.com/autoit/example.au3");
```

```ruby
driver.execute_script("tb:autoit", "https://testingbot.com/autoit/example.au3")
```

```php
$driver->executeScript("tb:autoit", "https://testingbot.com/autoit/example.au3");
```

```csharp
((IJavaScriptExecutor)driver).ExecuteScript("tb:autoit", "https://testingbot.com/autoit/example.au3");
```

### Looking for more help?

Have questions or need more information? Reach out via email or Slack.

[Email us](https://testingbot.com/contact/new) [Join our Slack](https://join.slack.com/t/testingb0t/shared_invite/zt-3bcw9xch-jk19~6XPs_xBrsAgAedkCw)
