Take Screenshot and place it in a folder with Test Class name
Submitted by harrydev on Mon, 01/26/2015 - 01:47In this tutorial, we will see taking a screen shot with test name and placing it in a folder by creating a folder with Test Class Name.
As we are taking screen shots on failure, we need to add logic in creating a screen shot and naming it with test name and place it in its test class name respectively.
We can get the test class name using 'result.getInstanceName()'. Test class name looks some thing like "com.pack.sample.HomePage". But we need to create a folder name with test class name i.e 'HomePage'.