'On running Selenium Test through Gitlab CI/CD Pipeline, Screenshots are not displaying within Extent Test Report

On running Selenium Test through Gitlab CI/CD Pipeline, Screenshots are not displaying within Extent Test Report. Test Report and Screenshots folder are getting generated separately as an artifact there but on running in local, it is displaying within test report.

I have tried base 64 encoded also for taking screenshots but it is not working. As path will change as it runs on different server when we run automation suite on Gitlab CI/CD pipeline, therefore I guess screenshots are not getting displayed within extent report. Kindly please suggest what we can do here.



Solution 1:[1]

See GitLab 13.12 (May 2021)

Failed test screenshots in test report

GitLab makes it easy for teams to set up end-to-end testing with automation tools like Selenium that capture screenshots of failed tests as artifacts. This is great until you have to sort through a huge archive of screenshots looking for the specific one you need to debug a failing test. Eventually, you may give up due to frustration and just re-run the test locally to try and figure out the source of the issue instead of wasting more time.

Now, you can link directly to the captured screenshot from the details screen in the Unit Test report on the pipeline page. This lets you quickly review the captured screenshot alongside the stack trace to identify what failed as fast as possible.

https://about.gitlab.com/images/13_12/link-to-screenshot-failed-test.png -- Failed test screenshots in test report

See Documentation and Issue.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 VonC