File upload in headless execution
Hi Everyone !
We are using TestComplete to configure the test cases and TestExecute to execute test cases of VM. We recently added (recorded) test case which contain information upload using file upload dialogue box on a web page. The test case executes successfully in head mode but fails in headless mode (Chrome). In the headless mode, the test case fails at the step of clicking on the "Choose File" button with error "Unable to click the control". We tried with keys command but file is not uploaded. We have following element on the web page -
<input type="file" file-upload="" ng-model="tempVO.uploadFile" name="tempVO.uploadFile" ng-init="tempVO.uploadFile=''" groupid="" data-opt="noValue"
class="ng-pristine ng-scope ng-invalid ng-invalid-required ng-touched" aria-invalid="true" style="">
We have written following script -
var ichrome= Sys.Process("chrome", 1)
var page = ichrome.Page("*")
fileuploadfield = page.FindChildByXPath("//*[@type='file']")
fileuploadfield.Keys("D:\\workspace\\TestComplete\\test_upload.xls")
The above script is not giving any error but file is not getting uploaded.
Thanks in advance