Following is the page source of file upload section.
Following is my code in Visual Studio Code
const remoteFilePath = await browser.uploadFile(filePath);
let fileUpload_var = $('//input[@type="file"]');
await fileUpload_var.setValue(remoteFilePath);
Am getting below Error
element not interactable: element not interactable
(Session info: chrome=103.0.5060.53)
enter code here
I tried this also, to make the enveloping span visible
const inputdiv = $(
'//span[@class="p-button-label"]'
);
await browser.execute(function () {
const elements = document.getElementsByClassName(
".p-button-label"
);
for (let i = 0; i < elements.length; i++) {
elements[i].style.display = "block";
elements[i].style.visibility = "visible";
}
});
inputdiv.style.display = "block";
inputdiv.style.visibility = "visible";
await inputdiv.waitForDisplayed();
Now the error is : element ("//span[@class="p-button-label"]") still not displayed after 10000ms