Automate Windows Desktop Apps

Step 1:
Download the below jars

Along with these two jars you need to have selenium latest jar as well. You can get the latest selenium jar from the below path.

Step 2:
Download Winium.Desktop.Driver.exe file from (Latest). Extract the zip file

Step 3:
Run the Winium.Desktop.Driver.exe file (by double clicking the Winium. Desktop.Driver.exe file). So that a Winium desktop server will be started and running at port 9999.

Step 4:
Create a sample Java project and add the downloaded jars into the class path of the project and also TestNG Library. Now create a class and use the below code.

package Calculator;package Calculator;
import org.openqa.selenium.By;import org.openqa.selenium.winium.DesktopOptions;import org.openqa.selenium.winium.WiniumDriver;

public class Notepad {

 public static void main(String[] args) throws Exception { 

 DesktopOptions option = new DesktopOptions();


 try {

WiniumDriver driver = new WiniumDriver(new URL("http://localhost:9999"), option); 

Thread.sleep(1000); driver.findElement("Text Editor")).sendKeys("This is sample test");


driver.findElementByName("Don't Save").click(); 

catch (Exception e)
{ System.out.println(e.getMessage()); 

Step 5:
Run this code . It opens the notepad and enters the text on the note pad and also tries to close it.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s