Ejemplo n.º 1
0
        public void DotNetSetWindowPosition()
        {
            using (RegistryHelper reg = new RegistryHelper())
            {
                reg.BackupRegistry();
                VersionSelector.SetConsoleVersion(reg, ConsoleVersion.V2);

                using (CmdApp app = new CmdApp(CreateType.ProcessOnly, TestContext))
                {
                    // maximize the window
                    AppiumWebElement titleBar = app.GetTitleBar();
                    app.Actions.DoubleClick(titleBar);

                    // wait for double click action to react.
                    Globals.WaitForTimeout();

                    // do the thing that makes it upset.
                    // MSFT:2490828 called Console.SetWindowPosition, so let's just copy the .NET source for that here...
                    // see: http://referencesource.microsoft.com/#mscorlib/system/console.cs,fcb364a853d81c57
                    SetWindowPosition(0, 0);
                }
            }
        }