I am automating a desktop UI using Appium/WinAppDriver with Visual Studio 2022 Pro as the IDE. I am developing my tests using a console app with .NET Core 3.1.
When I run my program, the console appears in the middle of the screen, followed by the application I am testing. I see that, often, my app hides behind the console, causing the test to fail. How can I make sure my console is minimized and stays minimized during the program execution? I tried other solutions listed on Stackoverflow, including the DLL code, but nothing worked. Please advise - any help would be much appreciated.
I tried the solution here: Minimize Console at app startup C#
I added it to the top of my Program.cs, expecting it to minimize the console while running the program, but it just kept my console app up, with nothing else happening.