Winium is used to automate windows applications. Katalon does not support windows automation. If any web application needs interaction with windows application then we can integrate Winium with Katalon studio.
Below are the steps to integrate Winium with Katalon Studio:
Step1: Download the Zip file “Winium.Desktop.Driver.zip” from https://github.com/2gis/Winium.Desktop/releases
Step2: Extract the downloaded Zip File
Step3: Run the file “Winium.Desktop.Driver.exe”
Step4: Download the jar file of “winium-webdriver” from below location
https://mvnrepository.com/artifact/com.github.2gis.winium/winium-webdriver/0.1.0-1
Step5: Download the jar file of “winium-elements-desktop” from below location
https://mvnrepository.com/artifact/com.github.2gis.winium/winium-elements-desktop/0.2.0-1
Step6: Launch Katalon Studio
Step7: Create New Project
Step8: Go to Project > Settings
Step9: Click on External Libraries > Click on Add
Step10: Add the downloaded jar files of “winium-webdriver” and “winium-elements-desktop”
Step11: Create the new test case in katalon studio. Paste the below code which opens the notepad and write some text and save the file.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
import static com.kms.katalon.core.checkpoint.CheckpointFactory.findCheckpoint import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase import static com.kms.katalon.core.testdata.TestDataFactory.findTestData import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject import com.kms.katalon.core.checkpoint.Checkpoint as Checkpoint import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile import com.kms.katalon.core.model.FailureHandling as FailureHandling import com.kms.katalon.core.testcase.TestCase as TestCase import com.kms.katalon.core.testdata.TestData as TestData import com.kms.katalon.core.testobject.TestObject as TestObject import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI import internal.GlobalVariable as GlobalVariable import org.openqa.selenium.By as By import org.openqa.selenium.WebElement as WebElement import org.openqa.selenium.winium.DesktopOptions as DesktopOptions import org.openqa.selenium.winium.WiniumDriver as WiniumDriver WiniumDriver driver = null DesktopOptions option = new DesktopOptions() String appPath = 'C:\\Windows\\System32\\notepad.exe' option.setApplicationPath(appPath) option.setDebugConnectToRunningApp(false) option.setLaunchDelay(2) driver = new WiniumDriver(new URL('http://localhost:9999'), option) Thread.sleep(1000) driver.findElement(By.name('Text Editor')).sendKeys("i am Automation Engineer") driver.findElement(By.name('File')).click() driver.findElement(By.name('Save As...')).click() driver.findElement(By.name('File name:')).sendKeys("D:\\NotePad\\file1.txt") driver.findElement(By.name('Save')).click() |