Hi Sir,
In takeScreenshot() function, FileUtils.copyFile(scrFile, new File(System.getProperty("user.dir")+"//Screenshots//"+screenshotFile)); line showing an error. i couldn't identify the reason for this issue. Please help me to solve this error.
error:-
Cannot make a static reference to the non-static method copyFile(File, File) from the type FileUtils
Instructor
Ashish Thakur Replied on 19/06/2020
You have imported wrong FIleUtile it seems
Hi Sir, i have attached the screenshot of java imports in Base class. please have a look and help me to identify the wrong import
try this:
import org.apache.commons.io.FileUtils;
Instructor
Ashish Thakur Replied on 23/06/2020
Add this in pom
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.6</version>
</dependency>
and import this
import org.apache.commons.io.FileUtils;
Thank you sir, the issue is resolved after adding the dependencies in the pom xml.