Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Reference Material for AutoIT

Automating window Controls with Selenium:

· Handling Window Authentication Pop Up


http://Username:Password@SiteURL
· Driver.get();
· Handling File Upload from Windows using AutoIT

What is AutoIT
Install AutoIT
AutoIT Scripting
Integrating AutoIT with Selenium

//Shift focus to the file upload windows


//set text/path into file name edit box
//click open to upload file

Au3info- record window component objects


Build Script -scite.exe
Save it- .au3 extenstion
Convert file into .exe by compiling .au3 file
Call .exe file with Runtime class in java into your selenium tests

ControlFocus("Open","","Edit1")
ControlSetText("Open","","Edit1","C:\Users\rahul\Documents\check\visit.pdf")
ControlClick("Open","","Button1")
Runtime.getruntime.exe(“exe file path”)
Runtime.getruntime.exe(“.exe file path”)

Extent report:

Add extent report repo in pom.xml

Create object extentsparkreporter class- Explicitly provide a path to store extent report

Perform configuration on reports using extentsparkreporter

Extentspark reporter is a helper class which is helping to create some configuration and that will
finally report to main class which is extentsreports

Create a extent reports object and attach extentspark report object.

Extent.flush ()- is used to generate report. Which we need to write add the end of test
Program:

public class Firsttestcase{

ExtentReports extent;

@BeforeTest

public void config() {

String Path = System.getProperty("User.dir")+"\\reports\\index.html";

ExtentSparkReporter es= new ExtentSparkReporter(Path);

es.config().setReportName("WebAutomation Result");

es.config().setDocumentTitle("test result");

extent= new ExtentReports();

extent.attachReporter(es);

extent.setSystemInfo("Tester", "Divya");

@Test

public void a() {

extent.createTest("reports");

//System.setProperty("webdriver.chrome.driver","C:\\Users\\Divya\\eclipse-
workspace\\selenium\\src\\test\\resources\\config.properties");

//WebDriver driver= new ChromeDriver();

driver.get("https://rahulshettyacademy.com/AutomationPractice/");

extent.flush();

You might also like