如何在Katalon中上传文件

时间:2019-06-12 21:43:04

标签: katalon-studio uploading

因此,我希望自动测试用例可以找到文件并上传。这是我在研究中发现的,但是没有运气。

WebUI.openBrowser('C:\\\\Users\\\\User\\\\Desktop\\\\Katalon Articles\\\\File Upload\\\\UploadFile.html')

'Maximize the window\r\n'
WebUI.maximizeWindow()

'Uploading the File using Send Keys method by passing the File path'
WebUI.sendKeys(findTestObject('Upload File'), 'C:\\\\Users\\\\Public\\\\Pictures\\\\Sample Pictures\\\\Desert.jpg')

'Capturing the file name after upload and storing it in a variable'
FilePath = WebUI.getAttribute(findTestObject('Upload File'), 'value')

'Verifying the Actual path and Expected path of file'
WebUI.verifyMatch(FilePath, 'C:\\fakepath\\Desert.jpg', false)

0 个答案:

没有答案