# How to test UMG UI properly?

**URL:** <https://forums.unrealengine.com/t/how-to-test-umg-ui-properly/2076259>\
**Category:** UI\
**Tags:** testing, automated-testing, unreal-engine, UI, question\
**Created:** [October 19, 2024, 8:55pm UTC](https://forums.unrealengine.com/t/how-to-test-umg-ui-properly/2076259 "2024-10-19T20:55:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DmitryBond](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DmitryBond](https://forums.unrealengine.com/u/DmitryBond)\
**Post date:** [October 19, 2024, 8:55pm UTC](https://forums.unrealengine.com/t/how-to-test-umg-ui-properly/2076259/1 "2024-10-19T20:55:25Z")

</div>

After reading the [Automation Driver (Official Docs)](https://dev.epicgames.com/documentation/en-us/unreal-engine/automation-driver-in-unreal-engine) - I’m trying to do a super simple thing: basically load my menu level and test my UI - click some buttons, navigate some areas, etc.

I have a simple UMG menu, nothing fancy. Problem is: I can’t quite figure out how to mark the UMG elements so that the driver sees them.

My code:

```c
...
void MainMenuNavigationSpec::Define()
{
    BeforeEach([this]()
    {
        AutomationOpenMap("/Game/L_MainMenu");
        World = GetWorld();

        IAutomationDriverModule::Get().Enable();
        Driver = IAutomationDriverModule::Get().CreateDriver();
    });

    Describe("Main Menu Navigation", [this]()
    {
        It("should navigate to the Settings menu when clicking the Settings button", EAsyncExecution::ThreadPool, [this]()
        {
            FPlatformProcess::Sleep(1.0f); 
            FDriverElementRef Element = Driver->FindElement(By::Id("WhatDoIWriteHere?"));
            TestTrue("Button_Settings", Element->Exists());
...

```

If I play the spec in session frontend - all good, I see my menu, but I can’t find any element. Docs say I need to add some kind of metadata using something like `..AddMetaData(FDriverMetaData::Id("SignUpFormFirstNameField"))` - but UMG doesn’t give me direct access to Slate elements, so I guess I can’t use this?

Or is Automation Driver not meant to be used with Slate at all? (Looks like it - all examples are slate-only).

I feel lost. Any advise would be very valuable, as I find the docs / information on the topic very scarse.
