- Notifications
You must be signed in to change notification settings - Fork 11
NullPointerException #1
Description
Hello Conny,
I'm trying to run your code and getting NPE. I think some major initiation step is missing in your readme file.
You are creating a new TakeScreenshotRule object:
@rule
public TakesScreenshotRule screenshot = new TakesScreenshotRule();
...and then call it's takeScreenshot(driver) method which in turn calls:
public ScreenshotMeta takeScreenshot(String id, WebDriver driver) throws IOException {
return this.screenshotManager.takeScreenshot(driver, id);
}
BUT screenshotManager is not initialized at this point and that is why I get NPE (screenshotManager = NULL).
screenshotManager is initialized in:
public Statement apply(Statement base, FrameworkMethod method, Object target) {
this.screenshotManager = new ScreenshotManager(target.getClass(), method.getName());
return base;
}
....but this method is not called from anywhere.
Could you please provide a bit more details on how to make this code work?
Thank you in advance,
Michael