How to make a widget display in a standalone window?

Hi community!

I’m trying to open a ScreenshotComparison window same as the screenshot comparison tab in session frontend by one of my pieces of code about functional test. The window is expected to show without opening the editor, as shown below.

Here’s my code:

// Get ScreenshotManager
IScreenShotToolsModule& ScreenShotModule = FModuleManager::LoadModuleChecked<IScreenShotToolsModule>("ScreenShotComparisonTools");
IScreenShotManagerPtr ScreenShotManager = ScreenShotModule.GetScreenShotManager();

// Create a ScreenshotComparison widget
TSharedPtr<SWidget> ScreenshotComparisonWidget = FModuleManager::LoadModuleChecked<IScreenShotComparisonModule>("ScreenShotComparison")


It’s built successfully, though nothing happened when I ran the test. Looks simply setting the widget visible won’t work to pop up a standalone window.

Another of my thought is that perhap I cannot make a SWidget visible? Then do I need to put it into some other kinds of widget? How to make the whole thing display in a standalone window then?

By the by, it’s my first time asking a question here, please forgive and remind me if I got something wrong.

Many thanks!