Advertisement
oimtrust

upload_file_with_katalon

Jul 26th, 2018
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.21 KB | None | 0 0
  1. WebUI.openBrowser('')
  2.  
  3. WebUI.maximizeWindow()
  4.  
  5. WebUI.navigateToUrl('http://***.dot.co.id/eservice/login')
  6.  
  7. WebUI.setText(findTestObject('PageLogin/Page_Log In  e-service - Pupuk Kalt/input_login'), 'admin')
  8.  
  9. WebUI.setText(findTestObject('PageLogin/Page_Log In  e-service - Pupuk Kalt/input_password'), 'admin123')
  10.  
  11. WebUI.click(findTestObject('PageLogin/Page_Log In  e-service - Pupuk Kalt/button_LOG IN'))
  12.  
  13. WebUI.delay(3)
  14.  
  15. WebUI.navigateToUrl('http://***.dot.co.id/eservice/globalconfiguration')
  16.  
  17. //Passing the path of the file
  18. WebUI.uploadFile(findTestObject('Configuration/GlobalConfig/Page_e-service  Global Configuratio/upload_file'), '~/Download/test/logo.png')
  19.  
  20. //Capturing the file name after upload and storing it in a variable
  21. FilePath = WebUI.getAttribute(findTestObject('Configuration/GlobalConfig/Page_e-service  Global Configuratio/upload_file'), '~/Download/test/logo.png')
  22.  
  23.  
  24. //Verifying the Actual path and Expected path of file
  25. WebUI.verifyMatch(FilePath, '~/Download/test/logo.png', false)
  26.  
  27. WebUI.click(findTestObject('PageLogin/Page_e-service  Dashboard/i_account_circle'))
  28.  
  29. WebUI.click(findTestObject('PageLogin/Page_e-service  Dashboard/a_Logout'))
  30.  
  31. WebUI.delay(3)
  32.  
  33. WebUI.closeBrowser()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement