Exemplo n.º 1
0
        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();
            }
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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);
        }