Save Screenshots as Artifact

Learn how to publish screenshots as artifacts in the Docker pipeline.

We need to add a few more tasks to the pipeline to get the screenshots from the Docker container.

Steps to get the screenshots from the container

Since the container stops after executing the Selenium tests, we need to start it again first.

After it is started, we copy the screenshots from the target/screenshots folder of the container in a sub-folder of the default working folder of the pipeline.

Finally, we save the screenshots from the default working folder as a pipeline artifact.

The new pipeline

The new pipeline code is given below:

Get hands-on with 1200+ tech skills courses.