private void viewImageMenuItem_Click(object sender, EventArgs e) { TreeNode node = treeView.SelectedNode; if (node != null && node.Tag is UIControlBase) { UIControlBase control = node.Tag as UIControlBase; ImageViewer viewer = new ImageViewer(control.CodePath); viewer.SetImage(control.GetImage()); viewer.ShowDialog(); } }
public override void Body() { ActualResult = QAliber.RemotingModel.TestCaseResult.Passed; UIControlBase c = UIControlBase.FindControlByPath(control); if (!c.Exists) { ActualResult = QAliber.RemotingModel.TestCaseResult.Failed; throw new InvalidOperationException("Control not found"); } c.GetImage().Save(file); }
public override void Body() { ActualResult = QAliber.RemotingModel.TestCaseResult.Passed; UIControlBase c = UIControlBase.FindControlByPath(control); if (!c.Exists) { ActualResult = QAliber.RemotingModel.TestCaseResult.Failed; throw new InvalidOperationException("Control not found"); } Bitmap image = c.GetImage(); Log.Image(image, logDescription); }
public override void Body() { ActualResult = QAliber.RemotingModel.TestCaseResult.Passed; text = string.Empty; UIControlBase c = UIControlBase.FindControlByPath(control); if (!c.Exists) { Logger.Log.Error("Couldn't find control", control); ActualResult = RemotingModel.TestCaseResult.Failed; return; } IText textPattern = c.GetControlInterface <IText>(); if (textPattern != null) { text = textPattern.Text; Logger.Log.Info("Found text property", text); return; } if (c is QAliber.Engine.Controls.Web.WebControl) { text = ((QAliber.Engine.Controls.Web.WebControl)c).InnerText; Logger.Log.Info("Found inner text property of web control", text); return; } Logger.Log.Info("Couldn't find a text property, trying to do optical character recognition"); OCRItem ocrItem = new OCRItem(c.GetImage()); text = ocrItem.ProcessImage(); Logger.Log.Info("OCR result = " + text); }