Stuck at file uploading step please help!


#1

Hi all ,Please help I am exploring Katalon Studio tool for web automation I dont have selenium Knowledge. I have mentioned the steps in following

Need to automate following and can be execute on IE browser only :frowning:

I am able to automate only 2 steps and stuck on uploading document

  1. User Click on Content Management system link and link opens

  2. User uploading Jpg document - User clicks on Upload button and document upload window opens

  3. User clicks on browse button on document upload window and uploads the JPG document from D drive

  4. Document is ready to Upload and user clicks on Upload button in document upload window

  5. Document is successfully Uploaded

UI step screenshot attached

1) User Click on link and link opens.JPG

2) User click on Upload button and document upload window opens.JPG

5) Document is Uploaded and Document Upload window is gone.JPG

4) Document is ready to Upload and user clicks on Upload button in document upload window.JPG

3) User clicks on browse button on document upload window and uploads the JPG document from D drive.JPG


#2

Hi there,

Can you help to post me your script and also error details of this issue?

Regards


#3

Thanks for the quick reply


#4

here are the details

  • 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
    import org.openqa.selenium.Keys as Keys

    WebUI.openBrowser(’’)

    WebUI.navigateToUrl('https://ecms.doc.govt.nz/wcc/faces/wccmain?_adf.no-new-window-redirect=true/’)

    //WebUI.setText(findTestObject(‘Page_docCM/input_sbitSearchText’), ‘API test’)
    WebUI.click(findTestObject(‘Page_docCM/upload button’))

    WebUI.waitForElementPresent(findTestObject(‘Page_docCM/div_checkInUploadPopuppopup-co’), 10)

    //WebUI.click(findTestObject(‘Page_docCM/input’), FailureHandling.STOP_ON_FAILURE)
    WebUI.uploadFile(findTestObject(‘Page_docCM/upload button’), ‘D:\\Users\\mjoshi\\Capture1.JPG’)

    WebUI.waitForElementPresent(findTestObject(‘Page_docCM/span_Upload’), 5)

    WebUI.waitForElementPresent(findTestObject(‘Page_docCM/div_checkInUploadPopuppopup-co’), 5)

    WebUI.click(findTestObject(‘Page_docCM/span_Upload’))

  • Forward attachment

  • Click or press enter to display issue upload.jpg in the image previewissue uploadjpg

  • Forward attachment

    Click or press enter to display Issue upload 2.jpg in the image previewIssue upload 2jpg

  • operation stops here :frowning:

  • I tried all diffrent object for upload file

  • and getting same error at upload step

  • (Root cause: org.openqa.selenium.UnhandledAlertException: Modal dialog present:
    Build info: version: ‘3.7.1’, revision: ‘8a0099a’, time: ‘2017-11-06T21:07:36.161Z’
    System info: host: ‘WIN-7ACV5NFP3RV’, ip: 'https://www.linkedin.com/redir/invalid-link-page?url=10%2e202%2e8%2e11’, os.name: ‘Windows 7’, os.arch: ‘x86’, os.version: ‘6.1’, java.version: ‘1.8.0_102’
    Driver info: com.kms.katalon.selenium.driver.CInternetExplorerDriver
    Capabilities {acceptInsecureCerts: false, browserName: internet explorer, browserVersion: 11, javascriptEnabled: true, pageLoadStrategy: normal, platform: WINDOWS, platformName: WINDOWS, se:ieOptions: {browserAttachTimeout: 0, elementScrollBehavior: 0, enablePersistentHover: true, ie.browserCommandLineSwitches: , ie.ensureCleanSession: false, ie.fileUploadDialogTimeout: 3000, ie.forceCreateProcessApi: false, ignoreProtectedModeSettings: false, ignoreZoomSetting: false, initialBrowserUrl: http://localhost:16608/, nativeEvents: true, requireWindowFocus: false}, setWindowRect: true}
    Session ID: ecf76fc3-a109-4862-a48b-de0b4cc1152f
    *** Element info: {Using=xpath, value=//div[@id = ‘checkInUploadPopup::popup-container’]})


Upload File with Choose File and Upload buttons on the UI
#5

I am requesting for help please its very urgent


#6

I introduce katalon studio at work and this can be a stopper please help!


#7

Hi Mahesh,

Please be patience. I’m looking at your issue and determine which can be the root cause or any other issues related to it. Will reply to you asap.

Regards


#8

By the way, that error message is generated from ‘Upload File’ step? So likely the upload window is opened already in this case and it can’t click on upload button?


#9

And also, the error message from your current execution related to there is a dialog raised during your execution and you need to interact with it, either by using ‘Dismiss Alert’ or ‘Accept Alert’ keyword.
Is there any alert popup from your site for the steps before ‘Upload File’ step?


#10

Thanks a lot for the reply . I am not sure its alert popup I have screenshot


#11

When I will go to work tom I will send you details. That window call pop up container…
I will send you in detail tomm.
When I click on upload button small pop upopens if you see 1st 5 screenshots youcan u derstand.thanks


#12

Please see this image to upload document you have to click on browse buttton on that window then it goes to the path and upload the file and click on upload again I am happyto se d you video recording thanks


#13

Here is the image

Issue upload 2.jpg


#14

Please help me I am stuck here


#15

Ah I see. These lines:

WebUI.click(findTestObject('Page_docCM/upload button')) WebUI.waitForElementPresent(findTestObject('Page_docCM/div_checkInUploadPopuppopup-co'), 10) //WebUI.click(findTestObject('Page_docCM/input'), FailureHandling.STOP_ON_FAILURE) 
WebUI.uploadFile(findTestObject('Page_docCM/upload button'), 'D:\\Users\\mjoshi\\Capture1.JPG') 

It should be reduced to call only ‘Upload File’ keyword here because that keyword will also ‘Click’ on ‘Upload’ button as well, so please remove previous steps (Click and Wait) and only use this step.:

WebUI.uploadFile(findTestObject('Page_docCM/upload button'), 'D:\\Users\\mjoshi\\Capture1.JPG') 

#16

Thanks a lot I will try and will let you how it goes


#17

Hello , I have made changes according to your instructions .Its executing all the steps but not uploading file here is my console

03-14-2018 11:49:42 PM - [START] - Start Test Case : Test Cases/one more trial

03-14-2018 11:49:42 PM - [INFO] - Evaluating variables for test case

03-14-2018 11:49:42 PM - [START] - Start action : openBrowser

03-14-2018 11:49:42 PM - [INFO] - Opening browser

03-14-2018 11:49:42 PM - [INFO] - Starting ‘IE’ driver

03-14-2018 11:49:42 PM - [INFO] - Action delay is set to 0 seconds

Started InternetExplorerDriver server (32-bit)

3.6.0.0

Listening on port 22103

Log level is set to TRACE

Log file is set to D:\Users\mjoshi\AppData\Local\Temp\Katalon\Test Cases\one more trial\20180314_234940\IEDriverServer.log

Only local connections are allowed

Mar 14, 2018 11:49:44 PM org.openqa.selenium.remote.ProtocolHandshake createSession

INFO: Detected dialect: W3C

03-14-2018 11:49:44 PM - [RUN_DATA] - Logging run data ‘sessionId’ with value ‘9c8dd43d-faa9-46a1-8a6b-757b9f40a62c’

03-14-2018 11:49:44 PM - [RUN_DATA] - Logging run data ‘browser’ with value ‘IE 11’

03-14-2018 11:49:44 PM - [RUN_DATA] - Logging run data ‘platform’ with value ‘Windows 7’

03-14-2018 11:49:44 PM - [RUN_DATA] - Logging run data ‘seleniumVersion’ with value ‘3.7.1’

03-14-2018 11:49:44 PM - [RUN_DATA] - Logging run data ‘proxyInformation’ with value ‘ProxyInformation{proxyOption=NO_PROXY, proxyServerType=HTTP, password=, proxyServerAddress=, proxyServerPort=0}’

03-14-2018 11:49:44 PM - [PASSED] - Browser is opened with url: ‘’

03-14-2018 11:49:44 PM - [END] - End action : openBrowser

03-14-2018 11:49:44 PM - [START] - Start action : navigateToUrl

03-14-2018 11:49:44 PM - [INFO] - Checking url

03-14-2018 11:49:44 PM - [INFO] - Navigating to ‘https://ecms.doc.govt.nz/wcc/faces/wccmain

03-14-2018 11:49:47 PM - [PASSED] - Navigate to ‘https://ecms.doc.govt.nz/wcc/faces/wccmain’ successfully

03-14-2018 11:49:47 PM - [END] - End action : navigateToUrl

03-14-2018 11:49:47 PM - [START] - Start action : click

03-14-2018 11:49:47 PM - [INFO] - Finding Test Object with id ‘Object Repository/Page_docCM/upload button’

03-14-2018 11:49:47 PM - [INFO] - Checking object

03-14-2018 11:49:47 PM - [INFO] - Checking timeout

03-14-2018 11:49:47 PM - [INFO] - Finding web element with id: ‘Object Repository/Page_docCM/upload button’ located by 'By.xpath: //div[@id=‘DOCSV:glb:cdctb1’]/a/span

’ in ‘30’ second(s)

03-14-2018 11:49:47 PM - [INFO] - Found 1 web elements with id: ‘Object Repository/Page_docCM/upload button’ located by 'By.xpath: //div[@id=‘DOCSV:glb:cdctb1’]/a/span

’ in ‘30’ second(s)

03-14-2018 11:49:47 PM - [INFO] - Clicking on object: ‘Object Repository/Page_docCM/upload button’

03-14-2018 11:49:49 PM - [PASSED] - Object: ‘Object Repository/Page_docCM/upload button’ is clicked on

03-14-2018 11:49:49 PM - [END] - End action : click

03-14-2018 11:49:49 PM - [START] - Start action : uploadFile

03-14-2018 11:49:49 PM - [INFO] - Finding Test Object with id ‘Object Repository/Page_docCM/upload button’

03-14-2018 11:49:49 PM - [INFO] - Checking object

03-14-2018 11:49:49 PM - [INFO] - Uploading file ‘D:\\Users\\mjoshi\\Capture1.JPG’ to object: ‘Object Repository/Page_docCM/upload button’

03-14-2018 11:49:49 PM - [INFO] - Checking timeout

03-14-2018 11:49:49 PM - [INFO] - Finding web element with id: ‘Object Repository/Page_docCM/upload button’ located by 'By.xpath: //div[@id=‘DOCSV:glb:cdctb1’]/a/span

’ in ‘30’ second(s)

03-14-2018 11:49:49 PM - [INFO] - Found 1 web elements with id: ‘Object Repository/Page_docCM/upload button’ located by 'By.xpath: //div[@id=‘DOCSV:glb:cdctb1’]/a/span

’ in ‘30’ second(s)

03-14-2018 11:49:49 PM - [PASSED] - File ‘D:\\Users\\mjoshi\\Capture1.JPG’ sent to object: ‘Object Repository/Page_docCM/upload button’

03-14-2018 11:49:49 PM - [END] - End action : uploadFile

03-14-2018 11:49:49 PM - [PASSED] - Test Cases/one more trial

03-14-2018 11:49:49 PM - [END] - End Test Case : Test Cases/one more trial


#18

On my screen only I can see it clicks on upload button and upload window opens but file is not uploading see screenshot

image.png


#19

please help I really need to get this working I am giving poc for katalon tool with this application. Thanks a lot for your support


#20

This worked for me: