# How do I create an automation test?

**URL:** <https://forums.unrealengine.com/t/how-do-i-create-an-automation-test/425003>\
**Category:** C++\
**Tags:** testing, automated-testing, unreal-engine, test, editor, question, CPP\
**Created:** [May 13, 2018, 10:28am UTC](https://forums.unrealengine.com/t/how-do-i-create-an-automation-test/425003 "2018-05-13T10:28:00Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stormbreath](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Stormbreath](https://forums.unrealengine.com/u/Stormbreath)\
**Post date:** [May 13, 2018, 10:28am UTC](https://forums.unrealengine.com/t/how-do-i-create-an-automation-test/425003/1 "2018-05-13T10:28:00Z")

</div>

So I’ve spent my weekend trying to learn about automation tests. I understand that I can create them using one of two macros, but I don’t know how to implement something I want to do. I also just have some questions about testing in general.

Say I have an actor called AGrid. I would like to run a simple test where I make an empty map (I think you can do this with FAutomationEditorCommonUtils::CreateNewMap()), spawn an AGrid in that empty map, and check that everything is initialized correctly. I just can’t seem to make a version of this test that compiles.

Say I have an actor called ASquareGrid, with a function called AddTile(int x, int y, int z). Do I need to spawn a grid as described in the above paragraph, or is there a way to test the actor without spawning it in a map? Can I just declare ASquareGrid as a variable and call functions on it?

Some code examples would be useful, because I just can’t seem to find anything online. I’m also not sure if [Automation Technical Guide | Unreal Engine Documentation](https://docs.unrealengine.com/en-us/Programming/Automation/TechnicalGuide) is up to date.

Some code examples would be useful, because I just can’t seem to find anything online.

---

<div class="post-metadata">

**Author:** ![Squareys](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Squareys](https://forums.unrealengine.com/u/Squareys)\
**Post date:** [August 12, 2018, 9:18am UTC](https://forums.unrealengine.com/t/how-do-i-create-an-automation-test/425003/2 "2018-08-12T09:18:50Z")

</div>

Hi Stormbreath!

Glad I’m not the only one using the AutomationTesting 😃

> not sure if […] is up to date.

It’s not.

Use `AutomationLoadMap(MapName);` instead of `FEngineAutomationTestUtilities::LoadMap(MapName);` for example. And adding a test looks more like this:

```
IMPLEMENT_SIMPLE_AUTOMATION_TEST(FMyTest, "MyGame.SubElement", EAutomationTestFlags::EditorContext | EAutomationTestFlags::ClientContext | EAutomationTestFlags::ProductFilter)
bool FGamesTest::RunTest(const FString& Parameters) {
    TestTrue("Some Condition", false, true);
}

```

I recommend using the Engine’s tests as a base. I’ve been wanting to write an “up-to-date tutorial” for half a year now. I may find time to do so today and then post a link to it here.

Cheers,

---

<div class="post-metadata">

**Author:** ![LDOGLONDON](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LDOGLONDON](https://forums.unrealengine.com/u/LDOGLONDON)\
**Post date:** [April 19, 2019, 7:58pm UTC](https://forums.unrealengine.com/t/how-do-i-create-an-automation-test/425003/3 "2019-04-19T19:58:27Z")

</div>

I hope you do!

---

<div class="post-metadata">

**Author:** ![Squareys](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Squareys](https://forums.unrealengine.com/u/Squareys)\
**Post date:** [April 19, 2019, 8:59pm UTC](https://forums.unrealengine.com/t/how-do-i-create-an-automation-test/425003/4 "2019-04-19T20:59:50Z")

</div>

I actually did, aparently the same day and completely forgot to put the link here, sorry!

[https://blog](https://blog)…de/ue4-automation-testing/

---

<div class="post-metadata">

**Author:** ![LDOGLONDON](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LDOGLONDON](https://forums.unrealengine.com/u/LDOGLONDON)\
**Post date:** [April 19, 2019, 9:08pm UTC](https://forums.unrealengine.com/t/how-do-i-create-an-automation-test/425003/5 "2019-04-19T21:08:55Z")

</div>

Oh yeah, I was actually using that lol. Thanks, really good tutorial! Would you happen to know the difference between UE4’s EditorTests module and RuntimeTests plugins? I’m currently setting up my tests like that, but I’m not sure if the plugins are set up differently or if thats just a clean way of keeping those tests separate.

Again thanks for the tutorial!

---

<div class="post-metadata">

**Author:** ![Squareys](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Squareys](https://forums.unrealengine.com/u/Squareys)\
**Post date:** [April 19, 2019, 9:17pm UTC](https://forums.unrealengine.com/t/how-do-i-create-an-automation-test/425003/6 "2019-04-19T21:17:25Z")

</div>

Awesome! Great to hear you like the tutorial.

I _think_ it’s just a way to keep them organized. Especially since Editor tests don’t need to be bundled with the Game, i.e. you can deactivate the module for those.

---

<div class="post-metadata">

**Author:** ![LDOGLONDON](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LDOGLONDON](https://forums.unrealengine.com/u/LDOGLONDON)\
**Post date:** [April 19, 2019, 9:29pm UTC](https://forums.unrealengine.com/t/how-do-i-create-an-automation-test/425003/7 "2019-04-19T21:29:42Z")

</div>

Okay, cool thanks!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_350a2929](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_350a2929](https://forums.unrealengine.com/u/anonymous_user_350a2929)\
**Post date:** [February 19, 2021, 1:10pm UTC](https://forums.unrealengine.com/t/how-do-i-create-an-automation-test/425003/8 "2021-02-19T13:10:13Z")

</div>

hi, the link doesn t work
