public void Execute(Arguments arguments) { var wrapper = MsCrmManager.CurrentCRM; if (wrapper == null) { throw new ApplicationException("Could not activate Dynamics CRM instance. It has to be attached first."); } IntPtr iHandle = wrapper.Ie.NativeBrowser.hWnd; Scripter.Log.Log(AbstractLogger.Level.Info, "Window '" + wrapper.Title + "' has been found"); Scripter.LastWindow = (iHandle); RobotWin32.BringWindowToFront(iHandle); if (arguments.Style.Value.ToLower() == "maximize") { RobotWin32.ShowWindow(iHandle, RobotWin32.ShowWindowEnum.Maximize); } else if (arguments.Style.Value.ToLower() == "minimize") { RobotWin32.ShowWindow(iHandle, RobotWin32.ShowWindowEnum.Minimize); } else if (arguments.Style.Value.ToLower() == "normal") { RobotWin32.ShowWindow(iHandle, RobotWin32.ShowWindowEnum.Restore); } }
public void WaitForExistingImageTest() { testerApp = SDK.Tester.RunFormTester("Title TestApp"); Color color = Color.Gainsboro; string colorCode = "FFDCDCDC"; RobotWin32.ShowWindow(testerApp.MainWindowHandle, RobotWin32.ShowWindowEnum.ShowNormal); Scripter scripter = new Scripter(); scripter.InitVariables.Clear(); scripter.RunLine("window TestApp"); scripter.InitVariables.Add(nameof(colorCode), new TextStructure(colorCode)); scripter.Text = $@"keyboard {TextChar}FocusOnControl tbColorRGB{TextChar} keyboard {SpecialChars.KeyBegin}enter{SpecialChars.KeyEnd} keyboard {TextChar}{SpecialChars.Variable}{nameof(colorCode)}{TextChar} keyboard {SpecialChars.KeyBegin}enter{SpecialChars.KeyEnd}"; scripter.Run(); string path1 = Assembly.GetExecutingAssembly().UnpackResourceToFile("Resources." + nameof(Resources.littleGrayRectangle), "bmp"); scripter.RunLine($"waitfor.image image {SpecialChars.Text}{path1}{SpecialChars.Text}"); }
public void Execute(Arguments arguments) { var control = AccessManager.CurrentAccess.GetControlByPath(arguments.Path.Value); var handle = (IntPtr)control.GetFormHwnd(); RobotWin32.BringWindowToFront(handle); RobotWin32.ShowWindow(handle, RobotWin32.ShowWindowEnum.Maximize); control.SetFocus(); }
public void WaitForImageTest() { Color color = Color.Pink; string colorCode = "FFFFC0CB"; string path = Assembly.GetExecutingAssembly().UnpackResourceToFile("Resources." + nameof(Resources.smallPink), "bmp"); Scripter scripter = new Scripter(); testerApp = SDK.Tester.RunFormTester($"CenterOfScreen FocusOnControl tbColorRGB ChangeColor {colorCode} "); RobotWin32.ShowWindow(testerApp.MainWindowHandle, RobotWin32.ShowWindowEnum.ShowNormal); scripter.Text = $"waitfor.image image {SpecialChars.Text}{path}{SpecialChars.Text} timeout 8000"; scripter.Run(); }
public void Execute(Arguments arguments) { string errorJump = arguments.ErrorJump != null && arguments.ErrorJump != null?arguments.ErrorJump.ToString() : string.Empty; string host = arguments.Host.Value; //telnet = System.Diagnostics.Process.Start(pathToTelnet, host); putty = System.Diagnostics.Process.Start(pathToPutty, "-load AS400"); System.Threading.Thread.Sleep(2000); //RobotWin32.ShowWindow(telnet.MainWindowHandle, RobotWin32.ShowWindowEnum.ShowNormal); //IntPtr iHandle = RobotWin32.FindWindow(null, telnet.MainWindowTitle); RobotWin32.ShowWindow(putty.MainWindowHandle, RobotWin32.ShowWindowEnum.ShowNormal); IntPtr iHandle = RobotWin32.FindWindow(null, putty.MainWindowTitle); RobotWin32.SetForegroundWindow(iHandle); }
public void Execute(Arguments arguments) { string host = arguments.Host.Value; string port = arguments.Port.Value; string pass = arguments.Password.Value; if (host == string.Empty || port == string.Empty || pass == string.Empty) { throw new ApplicationException("Host or port or pass is empty"); } testerApp = System.Diagnostics.Process.Start(pathToVNC, "-Scaling Fit -Encryption Server " + host + " " + port + " " + pass); bool result = RobotWin32.ShowWindow(testerApp.MainWindowHandle, RobotWin32.ShowWindowEnum.ShowNormal); Scripter.Variables.SetVariableValue(arguments.Result.Value, new BooleanStructure(result)); }
public void Execute(Arguments arguments) { var pathToVNC = Path.Combine(AbstractSettingsContainer.Instance.UserDocsAddonFolder.FullName, @"VNC.exe"); var host = arguments.Host.Value; var port = arguments.Port.Value; var pass = arguments.Password.Value; if (host == string.Empty || port == string.Empty || pass == string.Empty) { throw new ApplicationException("Host or port or pass is empty"); } var testerApp = Process.Start(pathToVNC, "-Scaling Fit -Encryption Server " + host + " " + port + " " + pass); var result = RobotWin32.ShowWindow(testerApp.MainWindowHandle, RobotWin32.ShowWindowEnum.ShowNormal); Scripter.Variables.SetVariableValue(arguments.Result.Value, new BooleanStructure(result)); }
public void Execute(Arguments arguments) { var pathToTelnet = Path.Combine(AbstractSettingsContainer.Instance.UserDocsAddonFolder.FullName, @"telnet.exe"); var pathToPutty = Path.Combine(AbstractSettingsContainer.Instance.UserDocsAddonFolder.FullName, @"putty.exe"); var errorJump = arguments.ErrorJump != null && arguments.ErrorJump != null?arguments.ErrorJump.ToString() : string.Empty; var host = arguments.Host.Value; //telnet = System.Diagnostics.Process.Start(pathToTelnet, host); var putty = Process.Start(pathToPutty, "-load AS400"); Thread.Sleep(2000); //RobotWin32.ShowWindow(telnet.MainWindowHandle, RobotWin32.ShowWindowEnum.ShowNormal); //IntPtr iHandle = RobotWin32.FindWindow(null, telnet.MainWindowTitle); RobotWin32.ShowWindow(putty.MainWindowHandle, RobotWin32.ShowWindowEnum.ShowNormal); var iHandle = RobotWin32.FindWindow(null, putty.MainWindowTitle); RobotWin32.SetForegroundWindow(iHandle); }
public static Process StartFormTester(string arguments) { string location = null;//TODO typeof(Robot.FormTester.G1ANTRobotFormTester).Assembly.Location; var process = Process.Start(location, arguments); while (process.MainWindowHandle == IntPtr.Zero) { System.Threading.Thread.Sleep(20); } process.WaitForInputIdle(); Thread.Sleep(5000); while (IsIconic(process.MainWindowHandle)) { RobotWin32.ShowWindow(process.MainWindowHandle, RobotWin32.ShowWindowEnum.Show); } process.WaitForInputIdle(); return(process); }