Writing tests with c#/nunit and running tests on the same machine i could use System.Windows.Forms, or call Autoit script to handle upload window that selenium cant interact with normally.

But this does not work if i run tests remotely.

Is there any option or trick to upload file using windows file upload dialog when executing tests remotely ?


Maybe this will help someone

In my case, there was file upload form, thats hidden. So after making it visible (in this case, change class), its possible to use SendKeys and send file path to that element, thus uploading file (if it exists in that VM)


    string filePath = "C://File//Path/File.txt";
    IJavaScriptExecutor js = driver as IJavaScriptExecutor;
    js.ExecuteScript("document.getElementById('import-file-btn').className = 'btn'");

No, there is not any option or trick to upload a file using the windows file upload dialog when executing tests remotely.

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.