我在使用OPA5脚本上传文件时遇到了一个问题。你能帮帮我吗。
请看我的代码..
xml::
<sap.ui.unified:FileUploader
id="fileUploader"
name="myFileUpload"
uploadUrl="upload/"
width="400px"
tooltip="Upload your file to the local server"
/>OPA脚本::
When.waitFor({
id: "fileUploader",
viewName: sViewName,
//actions: new Press(),
success : function (oFirstItem) {
oFirstItem.$().trigger("tap");
Opa5.assert.ok(true, "Upload Dialog got opened");
},
errorMessage: "Form Was not Submitted"
});您能帮助我应用正确的代码使用OPA脚本上传文件吗?
提前谢谢你
发布于 2018-05-31 22:03:47
如果你不想上传一个真实的文件,你可以将参数传递给fireChange函数。您可以使用action:
actions: function (oFileUploader) {
var mParameters = {
files: {
"0": {
"name": "something",
"type": "application/gzip",
"size": 123,
"lastModifiedDate": "2013-08-14T09:42:09.000Z",
"webkitRelativePath": ""
},
"length": 1
},
newValue: "\"newValueOfTheFile.tgz\" "
};
oFileUploader.fireChange(mParameters);
}然后你可以在同一个动作中使用fireUploadComplete函数(告知上传完成),或者在另一个动作中(如果你想在“上传”文件时检查一些东西)。
https://stackoverflow.com/questions/45605572
复制相似问题