I'm attempting to upload a file into a form, but there is no input element with the type of "file".
I'm able to remove the "readonly" attribute and send keys to the input text box, but it throws a general error when I click the upload button. (just a popup with no useful information)
This is the element as presented:
<input type="text" autocomplete="off" class="form-control animate-show
ng-pristine ng-empty ng-invalid ng-invalid-required ng-touched"
id="filepath" ng-model="model.name" ng-required="configuration.Required"
readonly="" required="required" style="">
This is the element after selecting a file manually:
<input type="text" autocomplete="off" class="form-control animate-show
ng-pristine ng-touched ng-not-empty ng-valid ng-valid-required"
id="filepath" ng-model="model.name" ng-required="configuration.Required"
readonly="" required="required" style="">
This is the element after removing "readonly" and sending my file path via selenium:
<input type="text" autocomplete="off" class="form-control animate-show
ng-touched ng-not-empty ng-dirty ng-valid-parse ng-valid ng-valid-required"
id="filepath" ng-model="model.name"
ng-required="configuration.Required" required="required" style="">
Test setup: Ubuntu 20 python 3.8 chrome 91.0.4472.114 selenium 3.141.0
Update: I found the input field below with the type of "file", but it's located at the bottom of the page. (not within the expected modal) Passing the path to this element was successful (no selenium errors), but the upload process still failed.
<label tabindex="-1" style="visibility: hidden; position: absolute;
overflow: hidden; width: 0px; height: 0px; border: none; margin: 0px;
padding: 0px;">upload<input type="file" ngf-select=""
ng-model="model" ng-show="!model"></label>
"upload"
<input type="file" ngf-select="" ng-model="model" ng-show="!model">
<label tabindex="-1" style="visibility: hidden; position: absolute;
overflow: hidden; width: 0px; height: 0px; border: none; margin: 0px;
padding: 0px;">upload
<input type="file" ngf-select="" ng-model="model" ng-show="!model">
</label>
type="text"input, I think you are supposed to upload file path! There is id that said filepathsend_keys(), probably you can check for this css as well ,input[type='file']((//input[@type='file'])[1])I can see you have 3 input tags select based on an index