How to use Upload File keyword?

Hi,

Here is my script,

<code>

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.checkpoint.CheckpointFactory as CheckpointFactory
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as MobileBuiltInKeywords
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.testcase.TestCaseFactory as TestCaseFactory
import com.kms.katalon.core.testdata.TestData as TestData
import com.kms.katalon.core.testdata.TestDataFactory as TestDataFactory
import com.kms.katalon.core.testobject.ObjectRepository as ObjectRepository
import com.kms.katalon.core.testobject.TestObject as TestObject
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WSBuiltInKeywords
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUiBuiltInKeywords
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import internal.GlobalVariable as GlobalVariable

WebUI.openBrowser('')

WebUI.navigateToUrl('http://www.cloudyexcel.com/compare-excel/\')

WebUI.click(findTestObject('Excel_Upload/Page_Compare two Excel Sheets Onlin/div_Upload File 1'))

WebUI.uploadFile(findTestObject('Excel_Upload/Page_Compare two Excel Sheets Onlin/input_file_upload1'), 'D:\\\\Toolwire Logins Dojo.xlsx')

WebUI.click(findTestObject('Excel_Upload/Page_Compare two Excel Sheets Onlin/div_Upload File 2'))

WebUI.uploadFile(findTestObject('Excel_Upload/Page_Compare two Excel Sheets Onlin/input_file_upload2'), 'D:\\\\tempo mail.xlsx')

WebUI.click(findTestObject('Excel_Upload/Page_Compare two Excel Sheets Onlin/input_compare'))

WebUI.closeBrowser()

</code>

Here after clicking uploadfile1 button, it will open dailog box to fetch file from explorer.

i cannot directly upload file, because once i click uploadfile1 button, second uploadfile2 button is enabled.

 

For me the above script is throwing error like,

Unable to click on object 'Object Repository/Excel_Upload/Page_Compare two Excel Sheets Onlin/input_compare' (Root cause: org.openqa.selenium.ElementNotVisibleException: element not visible

Help me on this.

 

Thanks

Hi there,

Please use Wait For Element Visible keyword before using click on input_compare.

Thanks.