Advanced Screenshots - Xceptance/neodymium GitHub Wiki
The Neodymium documentation has been relocated. You can now find the complete documentation here, and the specific Advanced Screenshots page here.
The normal screenshots provided by Selenide sometimes do not show everything that is needed to analyze a bug. Therefore, Neodymium offers the option to use advanced screenshots.
To enable the use of advanced Screenshots one has to simply enable it in the properties.
neodymium.screenshots.enableAdvancedScreenshots = trueOn default this will take normal screenshots of the viewport visible at the moment of failure. Only difference being that the screenshots are now stored in separate folders for each test class. As test class names can be similar for different areas you want to test, the folder names also contain the entire name of the package it is in.
For example the screenshots for test class BrowseTest which is in smoke sub-package would be stored like this:
They will also have a name containing the calling test method name, used browser profile, provided data set and a timestamp.
With bigger Testsuites this folder structure could get quite confusing, as there will be a lot of folders with similar names. So in order to keep track of all the Screenshots. You have the option of automatically generating a folder tree structure. So for the example above this would look like this:
To activate this enable the neodymium.screenshots.enableTreeDirectoryStructure property.
With CSS-selectors it is sometimes not clear which of the elements of a given website was handled last (and if it even was the correct element). For this Neodymium provides the option to highlight the last element that was evaluated or manipulated.
By enabling the neodymium.screenshots.highlightLastElement property you will add highlighting to your screenshots.
The default color can be changed. With the neodymium.screenshots.highlightColor property you can change the color to any RBG color you think fits your testreports the best. The color has to be given in a hexadecimal format. So for example:
neodymium.screenshots.highlightColor = #0000FF
will make your screenshot look like this:
Sometimes only seeing the viewport does not tell the entire story of a failure. Neodymium enables you to get fullpage screenshots with the neodymium.screenshots.fullpagecapture.enable property.
To still be able to now were the current viewport was you can enable neodymium.screenshots.fullpagecapture.highlightViewport. So your screenshot can look like this:
Again the color of the highlighting can be changed to any RBG color using the neodymium.screenshots.fullpagecapture.highlightColor property.
The parts outside the viewport can be blurred, like in the example above. On default the blur is turned off. To activate it, the following line needs to be added to the neodymium.properties.
neodymium.screenshots.blurFullPageScreenshot = true
To still see the viewport with blur turned off, it is useful to enable the viewport highlighting, which is also the default now.