Can't Upload file. Katalon ver 5.4.2 (Mac)


#1

Can not upload file.
Can’t detect input_file object.
/Users/sayan/Downloads/7_1_1_2\ \(1\).csv ~ This kind of extension is not working.

Unable to upload file ‘/Users/sayan/Downloads/7_1_1_2\ \(1\).csv’ to object (Root cause: java.lang.IllegalArgumentException: Object is null)

(In windows system its working properly.)


#2

I suppose
\ \(1\)
this portion might be platform specific. I mean, it is ok on windows but not on mac.

Could you please try on Mac in Terminal.app,

> ls -la /Users/sayan/Downloads/7_1_1_2*

and see how the file name is printed.


#3

Still having the same problem. ( tried with a different file though. )
Error message:

Unable to upload file ‘/Users/sayan/Downloads/4_2_5.csv’ to object (Root cause: java.lang.IllegalArgumentException: Object is null)

Tried this though.

ls -la /Users/sayan/Downloads/4_2_5*

Screen Shot 2018-07-13 at 11.16.47 AM.png


#4

The message is saying ‘Object is null’. This clearly implies that the CSV file is not the cause of your problem. Rather your TestObject named ‘Criteria 6.0/6.1.1/Page_Kramah Software India Private/Page_Kramah Software India Private/input_file’ would be wrong. You should verify the definition of your Test Object.


#5

Thanks. Now its working.


#6

Please look at my script and help me with it…
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.Keys as Keys

WebUI.openBrowser(’’)

WebUI.navigateToUrl(‘https://www.convert-jpg-to-pdf.net/’)

WebUI.click(findTestObject(‘Object Repository/Page_Convert JPG to PDF for free - JPG to PDF online converter/input_JPG to convert to PDF_select_file_button’))

WebUI.delay(2)

WebUI.waitForElementAttributeValue(findTestObject(‘Page_Convert JPG to PDF for free - JPG to PDF online converter/input_JPG to convert to PDF_select_file_button’),

‘class’, ‘btn btn-primary’, 5)

WebUI.delay(2)

WebUI.uploadFile(findTestObject(‘Page_Convert JPG to PDF for free - JPG to PDF online converter/input_JPG to convert to PDF_select_file_button’),

‘/Users/swapnaputta/Downloads/seasonal-wallpaper-1.jpg’)

FilePath = WebUI.getAttribute(findTestObject(‘Page_Convert JPG to PDF for free - JPG to PDF online converter/input_JPG to convert to PDF_select_file_button’),

‘/Users/swapnaputta/Downloads/seasonal-wallpaper-1.jpg’)

WebUI.verifyMatch(FilePath, ‘/Users/swapnaputta/Downloads/seasonal-wallpaper-1.jpg’, false)

WebUI.delay(3)

WebUI.closeBrowser()