Katalon Studio Native Popup Window and Upload File

Hello Again @rushantha

1.Step : Please refresh the keyword folder.

2.Step : Open your Test Case page and add a custom keyword from the ADD field.

1 Like

It’s missing @Keyword before def uploadFile(TestObject tp, String filePath)

1 Like

Hello @HeleneB

In the custom keyword definition, the relevant phrase exists, has it added? couldn’t tell where missing.

1 Like

Thanks @emine… you did great help for me… thanks a lot… now it is successfully happening…:grinning::grinning::grinning::+1::+1:


@HeleneB… Thanks .i added it and now it is working prefectly.:grinning::+1:

1 Like

@rushantha Hello Again
You’re welcome. If there’s something I can help you with, you can send it back.

1 Like


1 Like

I am also trying this solution , but seems it is not working for me aswell,

GenericActions.uploadFile(findTestObject(‘Object Repository/Banner/applicationNavigator/SZADOCS/Page_Application Navigator/upload_button’),‘C:\Users\shilpi\Upload test.docx’)

upload class–
def static uploadFile(TestObject to, String filePath) {
StringSelection ss = new StringSelection(filePath)
Toolkit.getDefaultToolkit().getSystemClipboard().setContents(ss, null)
Robot robot = new Robot()

1 Like

It is working for me… Sometimes it is getting stuck…but most of the time it is working

1 Like

Do we need to dd any plugin for this? bcz I hvnt.

1 Like

I have element which get active on mouse hover.
First I have to hover mouse on element then upload files by click on that.
Three Actions at a time …please guide…
Mouse Hover, click and file upload

1 Like

Can you please read and try with methods in this topic :slightly_smiling_face:Katalon Studio Native Popup Window and Upload File

1 Like

Ya I tried, its not working that may be because here I need to perform mouse hover first

1 Like

fixed, its working now…Thanks guys:)


“Unable to upload file”

my custom keyword

package upload

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.annotation.Keyword

import com.kms.katalon.core.checkpoint.Checkpoint

import com.kms.katalon.core.checkpoint.CheckpointFactory

import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords

import com.kms.katalon.core.model.FailureHandling

import com.kms.katalon.core.testcase.TestCase

import com.kms.katalon.core.testcase.TestCaseFactory

import com.kms.katalon.core.testdata.TestData

import com.kms.katalon.core.testdata.TestDataFactory

import com.kms.katalon.core.testobject.ObjectRepository

import com.kms.katalon.core.testobject.TestObject

import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords

import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords

import internal.GlobalVariable

import MobileBuiltInKeywords as Mobile

import WSBuiltInKeywords as WS

import WebUiBuiltInKeywords as WebUI

import org.openqa.selenium.WebElement

import org.openqa.selenium.WebDriver

import org.openqa.selenium.By

import com.kms.katalon.core.mobile.keyword.internal.MobileDriverFactory

import com.kms.katalon.core.webui.driver.DriverFactory

import com.kms.katalon.core.testobject.RequestObject

import com.kms.katalon.core.testobject.ResponseObject

import com.kms.katalon.core.testobject.ConditionType

import com.kms.katalon.core.testobject.TestObjectProperty

import com.kms.katalon.core.mobile.helper.MobileElementCommonHelper

import com.kms.katalon.core.util.KeywordUtil

import com.kms.katalon.core.webui.exception.WebElementNotFoundException

import java.awt.Robot

import java.awt.Toolkit

import java.awt.datatransfer.StringSelection

import java.awt.event.KeyEvent

class uploadclass {


  • Refresh browser



def uploadFile (TestObject to, String filePath) {


StringSelection ss = new StringSelection(filePath);

Toolkit.getDefaultToolkit().getSystemClipboard().setContents(ss, null);

Robot robot = new Robot();











the script:

WebUI.callTestCase(findTestCase(‘Self Sender/01. Login’), [:], FailureHandling.STOP_ON_FAILURE)

WebUI.click(findTestObject(‘nuovo mezzo/Page_C Scrivania/span_Mezzi’))

WebUI.click(findTestObject(‘nuovo mezzo/Page_C Mezzi/button_Nuovo mezzo’))

WebUI.setText(findTestObject(‘nuovo mezzo/Page_C Nuovo mezzo/input_Targa_vehicle_plate’), ‘2aaasdfgh’)

WebUI.click(findTestObject(‘nuovo mezzo/Page_C Nuovo mezzo/button_Anno del mezzo’))

WebUI.setText(findTestObject(‘nuovo mezzo/Page_C Nuovo mezzo/anno_mezzo’), ‘2019’)

WebUI.click(findTestObject(‘nuovo mezzo/Page_C Nuovo mezzo/seleziona_data’))

WebUI.click(findTestObject(‘nuovo mezzo/Page_C Nuovo mezzo/button_Classe mezzo’))

WebUI.click(findTestObject(‘nuovo mezzo/Page_C Nuovo mezzo/a_Autocarro’))

WebUI.click(findTestObject(‘nuovo mezzo/Page_C Nuovo mezzo/button_Configurazione mezzo’))

WebUI.click(findTestObject(‘nuovo mezzo/Page_C Nuovo mezzo/a_Cabinato’))

WebUI.click(findTestObject(‘nuovo mezzo/Page_C Nuovo mezzo/button_Salva’))

WebUI.click(findTestObject(‘edit mezzo/Page_C Mezzi/button_ok’))

WebUI.setText(findTestObject(‘elimna mezzo/Page_C Mezzi/input_Capacit di carico_form-control’), ‘2’)

WebUI.click(findTestObject(‘edit mezzo/Page_C Mezzi/td_2aaasdfgh’))

WebUI.click(findTestObject(‘edit mezzo/Paage_C Dettaglio mezzo/button_Nessun driver predefinito’))

WebUI.click(findTestObject(‘edit mezzo/Page_C Dettaglio mezzo/a_demo 102 autista’))

WebUI.click(findTestObject(‘edit mezzo/Page_C Dettaglio mezzo/input_Foto mezzo_vehicle_cover’))

CustomKeywords.‘upload.uploadclass.uploadFile’(findTestObject(‘Datalocker/Add-Dataset-Button’), ‘/Users/…/img.jpg’)


1 Like

Hi, so i used the keyword and it navigates to the path but does not find my file any assistance please

1 Like

Ok cool i managed to sort my issue out, added in a delay after the custom keyword , maybe it couldnt find the file that quick.

1 Like

This post really helpfull. Thank you soo much


I’m new to these languages and this application, so forgive me if some of the below is nonsense/unnecessary.

For others who may still be having an issue, I believe my issue was that I had previously tried to implement the plugin from the Katalon Store and it was somehow conflicting with my new keyword (maybe I was using the same keyword). This is how I followed this tutorial and resolved the error I don’t see mentioned above:

  • go to Katalon Store and uninstall “Upload” plugin.
  • remove any upload step from script or manual execution (you replace it at the end of these steps)
  • remove any custom package and keyword you attempted to create from Keywords in project explorer
  • maybe cleanup project
  • restart Katalon Studio
  • recreate new package in keywords
  • recreate new keyword in that package
  • refresh Keywords and Project (not sure if they are two different functions)
  • add custom keyword back to test case (this time it should look closer to the tutuorial)

Thanks @emine for the guide. I would like to see some more images though, especially showing what manual and script execution window looks like after it’s configured correctly and without tooltips.

1 Like

I am able to Open File explorer and select the desired file with what you provided. However, windows explorer stays open. How can I get it to click the open button?

1 Like