엄지월드

[Katalon] WebUI.uploadFile() 명령어 본문

QA/Katalon UI 명령어

[Katalon] WebUI.uploadFile() 명령어

킨글 2020. 5. 27. 19:57

Form에서 파일을 첨부하여 전송할 때 사용합니다.

저희 시스템의 경우에서는 사진을 시스템에 업로드할 때 사용하고 있습니다.

많이 사용되겠죠? 

 

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('https://ps.uci.edu/~franklin/doc/file_upload.html')

'test.txt 파일을 첨부'
WebUI.uploadFile(findTestObject('Object Repository/file_upload'), 'D:\\test.txt')

'파일 전송'
WebUI.click(findTestObject('Object Repository/button_submit'))

 

 

도움이 되셨다면 광고 한번씩 클릭 부탁드립니다 😁

Comments