File upload Windows

Hi there,

You open the test case, then switch to ‘Script’ mode, then find the custom keyword you’ve used, then adjust your path value to add replace all next to that path.

Thanks

____________________
Thank you for choosing Katalon Studio as your automation solution.
Your feedback is needed to make Katalon Studio a better tool, take the survey at: https://goo.gl/S25NVO

Now my script line look like this, but it didn’t help, so I am probably lost in syntax

CustomKeywords.‘acfileupload.acfileuploadkw.uploadFile’(findTestObject(‘UploadWebPart/BrowseButtonWebPart’), ‘C:\\\Users\\\vewa\\\Documents\\\Tesdata\\\Test20170601_A.pdf’.replaceAll("\\\\\\", “\\\”))

Wbr

Vegar

Fra: Oliver Howard (Katalon Studio Support) [mailto:support@katalonhelp.zendesk.com]
Sendt: onsdag 5. juli 2017 12.49
Til: Vegar Warhuus
Emne: [Katalon Studio Customer Support] Ticket answered. Re: File upload Windows 1094

Hi there,

That is incorrect adjustments, you script should looks like this, please copy it and paste it to your test case:
CustomKeywords.‘acfileupload.acfileuploadkw.uploadFile’(findTestObject(‘UploadWebPart/BrowseButtonWebPart’), “C:\\Users\\vewa\\Documents\\Tesdata\\Test20170601_A.pdf”.replaceAll("\\\\\\", “\\\”))

Thanks

____________________
Thank you for choosing Katalon Studio as your automation solution.
Your feedback is needed to make Katalon Studio a better tool, take the survey at: https://goo.gl/S25NVO

Hi

The quadruppel splashes was there filepath without my intervention. When I replace the line with excactly what you have entered, I am still in the situation where nothing is entered in the windows File path.

I am affraid this is a no go at the moment, and that the conclution is part that I am too lightweigt programmer to find a workaround, and part that Katalon Studio doesn’t fully support norwegian (nordic) Windows/keyboard.

Hi there,

Thanks for your information. Somehow my execution is successfully on both Firefox, Chrome and IE without any adjustments, so I doubt it’s related to these ones:
robot.keyPress(KeyEvent.VK_ENTER);
robot.keyRelease(KeyEvent.VK_ENTER);
robot.keyPress(KeyEvent.VK_CONTROL);
robot.keyPress(KeyEvent.VK_V);
robot.keyRelease(KeyEvent.VK_V);
robot.keyRelease(KeyEvent.VK_CONTROL);
robot.keyPress(KeyEvent.VK_ENTER);
robot.keyRelease(KeyEvent.VK_ENTER);
I will see if I can come up other solution.

Thanks

____________________
Thank you for choosing Katalon Studio as your automation solution.
Your feedback is needed to make Katalon Studio a better tool, take the survey at: https://goo.gl/S25NVO

Yes, it is definitely the splash thing that is the reason why it doesnt work.

\\\ in the script makes the script able to enter the value in the windows filepath field, though a value with double splashes, which is not valid for Windows

\\ leaves the script believing that the operation went OK, but leaves blank Windows filepath field

I have tried different valid variations of replaceAll, but as soon as I use this, the Windows filepath field is left blank

Anyway, thanks for your patientce and efforts to help out

Wbr

Vegar

Fra: Oliver Howard (Katalon Studio Support) [mailto:support@katalonhelp.zendesk.com]
Sendt: onsdag 5. juli 2017 13.29
Til: Vegar Warhuus
Emne: [Katalon Studio Customer Support] Ticket answered. Re: File upload Windows 1094

Thanks, everyone. I’m gonna close this discussion now. If you have any question, don’t hesitate to start a new one. We always appreciate your feedback and suggestions.

WebUI.uploadFile(findTestObject(‘Object Repository/AddClient_Page/lnk_Browse_fileUpload’), filePath)

I am getting an error while uploading file through window popup. Please look into this and suggest any solution

Root cause: org.openqa.selenium.WebDriverException: unknown error: cannot focus element
(Session info: chrome=74.0.3729.131)
(Driver info: chromedriver=2.43.600210 (68dcf5eebde37173d4027fa8635e332711d2874a),platform=Windows NT 10.0.14393 x86_64) (WARNING: The server did not provide any stacktrace information)

I’m also trying to figure out how to fix it. I tried actions described here (https://grokbase.com/t/gg/selenium-users/142jj2483b/chromedriver-error-cannot-focus-element), but it is clicking ‘Upload’ button but not sending file from the file path…

update:
ok that worked for me:
CustomKeywords.‘WebUICustomKeyword.uploadFile’(findTestObject(‘Portal_Request_Page/upload_original_file_button’), “C:\Automation\st12693.en07.doc”)

so no need to add replaceAll in my case…

ok it worked but only…once…after few runs it is opening upload dialog but is not entering any file…