05 AutoIT
05 AutoIT
05 AutoIT
AutoIT
Selenium designed to automate web-based applications on different browsers but it
is not able to handle window GUI popups in application.
ex: upload file, print popup...etc.
AutoIT v3 is also freeware. It is used to perform mouse movement, keystrokes and
window control manipulation to automate a task which is not possible by selenium
webdriver.
upload/download a file in selenium webdriver using AutoIT we need three tools in
order to this.
1. Selenium Webdriver
2. AutoIT editor
3. Element identifier
1. Selenium WebDriver
which is already we converd in previous concepts
2. AutoIT Editor:
It is a freeware BASIC-like scripting language designed for automating the
Windows GUI and general scripting.
Download and install AutoIT:
Download and install AutoIT:
Enter "https://www.autoitscript.com/site/autoit/downloads"
69
Mind Q Selenium
Step 3: Compile the .au3 script and convert it into .exe file
Step 4: Call the .exe file in to the Selenium test case
Step 1: Identify the Window Controls:
use "AutoIt Window Info" to find object information
Now drag the ‘Finder Tool‘ box to the object in which you are interested
Or
WinWaitActive ("File Upload")
ControlFocus("[CLASS:#32770]", "", "Edit1")
70
Mind Q Selenium
Send ("E:\Profile_SankaR.docx")
Send ("{Enter}")
or
WinWaitActive ("File Upload")
Send ("E:\Profile_SankaR.docx")
Send ("{Enter}")
-->Save the script (it will save as filename.au3)
Step 3: Compile the .au3 script and convert it into .exe file
go to the folder containing the file-->right click on the file-->compile it [Will create
filename.exe]
driver.findElement(By.linkText("START NOW")).click();
driver.findElement(By.xpath("//*[text()='Add Files']")).click();
72