-1

I would like to write the code for uploading file using Autoit in Selenium Webdriver(C#). I have installed Autoit. Create the exe file where I have mentioned the file location which I want to upload.

But when I write :

Runtime.getRuntime().exec(fileupload);

It shows me the following error:

object doest not contain a definition for "getRuntime" and no extension method getRuntime.

Am I missing something? Can anyone help?

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
Rumana
  • 1
  • 1

1 Answers1

0

As per the documentation Runtime.getRuntime().exec() method takes the absolute path of the executable along with the extension i.e. .exe. So you need to modify your code as follows :

  • C# Binding Art :

    Runtime.getRuntime().exec(@"C:\\path\\to\\AutoIT\\fileupload.exe");
    
  • Java Binding Art :

    Runtime.getRuntime().exec("C:\\path\\to\\AutoIT\\fileupload.exe");
    
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352