Answer the question
In order to leave comments, you need to log in
How to form a screenshot name from a class name and a method?
Colleagues, hello!
Quite a little expert on TestNG, so the question arose: how to form the name of the screenshot file from the name of the class and the method that called it.
Listners are hardly suitable here, it is necessary at the time of the method run (say, there is already a makeScreenshot() method) to extract this data, but I don’t understand how yet.
Something like this:
@Test
public static void logIn() {
proceedToLoginPage();
populateCreds();
clickSubmit();
makeScreenshot(); // Take a screenshot after logging into the system, for example. I just don't fully understand how to get this data in the method
}
And there are many places where the method is used.
I would be very grateful for any advice.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question