I want to send the content of a text file to textArea of a webpage and my first code was to read the textFile into a String and then send it to the textArea But the problem is that this method takes a lot of time specially if the file is big
Is there is another efficient way to do that? I thought of copy the file cntrl+A cntrl+C cntrl+V but how to do that ? and another idea is to drag and drop the text file into the text area but this didn't work with me
I come up with a fast solution to copy the content of text file regardless of the size of the file. The idea is to get
the text file in WebDriver and then copy the content of the page using Selenium as follow:
driver.get("file://" + "The local path of my text file");
String content = driver.findElement(By.xpath("/html/body/pre")).getText();
This method is fast and takes lower than one second to read the content of the text file