How do I correctly use the Automation Driver and Automation Spec for UI testing?

Hey there, to find the UMG element you have to set its metadata, but the MetaData can only be set as a slate component in C++. So I found the elements by creating a blueprint helper function that adds a MetaData to the UMG element as a generic slate element in C++ and calling the helper function in the Widget BP OnConstruct