Am working on protractor framework and I need to upload files to the application using a script.I know how to do it in java but no idea in javascript. Can someone please help me on this:
Java code :
public static void fileUpload(String script, String filePath) {
try {
Process proc = Runtime.getRuntime().exec("script " + script + " " + filePath);
BufferedReader read = new BufferedReader(new InputStreamReader(proc.getInputStream()));
try {
proc.waitFor();
} catch (InterruptedException e) {
System.out.println(e.getMessage());
}
}catch (IOException e) {
System.out.println(e.getMessage());
}
}
Thanks !