/// <summary><para>Tests Intact Recognition</para>
        /// <para>definitionName: definition of what you want to recognize, documentName: document name,input: string to search to see if the page recognizes it </para>
        /// </summary>
        public void Recognition(string definitionName, string documentName, string input)
        {
            CreateDocumentForRecognize();
            AddRecognition();
            OpenOrganizer();
            m.Click(By.Name(definitionName));
            window = m.Locate(By.Name(documentName));
            action.DoubleClick(window).Build().Perform();
            Thread.Sleep(2000);

            Print(method, "x: " + Cursor.Position.X + " y: " + Cursor.Position.Y);
            m.Click(By.Id("lblType"));
            Print(method, "x: " + Cursor.Position.X + " y: " + Cursor.Position.Y);
            action.MoveByOffset(470, -40).Click().Build().Perform();
            Print(method, "x: " + Cursor.Position.X + " y: " + Cursor.Position.Y);

            window = m.Locate(By.Name("Find"));
            m.SendKeys(By.Name(""), input, m.Locate(By.Id("txtFind"), window));
            m.Click(By.Id("btnFind"));

            if (m.IsElementPresent(By.Name("Search Text Not Found"), window))
            {
                Print(method, "Search Text not found for Recognize");
                //throw new AssertFailedException("Search Text not found for Recognize");
            }
            m.Click(By.Id("btnCancel"));
            m.Click(By.Id("btnClose"));
        }
Ejemplo n.º 2
0
        public void BatchCreate(TestCaseObject tcase)
        {
            method = MethodBase.GetCurrentMethod().Name;
            Print("Started", method);
            Thread.Sleep(6000);
            pt(i);
            window = m.Locate(By.Id("frmBatchReview"));
            if (m.IsElementPresent(By.Name("Maximize"), window))
            {
                m.Click(By.Name("Maximize"), window);
            }
            pt(i);
            handler.GetActiveWindow();
            pt(i);
            m.Click(By.Id("btnAttribute"), window);
            Thread.Sleep(2000);

            DocumentObject document = new DocumentObject();

            m.Click(By.Id("lblType"));
            document.Type       = "test";
            document.Definition = "def";

            action.MoveByOffset(30, 0).Click().SendKeys(document.Type).Build().Perform();
            m.Click(By.Id("lblType"));
            action.MoveByOffset(30, 27).Click().SendKeys(document.Definition).Build().Perform();

            //adding the metadata values
            m.Click(By.Id("lblType"));

            var date = DateTime.Now.Date;
            var num  = new Random().Next();

            document.MetaData.AddData(date);
            document.MetaData.AddData(num);
            document.MetaData.AddData(document.DocumentId);
            action.MoveByOffset(150, 240).Click().SendKeys(date.ToString()).
            MoveByOffset(0, 20).Click().SendKeys(num.ToString()).
            MoveByOffset(0, 20).Click().SendKeys(document.DocumentId).Build().Perform();

            //add author, expiration date, and summary
            m.Click(By.Id("lblType"));
            document.Author  = "BATCH AUTHOR";
            document.Summary = "BATCH SUMMARY";
            action.MoveByOffset(170, 80).Click().SendKeys("1/1/2050").MoveByOffset(0, 20).Click().SendKeys(document.Author).
            MoveByOffset(0, 40).Click().SendKeys(document.Summary).Build().Perform();

            //save and quit
            m.Click(By.Id("btnSave"));
            m.Click(By.Id("btnClose"));
            pt(i);
            Print("Finished the document addition", method);
            tcase.AddDocument(document);
            new SQLDataHandler().ValidateDocumentAdd(document);
            pt(i);
        }
Ejemplo n.º 3
0
 public void AddToIPack()
 {
     OpenOrganizer();
     window = m.Locate(By.Name("DEFAULT DEF"));
     action.MoveToElement(window).ContextClick().Build().Perform();
     window = m.Locate(By.Name("DropDown"));
     m.Click(By.Name("Add to iPack..."));
     m.Click(By.Name("Yes"));
     m.Click(By.Id("btnNewIpack"));
     Thread.Sleep(1000);
     window = m.Locate(By.Id("frmNewiPack"));
     m.SendKeys(By.Name(""), "test" + new Random().Next().ToString(), window);
     m.Click(By.Id("rbnOK"));
     m.Click(By.Id("btnOK"));
     window = m.Locate(By.Name("&Intact"), m.Locate(By.Name("radMenu1")));
     m.Click(By.Name("iPack"), window);
     //m.Click(By.Id("rbnBatch"));
     Thread.Sleep(1000);
     window = m.Locate(By.Id("frmIntactMain"));
     if (m.IsElementPresent(By.Name("No documents were selected"), window))
     {
         m.Click(By.Name("OK"));
     }
     Thread.Sleep(1000);
     m.Click(By.Id("radButton1"));
     Thread.Sleep(5000);
 }
Ejemplo n.º 4
0
        /// <summary>
        /// This is going to a specified amount of definitions with random name for each blank
        /// </summary>
        public void CreateNewDefinition(int?numberOfDefinitions = 1, string definitionName = "")
        {
            method = MethodBase.GetCurrentMethod().Name;
            Print("Started", method);
            //check if maximized
            window = m.Locate(By.Id("frmIntactMain"));
            if (m.IsElementPresent(By.Name("Maximize"), window))
            {
                m.Click(By.Name("Maximize"), window);
            }
            window = m.Locate(By.Name("radMenu1"), window);
            m.Click(By.Name("&Administration"), window);
            window = m.Locate(By.Name("&Administration"), window);
            m.Click(By.Name("Definitions"), window);

            if (definitionName.Length < 2)
            {
                definitionName = "Test";
            }

            for (int i = 0; i <= numberOfDefinitions; i++)
            {
                var num = new Random().Next().ToString();
                window = m.Locate(By.Id("frmRulesList"), m.Locate(By.Id("frmIntactMain")));
                m.Click(By.Id("btnAdd"), window);
                window = m.Locate(By.Name("Add Definition"));
                Print("Definition name is " + definitionName + num, method);
                foreach (IWebElement element in window.FindElements(By.Name("")))
                {
                    if (element.Enabled == true)
                    {
                        try { element.SendKeys(definitionName + " " + num); } catch (Exception) { }
                    }
                }
                m.Click(By.Name("&Save"), window);
            }

            m.Click(By.Name("&Close"));
            Print("Finished", method);
        }