void ITestModule.Run() { Mouse.DefaultMoveTime = 1; Keyboard.DefaultKeyPressTime = 5; Delay.SpeedFactor = 1.0; string programLog = GlobalFunction.GetConfigSettings("EnableErrorLog"); string dbVersion = "v" + WinComponent.sxDBVersion; //GlobalFunction.GetConfigSettings("DBVersion"); string rxVersion = Ranorex.Host.Local.RanorexVersion; rxVersion = rxVersion.Remove(rxVersion.Length - 2); string executionTime = GlobalFunction.ExecutionTime(); string logFilename = ""; if (programLog == "true") { logFilename = @"Logs\System-XAuto-Test - EventLog_" + executionTime.Replace("-", String.Empty).Replace(":", String.Empty).Replace(" ", String.Empty) + ".htm"; System.IO.File.WriteAllText(logFilename, System.IO.File.ReadAllText("Logs\\System-XAuto-Test - EventLog.htm")); System.IO.File.WriteAllText(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\AppEvent.log", logFilename); GlobalFunction.WriteReportHeaderInfo(logFilename, "%Version%", WinComponent.GetAppInfo("Version")); GlobalFunction.WriteReportHeaderInfo(logFilename, "%BuildDate%", WinComponent.GetAppInfo("BuildDate")); GlobalFunction.WriteReportHeaderInfo(logFilename, "%DBVersion%", dbVersion); GlobalFunction.WriteReportHeaderInfo(logFilename, "%RXVersion%", rxVersion); } //bool dbcheck = MySQLConnector.CheckDbConnection(); /*bool dbcheck = true; * * if (dbcheck) * { * if (!GlobalFunction.IsConfigFileOK()) * { * GlobalFunction.ShowMessage("Feil på config-fil. Sjekk opsjoner eller logfil for mer informasjon.", MessageBoxIcon.Warning); * if (programLog == "true") {Process.Start(logFilename);} * dbcheck = false; * } * } * * SystemXTest.WinComponent Component = new SystemXTest.WinComponent(dbcheck); * Component.InitializeComponent(dbcheck);*/ if (!GlobalFunction.IsConfigFileOK()) { GlobalFunction.ShowMessage("Feil på config-fil. Sjekk opsjoner eller logfil for mer informasjon.", MessageBoxIcon.Exclamation); if (programLog == "true") { Process.Start(logFilename); } } else { //bool dbcheck = MySQLConnector.CheckDbConnection(); SystemXTest.WinComponent Component = new SystemXTest.WinComponent(); Component.InitializeComponent(); } }
public static bool Check(WinComponent component) { if (!component.Class.ToLower().Contains("button")) { return(false); } int style = component.Style; int BS_TYPEMASK = 0x0000000F; int BS_CHECKBOX = 0x2; int BS_AUTOCHECKBOX = 0x3; style = style & BS_TYPEMASK; return(style == BS_AUTOCHECKBOX || style == BS_CHECKBOX); }
public static bool Check(WinComponent component) { if (!component.Class.ToLower().Contains("button")) { return(false); } int style = component.Style; int BS_TYPEMASK = 0x0000000F; int BS_RADIOBUTTON = 0x0004; int BS_AUTORADIOBUTTON = 0x0009; style = style & BS_TYPEMASK; return(style == BS_RADIOBUTTON || style == BS_AUTORADIOBUTTON); }
private static WinComponent FromHandle(IntPtr hwndCur) { var chArWindowClass = new StringBuilder(257); PInvoke.GetClassName(hwndCur, chArWindowClass, 256); var strWndClass = chArWindowClass.ToString(); var length = PInvoke.GetWindowTextLength(hwndCur); var sb = new StringBuilder(length + 1); PInvoke.GetWindowText(hwndCur, sb, sb.Capacity); PInvoke.RECT rct; PInvoke.GetWindowRect(hwndCur, out rct); var style = PInvoke.GetWindowLong(hwndCur, PInvoke.GWL_STYLE); var res = new WinComponent(strWndClass, sb.ToString(), hwndCur, rct.Left, rct.Top, style); return(res); }
static WinceComponent FromWinComponent(WinComponent c) { if (WinceComboBox.Check(c)) { return(new WinceComboBox(c.Handle)); } else if (WinceButton.Check(c)) { return(new WinceButton(c.Handle)); } else if (WinceCheckBox.Check(c)) { return(new WinceCheckBox(c.Handle)); } else if (WinceTextBox.Check(c)) { return(new WinceTextBox(c.Handle)); } else if (WinceLabel.Check(c)) { return(new WinceLabel(c.Handle)); } else if (WinceRadio.Check(c)) { return(new WinceRadio(c.Handle)); } else if (WinceListBox.Check(c)) { return(new WinceListBox(c.Handle)); } else if (WinceContainer.Check(c)) { return(new WinceContainer(c.Handle)); } else { throw new NotImplementedException(string.Format("handle {0:X} unsupported", c.Handle)); } }
public static bool Check(WinComponent c) { return(c.Class.ToLower().Equals("static")); }
public static bool Check(WinComponent e) { return(e.Class.ToLower().Contains("button") && !WinceCheckBox.Check(e) && !WinceRadio.Check(e)); }
public static bool Check(WinComponent c) { return(c.Class.ToLower().Contains("listbox")); }
private static Boolean isButton(WinComponent e) { return(e.Class.ToLower().Contains("button") && !isCheckBox(e) && !isRadio(e)); }
private static bool isTextBox(WinComponent e) { return(e.Class.ToLower().Contains("edit")); }
private bool isLabel(WinComponent c) { return(c.Class.ToLower().Equals("static")); }
private bool isContainer(WinComponent c) { return(c.Class.ToLower().Equals("#netcf_agl_base_")); }