Trying to automate uploading .xml/pdf format files (Windows based popup) from local system to web application (Angualrjs) using Protractor framework.
Scenario: Browser the application in Chrome> Click upload button> web app popup comes where able to locate elements > click Browse button on upload field (This field would be disabled, only click event is allowed which opens windows popup to browse files)> Here we have challenge to browse the file.
After clicking Browse button performed> Window popup shows Documents location however we want to browse and upload the file from Desktop or from Project location.
Followed other stackoverflow references as given below but unable to solve: How to upload file in angularjs e2e protractor testing
Scripts which we tried:
iUploadConfigDefinition : (sPath) => {
var absolutePath = path.resolve(__dirname, sPath);
uploadInput.sendKeys(absolutePath);
}
Here not sure what should be 'uploadInput' element locator and how to recognize/fetch Open button of windows popup.
Please guide. Attached the screen for reference.
Please try the following solution :