Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sap.ui.unified.FileUploader - how to upload a file #189

Closed
alinva opened this issue Apr 16, 2020 · 3 comments
Closed

sap.ui.unified.FileUploader - how to upload a file #189

alinva opened this issue Apr 16, 2020 · 3 comments

Comments

@alinva
Copy link

alinva commented Apr 16, 2020

Dear colleagues,

Could you please mention how to upload a file to FileUploader using uiveri5 ?

Thanks & Best regards,
Alina

@maximnaidenov
Copy link
Contributor

Hi, UIVeri5 is webdriverjs + some UI5 helpers and so everything that works in webdrivejs works here also. Generally, the idea is to find the file input dom element and send the absolute name of the uploaded file. Webdriver will handle this and the file will be uploaded. Here is a snippet from some existing tests:

var docUploadInput = element(by.control({
id : "fileUploader"
}));

action:
iUploadDocument : function(sPath) {
var absolutePath = path.resolve(__dirname, sPath);//(when files are saved in the some folder in the project itself)
docUploadInput.sendKeys(absolutePath);
},

in spec.js

When.onTheDocumentFormats.iUploadDocument(filePath);

@alinva
Copy link
Author

alinva commented May 11, 2020

Thanks!

@nuramon9999
Copy link

nuramon9999 commented Apr 27, 2021

Hi there :)
I have tried the approach on #189, but sendKeys only goes into the input but is unable to type anything. When in the element I cannot type anything either.
Could the input be disabled? If so, how to I reenable it.
Alternatively, I can change the value of the element. Then I can actually input something. But then I do not know how to submit the fileUploader.
Any advise on that?
Best regards,
Pascal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants