public void TextMethod_addInvalidProduct()
        {
            readData();

            CommonFunctions.Login(myManager, _username, _password, _Url);

            myManager.ActiveBrowser.Window.Maximize();

            // -- End of Login ---
            ObjMenus menus = new ObjMenus(myManager);

            HtmlAnchor data = menus.Datalink.As <HtmlAnchor>();

            data.MouseHover();

            myManager.ActiveBrowser.RefreshDomTree();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            HtmlAnchor products = menus.productlink.As <HtmlAnchor>();

            products.MouseClick();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            ObjProduct objproduct = new ObjProduct(myManager);

            Element addproductbutton = objproduct.addproductbtn;

            myManager.ActiveBrowser.Actions.Click(addproductbutton);

            addinvalidprod();
        }
Example #2
0
        public void TestMethod_batchEditVariant()
        {
            readData();

            CommonFunctions.Login(myManager, _username, _password, _Url);

            myManager.ActiveBrowser.Window.Maximize();

            // -- End of Login ---
            ObjMenus menus = new ObjMenus(myManager);

            HtmlAnchor data = menus.Datalink.As <HtmlAnchor>();

            data.MouseHover();

            myManager.ActiveBrowser.RefreshDomTree();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            HtmlAnchor products = menus.productlink.As <HtmlAnchor>();

            products.MouseClick();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            ObjEditVariant objeditvariant = new ObjEditVariant(myManager);

            HtmlInputText search = objeditvariant.searchtoedit.As <HtmlInputText>();

            search.Text = _searchtobatchedit;
        }
Example #3
0
        public void TestMethod_deleteArticlePopup()

        {
            readData();

            CommonFunctions.Login(myManager, _username, _password, _Url);

            myManager.ActiveBrowser.Window.Maximize();

            // -- End of Login ---

            ObjMenus menus = new ObjMenus(myManager);

            HtmlAnchor data = menus.Datalink.As <HtmlAnchor>();

            data.MouseHover();

            myManager.ActiveBrowser.RefreshDomTree();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            HtmlAnchor articles = menus.Articlelink.As <HtmlAnchor>();

            articles.MouseClick();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();


            ObjDeleteArticle objdeletearticle = new ObjDeleteArticle(myManager);

            HtmlInputCheckBox rowcheck1 = objdeletearticle.deleterowcheck1.As <HtmlInputCheckBox>();

            rowcheck1.Check(true);

            HtmlButton deletebutton = objdeletearticle.deletebtn.As <HtmlButton>();

            deletebutton.Click();

            // Verify Confirmation popup

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            Element verifypopuptitle = objdeletearticle.deletepopuptitle;

            Assert.IsTrue(verifypopuptitle.InnerText.Contains("Delete Articles"));

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            Element verifyconfirmation = objdeletearticle.confirmation1;

            Assert.IsTrue(verifyconfirmation.InnerText.Contains("Are you sure you want to delete the selected article(s)?"));

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();
        }
Example #4
0
        public void TestMethod_addStandardActCancel()
        {
            readData();

            CommonFunctions.Login(myManager, _username, _password, _Url);

            myManager.ActiveBrowser.Window.Maximize();

            // -- End of Login ---
            ObjMenus menus = new ObjMenus(myManager);

            HtmlAnchor process = menus.processlink.As <HtmlAnchor>();

            process.MouseHover();

            myManager.ActiveBrowser.RefreshDomTree();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            HtmlAnchor standardactivity = menus.standardactivitylink.As <HtmlAnchor>();

            standardactivity.MouseClick();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            ObjAddStandardActivity objaddstandardactivity = new ObjAddStandardActivity(myManager);
            ObjStandardActivity    objstandardactivity    = new ObjStandardActivity(myManager);


            Element addbutton = objaddstandardactivity.addactivitybtn;

            myManager.ActiveBrowser.Actions.Click(addbutton);

            Thread.Sleep(4000);
            myManager.ActiveBrowser.RefreshDomTree();

            Element verifypage = objaddstandardactivity.addpagetitle;

            Assert.IsTrue(verifypage.InnerText.Contains("Activity Details"));

            Thread.Sleep(2000);

            Element cancelbutton = objaddstandardactivity.cancelbtn;

            myManager.ActiveBrowser.Actions.Click(cancelbutton);

            Thread.Sleep(4000);
            myManager.ActiveBrowser.RefreshDomTree();

            Element tabletitle = objstandardactivity.standardactivitytblheading;

            Assert.IsTrue(tabletitle.InnerText.Contains("Standard Activity"));

            Thread.Sleep(3000);
            myManager.ActiveBrowser.RefreshDomTree();
        }
Example #5
0
        public void TestMethod_addVarintBackbtn()
        {
            readData();

            CommonFunctions.Login(myManager, _username, _password, _Url);

            myManager.ActiveBrowser.Window.Maximize();

            // -- End of Login ---

            ObjMenus menus = new ObjMenus(myManager);

            HtmlAnchor data = menus.Datalink.As <HtmlAnchor>();

            data.MouseHover();

            myManager.ActiveBrowser.RefreshDomTree();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            HtmlAnchor products = menus.productlink.As <HtmlAnchor>();

            products.MouseClick();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            ObjAddVariant objaddvariant = new ObjAddVariant(myManager);

            Element addbutton = objaddvariant.addvariantbtn;

            myManager.ActiveBrowser.Actions.Click(addbutton);

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            Element verifypage = objaddvariant.createpagetitle;

            Assert.IsTrue(verifypage.InnerText.Contains("Create New Variant"));

            Thread.Sleep(4000);
            myManager.ActiveBrowser.RefreshDomTree();

            Element backbutton = objaddvariant.backbtn;

            myManager.ActiveBrowser.Actions.Click(backbutton);

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            Element verifyredirect = objaddvariant.createpagetitle;

            Assert.IsTrue(verifyredirect.InnerText.Contains("Variant Strings"));

            Thread.Sleep(3000);
            myManager.ActiveBrowser.RefreshDomTree();
        }
        /// <summary>
        /// Verifies What is this link and information
        /// </summary>
        public void VerifyWhatsThis()
        {
            ActiveBrowser.RefreshDomTree();
            HtmlAnchor whatsThisLink = this.EM.Search.SearchBoxWidgetEditScreen.WhatsThisLink;

            whatsThisLink.AssertIsPresent("What's this link");
            whatsThisLink.MouseHover();
            this.EM.Search.SearchBoxWidgetEditScreen.WhatsThisInfo.AssertIsPresent("What's this div");
        }
        public void TestMethod_clickonDeleteproductbtn()
        {
            readData();

            CommonFunctions.Login(myManager, _username, _password, _Url);

            myManager.ActiveBrowser.Window.Maximize();

            // -- End of Login ---
            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            ObjMenus menus = new ObjMenus(myManager);

            HtmlAnchor data = menus.Datalink.As <HtmlAnchor>();

            data.MouseHover();

            myManager.ActiveBrowser.RefreshDomTree();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            HtmlAnchor products = menus.productlink.As <HtmlAnchor>();

            products.MouseClick();


            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            Element bottomcontent = myManager.ActiveBrowser.Find.ByXPath("//*[@id='body']/div/div/div[4]/table/thead/tr[1]/th[1]/button");

            myManager.ActiveBrowser.Actions.ScrollToVisible(bottomcontent);

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            ObjDeleteProduct objdeleteproduct = new ObjDeleteProduct(myManager);

            // click on Delete button
            Element deletebutton = objdeleteproduct.deleteproductbtn;

            myManager.ActiveBrowser.Actions.Click(deletebutton);

            Thread.Sleep(4000);
            myManager.ActiveBrowser.RefreshDomTree();

            Element verifymsg = objdeleteproduct.cickondeletebtn;

            Assert.IsTrue(verifymsg.InnerText.Contains("Please select at least one product"));

            Thread.Sleep(3000);
            myManager.ActiveBrowser.RefreshDomTree();
        }
        public void TextMethod_addProductMandatoryFields()
        {
            readData();

            CommonFunctions.Login(myManager, _username, _password, _Url);

            myManager.ActiveBrowser.Window.Maximize();

            // -- End of Login ---
            ObjMenus menus = new ObjMenus(myManager);

            HtmlAnchor data = menus.Datalink.As <HtmlAnchor>();

            data.MouseHover();

            myManager.ActiveBrowser.RefreshDomTree();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            HtmlAnchor products = menus.productlink.As <HtmlAnchor>();

            products.MouseClick();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            ObjProduct objproduct = new ObjProduct(myManager);

            Element addproductbutton = objproduct.addproductbtn;

            myManager.ActiveBrowser.Actions.Click(addproductbutton);

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            HtmlInputText productnm = objproduct.nametxt.As <HtmlInputText>();
            HtmlInputText variant   = objproduct.varianttxt.As <HtmlInputText>();

            productnm.Text = _prodnamemandatory;
            variant.Text   = _variantmandatory;

            Element prodname = objproduct.prodnamemandatorymsg;

            Assert.IsTrue(prodname.InnerText.Contains("Product Name is mandatory"));

            Element variantname = objproduct.variantmandatorymsg;

            Assert.IsTrue(variantname.InnerText.Contains("Variant String is mandatory"));

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();
        }
        public void TestMethod_AddProductPage()
        {
            readData();

            CommonFunctions.Login(myManager, _username, _password, _Url);

            myManager.ActiveBrowser.Window.Maximize();

            // -- End of Login ---
            ObjMenus menus = new ObjMenus(myManager);

            HtmlAnchor data = menus.Datalink.As <HtmlAnchor>();

            data.MouseHover();

            myManager.ActiveBrowser.RefreshDomTree();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            HtmlAnchor products = menus.productlink.As <HtmlAnchor>();

            products.MouseClick();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            ObjProduct objproduct = new ObjProduct(myManager);

            Element addproductbutton = objproduct.addproductbtn;

            myManager.ActiveBrowser.Actions.Click(addproductbutton);

            // Verify Page contents

            Element pgtitle = objproduct.addpgtitle;

            Assert.IsTrue(pgtitle.InnerText.Contains("Create New Product"));

            Element namelbl = objproduct.namelabel;

            Assert.IsTrue(namelbl.InnerText.Contains("Product Name *"));

            Element variantlbl = objproduct.variantlabel;

            Assert.IsTrue(variantlbl.InnerText.Contains("Variant String *"));

            Element freetxtlbl = objproduct.freetextlabel;

            Assert.IsTrue(freetxtlbl.InnerText.Contains("Free Text"));

            Thread.Sleep(1000);
        }
Example #10
0
        public void TestMethod_AddProduct()
        {
            readData();

            CommonFunctions.Login(myManager, _username, _password, _Url);

            myManager.ActiveBrowser.Window.Maximize();

            // -- End of Login ---
            ObjMenus menus = new ObjMenus(myManager);

            HtmlAnchor data = menus.Datalink.As <HtmlAnchor>();

            data.MouseHover();

            myManager.ActiveBrowser.RefreshDomTree();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            HtmlAnchor products = menus.productlink.As <HtmlAnchor>();

            products.MouseClick();

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            Element bottomcontent = myManager.ActiveBrowser.Find.ByXPath("//*[@id='body']/div/div/div[4]/table/thead/tr[1]/th[1]/button/span");

            myManager.ActiveBrowser.Actions.ScrollToVisible(bottomcontent);

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            ObjProduct objproduct = new ObjProduct(myManager);

            Element addproductbutton = objproduct.addproductbtn;

            myManager.ActiveBrowser.Actions.Click(addproductbutton);

            addproduct();

            //Thread.Sleep(2000);
            //myManager.ActiveBrowser.RefreshDomTree();

            //verifyproduct();

            Thread.Sleep(3000);
            myManager.ActiveBrowser.RefreshDomTree();
        }
Example #11
0
        public void TestMethod_CreateAUG()
        {
            readData();

            CommonFunctions.Login(myManager, _username, _password, _Url);

            myManager.ActiveBrowser.Window.Maximize();

            // -- End of Login ---

            HtmlAnchor data = myManager.ActiveBrowser.Find.ByXPath("//*[@id='header']/div/nav/div[2]/ul/li[3]/a").As <HtmlAnchor>();

            data.MouseHover();

            myManager.ActiveBrowser.RefreshDomTree();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            HtmlAnchor articles = myManager.ActiveBrowser.Find.ByXPath("//*[@id='header']/div/nav/div[2]/ul/li[3]/ul/li[2]/a").As <HtmlAnchor>();

            articles.MouseClick();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            // Serch Article
            HtmlInputText articleno;

            articleno      = myManager.ActiveBrowser.Find.ByXPath("//*[@id='body']/div/div/div[3]/table/thead/tr[2]/th[3]/input").As <HtmlInputText>();
            articleno.Text = _articlenumber;

            myManager.Desktop.Mouse.Click(MouseClickType.LeftClick, articleno.GetRectangle());
            myManager.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.Enter);

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            // click article name
            HtmlAnchor artname;

            artname = myManager.ActiveBrowser.Find.ByXPath("//*[@id='body']/div/div/div[3]/table/tbody/tr/td[4]/a").As <HtmlAnchor>();
            artname.MouseClick();

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();
        }
Example #12
0
        public void TestMethod_AddProductBackbtn()
        {
            readData();

            CommonFunctions.Login(myManager, _username, _password, _Url);

            myManager.ActiveBrowser.Window.Maximize();

            // -- End of Login ---
            ObjMenus menus = new ObjMenus(myManager);

            HtmlAnchor data = menus.Datalink.As <HtmlAnchor>();

            data.MouseHover();

            myManager.ActiveBrowser.RefreshDomTree();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            HtmlAnchor products = menus.productlink.As <HtmlAnchor>();

            products.MouseClick();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            ObjProduct objproduct = new ObjProduct(myManager);

            Element addproductbutton = objproduct.addproductbtn;

            myManager.ActiveBrowser.Actions.Click(addproductbutton);

            Thread.Sleep(4000);

            Element back = objproduct.backbtn;

            myManager.ActiveBrowser.Actions.Click(back);

            Thread.Sleep(1000);

            Element pagetitle = objproduct.producttabletitle;

            Assert.IsTrue(pagetitle.InnerText.Contains("Products"));
        }
Example #13
0
        public void TestMethod_disableButton()
        {
            readData();

            CommonFunctions.Login(myManager, _username, _password, _url);

            myManager.ActiveBrowser.Window.Maximize();

            // -- End of Login ---

            HtmlAnchor data = myManager.ActiveBrowser.Find.ByXPath("//*[@id='header']/div/nav/div[2]/ul/li[3]/a").As <HtmlAnchor>();

            data.MouseHover();

            myManager.ActiveBrowser.RefreshDomTree();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            HtmlAnchor articles = myManager.ActiveBrowser.Find.ByXPath("//*[@id='header']/div/nav/div[2]/ul/li[3]/ul/li[2]/a").As <HtmlAnchor>();

            articles.MouseClick();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            Element addArticlebtn;

            addArticlebtn = myManager.ActiveBrowser.Find.ByXPath("//*[@id='body']/div/div/p[1]/a");
            myManager.ActiveBrowser.Actions.Click(addArticlebtn);

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            // check button disable
            Element savebtn;

            savebtn = myManager.ActiveBrowser.Find.ByXPath("//*[@id='body']/div/div/div[2]/div/div/div/form/div[5]/div/div[2]/div[1]/input");
            string disabledatt = savebtn.Attributes[0].ToString();
        }
Example #14
0
        public void TestMethod_AddArticle()
        {
            readData();

            CommonFunctions.Login(myManager, _username, _password, _Url);

            myManager.ActiveBrowser.Window.Maximize();

            // -- End of Login ---
            ObjMenus menus = new ObjMenus(myManager);

            HtmlAnchor data = menus.Datalink.As <HtmlAnchor>();

            data.MouseHover();

            myManager.ActiveBrowser.RefreshDomTree();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            HtmlAnchor articles = menus.Articlelink.As <HtmlAnchor>();

            articles.MouseClick();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            ObjArticle objarticle = new ObjArticle(myManager);

            Element addArticlebutton = objarticle.addArticlebtn;

            myManager.ActiveBrowser.Actions.Click(addArticlebutton);

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();


            add();
            //verifyarticle();
        }
        public void TestMethod_batchEditProdPage()
        {
            readData();

            CommonFunctions.Login(myManager, _username, _password, _Url);

            myManager.ActiveBrowser.Window.Maximize();

            // -- End of Login ---

            ObjMenus menus = new ObjMenus(myManager);

            HtmlAnchor data = menus.Datalink.As <HtmlAnchor>();

            data.MouseHover();

            myManager.ActiveBrowser.RefreshDomTree();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            HtmlAnchor products = menus.productlink.As <HtmlAnchor>();

            products.MouseClick();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            ObjProduct objproduct = new ObjProduct(myManager);

            HtmlInputText search = objproduct.namesearch.As <HtmlInputText>();

            search.Text = _searchproduct;

            myManager.Desktop.Mouse.Click(MouseClickType.LeftClick, search.GetRectangle());
            myManager.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.Enter);

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            // Select multiple Products

            HtmlTable producttbl = objproduct.producttable.As <HtmlTable>();

            if (producttbl.BodyRows.Count > 0)
            {
                HtmlInputCheckBox firstrowcheck = objproduct.row1.As <HtmlInputCheckBox>();
                firstrowcheck.Check(true);

                HtmlInputCheckBox secondrowcheck = objproduct.row2.As <HtmlInputCheckBox>();
                secondrowcheck.Check(true);

                // click on Edit button
                HtmlButton editbtn = objproduct.editproductbtn.As <HtmlButton>();
                editbtn.Click();
            }
            else
            {
                throw new Exception("no matching data to edit");
            }

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            Element pgverify = objproduct.batcheditpgtitle;

            Assert.IsTrue(pgverify.InnerText.Contains("Batch Edit Products"));

            Element variant = objproduct.variantstringlabel;

            Assert.IsTrue(variant.InnerText.Contains("Variant String"));

            Element freetxt = objproduct.freetextlabel;

            Assert.IsTrue(freetxt.InnerText.Contains("Free Text"));

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();
        }
        public void TestMethod_addStandardactMandatory()
        {
            readData();

            CommonFunctions.Login(myManager, _username, _password, _Url);

            myManager.ActiveBrowser.Window.Maximize();

            // -- End of Login ---
            ObjMenus menus = new ObjMenus(myManager);

            HtmlAnchor process = menus.processlink.As <HtmlAnchor>();

            process.MouseHover();

            myManager.ActiveBrowser.RefreshDomTree();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            HtmlAnchor standardactivity = menus.standardactivitylink.As <HtmlAnchor>();

            standardactivity.MouseClick();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            ObjAddStandardActivity objaddstandardactivity = new ObjAddStandardActivity(myManager);

            Element addbutton = objaddstandardactivity.addactivitybtn;

            myManager.ActiveBrowser.Actions.Click(addbutton);

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            Element verifypage = objaddstandardactivity.addpagetitle;

            Assert.IsTrue(verifypage.InnerText.Contains("Activity Details"));

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            Element savebutton = objaddstandardactivity.savebtn;

            myManager.ActiveBrowser.Actions.Click(savebutton);

            /*
             * HtmlInputText name = objaddstandardactivity.standactivitynametxt.As<HtmlInputText>();
             * HtmlInputText variant = objaddstandardactivity.varianttxt.As<HtmlInputText>();
             *
             * name.Text = _namemandatory;
             * variant.Text = _variantmandatory;
             */

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            Element mandatorymsg = objaddstandardactivity.mandatoryMsg;

            Assert.IsTrue(mandatorymsg.InnerText.Contains("Please fill all mandatory fields"));

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            Element namemandatory = objaddstandardactivity.namemandatory;

            Assert.IsTrue(namemandatory.InnerText.Contains("Activity name is mandatory"));

            Element variantmandatory = objaddstandardactivity.variantmandatory;

            Assert.IsTrue(variantmandatory.InnerText.Contains("Variant string is mandatory"));

            Thread.Sleep(3000);
            myManager.ActiveBrowser.RefreshDomTree();
        }
        public void TestMethod_addStandardActivityPage()
        {
            readData();

            CommonFunctions.Login(myManager, _username, _password, _Url);

            myManager.ActiveBrowser.Window.Maximize();

            // -- End of Login ---
            ObjMenus menus = new ObjMenus(myManager);

            HtmlAnchor process = menus.processlink.As <HtmlAnchor>();

            process.MouseHover();

            myManager.ActiveBrowser.RefreshDomTree();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            HtmlAnchor standardactivity = menus.standardactivitylink.As <HtmlAnchor>();

            standardactivity.MouseClick();

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            ObjAddStandardActivity objaddstandardactivity = new ObjAddStandardActivity(myManager);

            Element addbutton = objaddstandardactivity.addactivitybtn;

            myManager.ActiveBrowser.Actions.Click(addbutton);

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            Element verifypage = objaddstandardactivity.addpagetitle;

            Assert.IsTrue(verifypage.InnerText.Contains("Activity Details"));

            Element namelbl = objaddstandardactivity.namelabel;

            Assert.IsTrue(namelbl.InnerText.Contains("Name *"));

            Element freetxtlbl = objaddstandardactivity.freetextlabel;

            Assert.IsTrue(freetxtlbl.InnerText.Contains("Free Text"));

            Element grouplbl = objaddstandardactivity.grouplabel;

            Assert.IsTrue(grouplbl.InnerText.Contains("Group"));

            Element poslbl = objaddstandardactivity.poslabel;

            Assert.IsTrue(poslbl.InnerText.Contains("Pos"));

            Element postlbl = objaddstandardactivity.postlabel;

            Assert.IsTrue(postlbl.InnerText.Contains("Post"));

            Element oplbl = objaddstandardactivity.oplabel;

            Assert.IsTrue(oplbl.InnerText.Contains("Op"));

            Element activitytypelbl = objaddstandardactivity.activitytypelabel;

            Assert.IsTrue(activitytypelbl.InnerText.Contains("Activity Type"));

            Element weslbl = objaddstandardactivity.weslabel;

            Assert.IsTrue(weslbl.InnerText.Contains("Wes"));

            Element variantlbl = objaddstandardactivity.variantlabel;

            Assert.IsTrue(variantlbl.InnerText.Contains("Variant String *"));

            Element memolbl = objaddstandardactivity.memolabel;

            Assert.IsTrue(memolbl.InnerText.Contains("Memo"));

            Element additionalmemolbl = objaddstandardactivity.additionalmemolabel;

            Assert.IsTrue(additionalmemolbl.InnerText.Contains("Additional Memo"));

            Thread.Sleep(3000);
            myManager.ActiveBrowser.RefreshDomTree();
        }
        public void TestMethod_ExistingEditArticle()
        {
            readData();

            CommonFunctions.Login(myManager, _username, _password, _Url);

            myManager.ActiveBrowser.Window.Maximize();

            // -- End of Login ---

            HtmlAnchor data = myManager.ActiveBrowser.Find.ByXPath("//*[@id='header']/div/nav/div[2]/ul/li[3]/a").As <HtmlAnchor>();

            data.MouseHover();

            myManager.ActiveBrowser.RefreshDomTree();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            HtmlAnchor articles = myManager.ActiveBrowser.Find.ByXPath("//*[@id='header']/div/nav/div[2]/ul/li[3]/ul/li[2]/a").As <HtmlAnchor>();

            articles.MouseClick();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            // Search Article to Edit

            HtmlInputText articleno;

            articleno      = myManager.ActiveBrowser.Find.ByXPath("//*[@id='body']/div/div/div[3]/table/thead/tr[2]/th[3]/input").As <HtmlInputText>();
            articleno.Text = _editarticle;

            myManager.Desktop.Mouse.Click(MouseClickType.LeftClick, articleno.GetRectangle());
            myManager.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.Enter);

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            // Select one Article to Edit
            HtmlInputCheckBox firstrowcheck;



            HtmlTable usertable = myManager.ActiveBrowser.Find.ByXPath("//*[@id='body']/div/div/div[3]/table").As <HtmlTable>();

            if (usertable.BodyRows.Count > 0)
            {
                firstrowcheck = myManager.ActiveBrowser.Find.ByXPath("//*[@id='body']/div/div/div[3]/table/tbody/tr[1]/td[1]/input").As <HtmlInputCheckBox>();
                firstrowcheck.Check(true);


                // click on Edit Article button
                Element editbutton2;
                editbutton2 = myManager.ActiveBrowser.Find.ByXPath("//*[@id='body']/div/div/p[2]/button");
                myManager.ActiveBrowser.Actions.Click(editbutton2);
            }
            else
            {
                throw new Exception("no matching data to edit");
            }

            //CommonFunctionAddArticle.Addaticle(myManager,_Url, _articlenumber, _articlename, _amount, _articletype, true);
        }
Example #19
0
        public void TestMethod_DeleteVariant()
        {
            readData();

            CommonFunctions.Login(myManager, _username, _password, _Url);

            myManager.ActiveBrowser.Window.Maximize();

            // -- End of Login ---
            ObjMenus menus = new ObjMenus(myManager);

            HtmlAnchor data = menus.Datalink.As <HtmlAnchor>();

            data.MouseHover();

            myManager.ActiveBrowser.RefreshDomTree();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            HtmlAnchor products = menus.productlink.As <HtmlAnchor>();

            products.MouseClick();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            ObjDeleteVariant objdeletevariant = new ObjDeleteVariant(myManager);

            // Search Variant to DELETE

            HtmlInputText variant = objdeletevariant.searchvariant.As <HtmlInputText>();

            variant.Text = _searchtodelete;

            myManager.Desktop.Mouse.Click(MouseClickType.LeftClick, variant.GetRectangle());
            myManager.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.Enter);

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            ObjVariant objvariant = new ObjVariant(myManager);

            // Select one Variant to Delete
            HtmlInputCheckBox row1;

            HtmlTable varianttbl = objvariant.varianttable.As <HtmlTable>();

            row1 = objdeletevariant.rowcheck1.As <HtmlInputCheckBox>();
            row1.Check(true);

            // click on Delete button
            Element deletebutton = objdeletevariant.deletevariantbtn;

            myManager.ActiveBrowser.Actions.Click(deletebutton);

            Thread.Sleep(4000);
            myManager.ActiveBrowser.RefreshDomTree();

            verifycontent();

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            // Variant which does not contain artifacts
            // Clck on YES
            Element yesbutton = objdeletevariant.yesbtn;

            myManager.ActiveBrowser.Actions.Click(yesbutton);

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            Element verifysuccess = objdeletevariant.deletesuccessmsg;

            Assert.IsTrue(verifysuccess.InnerText.Contains(""));

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            Element verifyredirect = objvariant.varianttabletitle;

            Assert.IsTrue(verifyredirect.InnerText.Contains(""));

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            verifydelete();

            Thread.Sleep(3000);
            myManager.ActiveBrowser.RefreshDomTree();

            // End of YES

            /*
             * // Click on NO
             * Element nobutton = objdeletevariant.nobtn;
             * myManager.ActiveBrowser.Actions.Click(nobutton);
             *
             * Element verifypage = objvariant.varianttabletitle;
             * Assert.IsTrue(verifypage.InnerText.Contains(""));
             *
             * Thread.Sleep(2000);
             * myManager.ActiveBrowser.RefreshDomTree();
             */
        }
Example #20
0
        public void TextMethod_productPage()
        {
            readData();

            CommonFunctions.Login(myManager, _username, _password, _Url);

            myManager.ActiveBrowser.Window.Maximize();

            // -- End of Login ---
            ObjMenus menus = new ObjMenus(myManager);

            HtmlAnchor data = menus.Datalink.As <HtmlAnchor>();

            data.MouseHover();

            myManager.ActiveBrowser.RefreshDomTree();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            HtmlAnchor products = menus.productlink.As <HtmlAnchor>();

            products.MouseClick();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            ObjProduct objproduct = new ObjProduct(myManager);

            // Verify buttons

            Element add = objproduct.addproductbtn;

            Assert.IsTrue(add.InnerText.Contains("Add Product"));

            Element edit = objproduct.editproductbtn;

            Assert.IsTrue(edit.InnerText.Contains("Edit Product/s"));

            Element savefilter = objproduct.savefilterbtn;

            Assert.IsTrue(savefilter.InnerText.Contains("Save"));

            Element delete = objproduct.deleteproductbtn;

            Assert.IsTrue(delete.InnerText.Contains("Delete Product/s"));

            Element export = objproduct.exportproductbtn;

            Assert.IsTrue(export.InnerText.Contains("Excel Export"));


            // Verify table Headings
            Element title = objproduct.producttabletitle;

            Assert.IsTrue(title.InnerText.Contains("Products"));

            Element id = objproduct.prodidheading;

            Assert.IsTrue(id.InnerText.Contains("ID"));

            Element name = objproduct.prodnameheading;

            Assert.IsTrue(name.InnerText.Contains("Name"));

            Element variant = objproduct.prodvariantheading;

            Assert.IsTrue(variant.InnerText.Contains("Variant String"));

            Element freetxt = objproduct.prodfreetxtheading;

            Assert.IsTrue(freetxt.InnerText.Contains("Free Text"));

            Element created = objproduct.prodcreatedheading;

            Assert.IsTrue(created.InnerText.Contains("Created"));

            Element updated = objproduct.produpdatedheading;

            Assert.IsTrue(updated.InnerText.Contains("Updated"));
        }
Example #21
0
        public void TestMethod_singleDeleteProduct()
        {
            readData();

            CommonFunctions.Login(myManager, _username, _password, _Url);

            myManager.ActiveBrowser.Window.Maximize();

            // -- End of Login ---

            ObjMenus menus = new ObjMenus(myManager);

            HtmlAnchor data = menus.Datalink.As <HtmlAnchor>();

            data.MouseHover();

            myManager.ActiveBrowser.RefreshDomTree();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            HtmlAnchor products = menus.productlink.As <HtmlAnchor>();

            products.MouseClick();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            ObjDeleteProduct objdeleteproduct = new ObjDeleteProduct(myManager);

            // Search Product to DELETE

            HtmlInputText product = objdeleteproduct.searchproduct.As <HtmlInputText>();

            product.Text = _searchtodelete;

            myManager.Desktop.Mouse.Click(MouseClickType.LeftClick, product.GetRectangle());
            myManager.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.Enter);

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            // Select one Product to Delete
            HtmlInputCheckBox row1;

            HtmlTable producttbl = objdeleteproduct.producttable.As <HtmlTable>();

            row1 = objdeleteproduct.rowselect1.As <HtmlInputCheckBox>();
            row1.Check(true);

            // click on Delete button
            Element deletebutton = objdeleteproduct.deleteproductbtn;

            myManager.ActiveBrowser.Actions.Click(deletebutton);

            Thread.Sleep(4000);
            myManager.ActiveBrowser.RefreshDomTree();

            Element verifymsg = objdeleteproduct.deleteconfirmationmsg;

            Assert.IsTrue(verifymsg.InnerText.Contains("Are you sure you want to delete the selected product(s)?"));

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            // If YES
            // Click on YES
            Element yesbutton = objdeleteproduct.yesbtn;

            myManager.ActiveBrowser.Actions.Click(yesbutton);

            Thread.Sleep(3000);
            myManager.ActiveBrowser.RefreshDomTree();

            Element verifydelete = objdeleteproduct.producttabletitle;

            Assert.IsTrue(verifydelete.InnerText.Contains("Selected product/s have been deleted successfully."));

            Thread.Sleep(3000);
            myManager.ActiveBrowser.RefreshDomTree();

            Element verifyredirect = objdeleteproduct.producttabletitle;

            Assert.IsTrue(verifyredirect.InnerText.Contains("Products"));

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            /*
             * // Click on NO
             * Element nobutton = objdeleteproduct.nobtn;
             * myManager.ActiveBrowser.Actions.Click(nobutton);
             *
             * Element verifypage = objdeleteproduct.producttabletitle;
             * Assert.IsTrue(verifypage.InnerText.Contains("Products"));
             *
             * Thread.Sleep(2000);
             * myManager.ActiveBrowser.RefreshDomTree();
             */

            verifysingledelete();

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            //verifysoftdelete();

            //Thread.Sleep(3000);
            //myManager.ActiveBrowser.RefreshDomTree();
        }
        public void TestMethod_deleteArtifactconnectedVariant()
        {
            readData();

            CommonFunctions.Login(myManager, _username, _password, _Url);

            myManager.ActiveBrowser.Window.Maximize();

            // -- End of Login ---

            ObjMenus menus = new ObjMenus(myManager);

            HtmlAnchor data = menus.Datalink.As <HtmlAnchor>();

            data.MouseHover();

            myManager.ActiveBrowser.RefreshDomTree();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            HtmlAnchor products = menus.productlink.As <HtmlAnchor>();

            products.MouseClick();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            ObjDeleteVariant objdeletevariant = new ObjDeleteVariant(myManager);

            // Search Variant to DELETE

            HtmlInputText variant = objdeletevariant.searchvariant.As <HtmlInputText>();

            variant.Text = _searchtodelete;

            myManager.Desktop.Mouse.Click(MouseClickType.LeftClick, variant.GetRectangle());
            myManager.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.Enter);

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            ObjVariant objvariant = new ObjVariant(myManager);

            // Select one Variant to Delete
            HtmlInputCheckBox row1;

            HtmlTable varianttbl = objvariant.varianttable.As <HtmlTable>();

            row1 = objdeletevariant.rowcheck1.As <HtmlInputCheckBox>();
            row1.Check(true);

            // click on Delete button
            Element deletebutton = objdeletevariant.deletevariantbtn;

            myManager.ActiveBrowser.Actions.Click(deletebutton);

            Thread.Sleep(4000);
            myManager.ActiveBrowser.RefreshDomTree();

            verifydeleteartifact();

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();
        }
        public void TestMethod_ViewArticlePage()
        {
            readData();

            CommonFunctions.Login(myManager, _username, _password, _Url);

            myManager.ActiveBrowser.Window.Maximize();

            // -- End of Login ---

            ObjMenus menus = new ObjMenus(myManager);

            HtmlAnchor data = menus.Datalink.As <HtmlAnchor>();

            data.MouseHover();

            myManager.ActiveBrowser.RefreshDomTree();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            HtmlAnchor articles = menus.Articlelink.As <HtmlAnchor>();

            articles.MouseClick();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            ObjArticle objarticle = new ObjArticle(myManager);

            Element verifypagetitle = objarticle.articlepagetitle;

            Assert.AreEqual(verifypagetitle.InnerText, "Article");

            Thread.Sleep(1000);

            // --- Verify Contents of View Article Page ---
            // - Verify Button Names -
            Element VerifyaddArticlebtn = objarticle.addArticlebtn;

            Assert.AreEqual(VerifyaddArticlebtn.InnerText, "Add Article");

            Element VerifyEditArticlebtn = objarticle.editArticlebtn;

            Assert.IsTrue(VerifyEditArticlebtn.InnerText.Contains("Edit Article/s"));

            Element VerifySaveFilterbtn = objarticle.filterArticlebtn;

            Assert.IsTrue(VerifySaveFilterbtn.InnerText.Contains("Save Filters"));

            Element VerifyDeletebtn = objarticle.deleteArticlebtn;

            Assert.IsTrue(VerifyDeletebtn.InnerText.Contains("Delete Articles"));

            Element VerifyExportbtn = objarticle.exportArticlebtn;

            Assert.IsTrue(VerifyExportbtn.InnerText.Contains("Export"));

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            // Verify table heading names

            Element idheadingname = objarticle.idheading;

            Assert.IsTrue(idheadingname.InnerText.Contains("Id"));

            Element numheadingname = objarticle.numberheading;

            Assert.IsTrue(numheadingname.InnerText.Contains("Article Number"));

            Element nameheadingname = objarticle.nameheading;

            Assert.IsTrue(nameheadingname.InnerText.Contains("Name"));

            Element typeheadingname = objarticle.typeheading;

            Assert.IsTrue(typeheadingname.InnerText.Contains("Type"));

            Element amountheadingname = objarticle.amountheading;

            Assert.IsTrue(amountheadingname.InnerText.Contains("Amount"));

            Element fromcoheadingname = objarticle.fromcoheading;

            Assert.IsTrue(fromcoheadingname.InnerText.Contains("From CO"));

            Element tocoheadingname = objarticle.tocoheading;

            Assert.IsTrue(tocoheadingname.InnerText.Contains("To CO"));

            Element createdateheadingname = objarticle.typeheading;

            Assert.IsTrue(typeheadingname.InnerText.Contains("Create Date"));

            Element updatedateheadingname = objarticle.updatedateheading;

            Assert.IsTrue(updatedateheadingname.InnerText.Contains("Update Date"));

            Thread.Sleep(1000);
        }
        public void TestMethod_BatchEditArticle()
        {
            readData();

            CommonFunctions.Login(myManager, _username, _password, _Url);

            myManager.ActiveBrowser.Window.Maximize();

            // -- End of Login ---

            ObjMenus menus = new ObjMenus(myManager);

            HtmlAnchor data = menus.Datalink.As <HtmlAnchor>();

            data.MouseHover();

            myManager.ActiveBrowser.RefreshDomTree();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            HtmlAnchor articles = menus.Articlelink.As <HtmlAnchor>();

            articles.MouseClick();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            ObjArticle objarticle = new ObjArticle(myManager);

            // Search Articles to Edit

            HtmlInputText searcharticleno = objarticle.searcharticlenum.As <HtmlInputText>();

            searcharticleno.Text = _editarticle;

            myManager.Desktop.Mouse.Click(MouseClickType.LeftClick, searcharticleno.GetRectangle());
            myManager.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.Enter);

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            // Select  Articles to delete

            HtmlTable articletble = objarticle.articletable.As <HtmlTable>();

            if (articletble.BodyRows.Count > 0)
            {
                HtmlInputCheckBox firstrowcheck = objarticle.row1.As <HtmlInputCheckBox>();
                firstrowcheck.Check(true);

                HtmlInputCheckBox secondrowcheck = objarticle.row2.As <HtmlInputCheckBox>();
                secondrowcheck.Check(true);

                // click on Edit Article button
                Element editbutton = objarticle.editArticlebtn;
                myManager.ActiveBrowser.Actions.Click(editbutton);
            }
            else
            {
                throw new Exception("no matching data to edit");
            }

            updateArticle();
        }
Example #25
0
        public void TestMethod_variantPage()
        {
            readData();

            CommonFunctions.Login(myManager, _username, _password, _Url);

            myManager.ActiveBrowser.Window.Maximize();

            // -- End of Login ---
            ObjMenus menus = new ObjMenus(myManager);

            HtmlAnchor data = menus.Datalink.As <HtmlAnchor>();

            data.MouseHover();

            myManager.ActiveBrowser.RefreshDomTree();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            HtmlAnchor products = menus.productlink.As <HtmlAnchor>();

            products.MouseClick();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            ObjVariant objvariant = new ObjVariant(myManager);

            //Button Verification
            Element add = objvariant.addvariantbtn;

            Assert.IsTrue(add.InnerText.Contains("Add Variant"));

            Element edit = objvariant.editvariantbtn;

            Assert.IsTrue(edit.InnerText.Contains("Edit Variant/s"));

            Element savefilter = objvariant.savefilterbtn;

            Assert.IsTrue(savefilter.InnerText.Contains("Save Filters"));

            Element delete = objvariant.deletevariantbtn;

            Assert.IsTrue(delete.InnerText.Contains("Delete Variant/s"));

            Element export = objvariant.exportvariantbtn;

            Assert.IsTrue(export.InnerText.Contains("Excel Export"));

            // Verify Table Headings
            Element id = objvariant.variantidheading;

            Assert.IsTrue(id.InnerText.Contains("ID"));

            Element name = objvariant.variantnameheading;

            Assert.IsTrue(name.InnerText.Contains("Name"));

            Element family = objvariant.variantfamilyheading;

            Assert.IsTrue(family.InnerText.Contains("Family"));

            Element alias = objvariant.variantaliasheading;

            Assert.IsTrue(alias.InnerText.Contains("Alias"));

            Element group = objvariant.variantgroupheading;

            Assert.IsTrue(group.InnerText.Contains("Group"));

            Element groupname = objvariant.variantgroupnameheading;

            Assert.IsTrue(groupname.InnerText.Contains("Group Name"));

            Element freetext = objvariant.variantfreetxtheading;

            Assert.IsTrue(freetext.InnerText.Contains("Free Text"));

            Element validfrom = objvariant.variantvalidfromheading;

            Assert.IsTrue(validfrom.InnerText.Contains("Valid From"));

            Element validto = objvariant.variantvalidtoheading;

            Assert.IsTrue(validto.InnerText.Contains("Valid To"));

            Element fromco = objvariant.variantfromcoheading;

            Assert.IsTrue(fromco.InnerText.Contains("From CO"));

            Element toco = objvariant.varianttocoheading;

            Assert.IsTrue(toco.InnerText.Contains("To CO"));

            Element created = objvariant.variantcreatedheading;

            Assert.IsTrue(created.InnerText.Contains("Created"));

            Element updated = objvariant.variantupdatedheading;

            Assert.IsTrue(updated.InnerText.Contains("Updated"));
        }
Example #26
0
        public void TestMethod_addArticlePage()
        {
            readData();

            CommonFunctions.Login(myManager, _username, _password, _Url);

            myManager.ActiveBrowser.Window.Maximize();

            // -- End of Login ---

            ObjMenus menus = new ObjMenus(myManager);

            HtmlAnchor data = menus.Datalink.As <HtmlAnchor>();

            data.MouseHover();

            myManager.ActiveBrowser.RefreshDomTree();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            HtmlAnchor articles = menus.Articlelink.As <HtmlAnchor>();

            articles.MouseClick();

            Thread.Sleep(3000);
            myManager.ActiveBrowser.RefreshDomTree();

            ObjArticle objarticle = new ObjArticle(myManager);

            Element addarticle = objarticle.addArticlebtn;

            myManager.ActiveBrowser.Actions.Click(addarticle);

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            Element verifypagetitle = objarticle.addarticlepgtitle;

            Assert.IsTrue(verifypagetitle.InnerText.Contains("Create Article"));



            Element addnumberlbl = objarticle.numberlabel;

            Assert.IsTrue(addnumberlbl.InnerText.Contains("Article Number *"));

            Element addnamelbl = objarticle.namelabel;

            Assert.IsTrue(addnamelbl.InnerText.Contains("Article Name *"));

            Element addamountlbl = objarticle.amountlabel;

            Assert.IsTrue(addamountlbl.InnerText.Contains("Amount *"));

            Element addtypelbl = objarticle.typelabel;

            Assert.IsTrue(addtypelbl.InnerText.Contains("Article Type *"));

            Element addfromcolbl = objarticle.fromcolabel;

            Assert.IsTrue(addfromcolbl.InnerText.Contains("From CO"));

            Element addtocolbl = objarticle.tocolabel;

            Assert.IsTrue(addtocolbl.InnerText.Contains("To CO"));

            Thread.Sleep(1000);

            // check button disabled
            Element savebtn     = objarticle.savebtn;
            string  disabledatt = savebtn.Attributes[0].ToString();
        }
        public void TestMethod_addVariantPage()
        {
            readData();

            CommonFunctions.Login(myManager, _username, _password, _Url);

            myManager.ActiveBrowser.Window.Maximize();

            // -- End of Login ---

            ObjMenus menus = new ObjMenus(myManager);

            HtmlAnchor data = menus.Datalink.As <HtmlAnchor>();

            data.MouseHover();

            myManager.ActiveBrowser.RefreshDomTree();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            HtmlAnchor products = menus.productlink.As <HtmlAnchor>();

            products.MouseClick();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            ObjAddVariant objaddvariant = new ObjAddVariant(myManager);

            Element addbutton = objaddvariant.addvariantbtn;

            myManager.ActiveBrowser.Actions.Click(addbutton);

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            Element pgtitle = objaddvariant.createpagetitle;

            Assert.IsTrue(pgtitle.InnerText.Contains("Create New Variant"));

            Element variantname = objaddvariant.createpagetitle;

            Assert.IsTrue(variantname.InnerText.Contains("Variant Name *"));

            Element family = objaddvariant.createpagetitle;

            Assert.IsTrue(family.InnerText.Contains("Family"));

            Element alias = objaddvariant.createpagetitle;

            Assert.IsTrue(alias.InnerText.Contains("Alias"));

            Element group = objaddvariant.createpagetitle;

            Assert.IsTrue(group.InnerText.Contains("Group *"));

            Element groupname = objaddvariant.createpagetitle;

            Assert.IsTrue(groupname.InnerText.Contains("Group Name"));

            Element freetext = objaddvariant.createpagetitle;

            Assert.IsTrue(freetext.InnerText.Contains("Free Text"));

            Thread.Sleep(3000);
            myManager.ActiveBrowser.RefreshDomTree();
        }
        public void TestMethod_BatchDeleteArticle()
        {
            readData();

            CommonFunctions.Login(myManager, _username, _password, _Url);

            myManager.ActiveBrowser.Window.Maximize();

            // -- End of Login ---

            ObjMenus menus = new ObjMenus(myManager);

            HtmlAnchor data = menus.Datalink.As <HtmlAnchor>();

            data.MouseHover();

            myManager.ActiveBrowser.RefreshDomTree();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            HtmlAnchor articles = menus.Articlelink.As <HtmlAnchor>();

            articles.MouseClick();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            ObjArticle       objarticle       = new ObjArticle(myManager);
            ObjDeleteArticle objdeletearticle = new ObjDeleteArticle(myManager);


            // Search Articles to Batch Delete

            HtmlInputText searcharticlenum;;

            searcharticlenum = objarticle.searcharticlenum.As <HtmlInputText>();
            searcharticlenum.MouseClick();

            searcharticlenum.Text = "45090";

            myManager.Desktop.Mouse.Click(MouseClickType.LeftClick, searcharticlenum.GetRectangle());
            myManager.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.Enter);

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            // Select Articles to Delete

            HtmlTable articletbl = objarticle.articletable.As <HtmlTable>();

            if (articletbl.BodyRows.Count > 0)
            {
                HtmlInputCheckBox rowcheck1 = objdeletearticle.deleterowcheck1.As <HtmlInputCheckBox>();
                rowcheck1.Check(true);

                HtmlInputCheckBox rowcheck2 = objdeletearticle.deleterowcheck2.As <HtmlInputCheckBox>();
                rowcheck2.Check(true);

                // click on Delete Article button
                HtmlButton deletebutton = objdeletearticle.deletebtn.As <HtmlButton>();
                deletebutton.Click();
            }
            else
            {
                throw new Exception("no matching Article to Delete");
            }

            // Verify Confirmation popup
            Element verifyconfirmation = objdeletearticle.batchdeleteconfirmation;

            Assert.IsTrue(verifyconfirmation.InnerText.Contains("Are you sure you want to delete the selected article(s)?"));

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();


            // Click Yes
            Element yesbutton = objdeletearticle.yesbtnbatchdelete;

            myManager.ActiveBrowser.Actions.Click(yesbutton);

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            Element verifysuccess = objdeletearticle.batchdeletesuccess;

            Assert.IsTrue(verifysuccess.InnerText.Contains(""));

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            Element verifypg = objarticle.articlepagetitle;

            Assert.IsTrue(verifypg.InnerText.Contains("Article"));

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            //  --- End of YES ---

            /*
             * // NO
             * Element nobutton = objdeletearticle.nobtnbatchdelete;
             * myManager.ActiveBrowser.Actions.Click(nobutton);
             *
             * Thread.Sleep(2000);
             * myManager.ActiveBrowser.RefreshDomTree();
             *
             * Element verify = objarticle.articlepagetitle;
             * Assert.IsTrue(verify.InnerText.Contains("Article"));
             * // --- End of NO ---
             */


            verifyDeleteArticle();
        }
Example #29
0
        public void TestMethod_editArticlePage()
        {
            readData();

            CommonFunctions.Login(myManager, _username, _password, _Url);

            myManager.ActiveBrowser.Window.Maximize();

            // -- End of Login ---

            ObjMenus menus = new ObjMenus(myManager);

            HtmlAnchor data = menus.Datalink.As <HtmlAnchor>();

            data.MouseHover();

            myManager.ActiveBrowser.RefreshDomTree();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            HtmlAnchor articles = menus.Articlelink.As <HtmlAnchor>();

            articles.MouseClick();

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            ObjArticle     objarticle     = new ObjArticle(myManager);
            ObjEditArticle objeditarticle = new ObjEditArticle(myManager);

            HtmlInputCheckBox firstrowcheck;

            HtmlTable articletbl = objarticle.articletable.As <HtmlTable>();

            firstrowcheck = objeditarticle.check1.As <HtmlInputCheckBox>();
            firstrowcheck.Check(true);

            // click on Edit Article button
            Element editbutton = objeditarticle.editbtn;

            myManager.ActiveBrowser.Actions.Click(editbutton);

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            Element editpgTitle = objeditarticle.editpagetitle;

            Assert.IsTrue(editpgTitle.InnerText.Contains("Edit Article"));

            // Verify labelnames
            Element editnumlabl = objeditarticle.editnumberlabel;

            Assert.IsTrue(editnumlabl.InnerText.Contains("Article Number *"));

            Element editnamelbl = objeditarticle.editnamelabel;

            Assert.IsTrue(editnamelbl.InnerText.Contains("Article Name*"));

            Element editamountlbl = objeditarticle.editamountlabel;

            Assert.IsTrue(editamountlbl.InnerText.Contains("Amount"));

            Element edittypelbl = objeditarticle.edittypelabel;

            Assert.IsTrue(edittypelbl.InnerText.Contains("Article Type *"));

            Element fromcolbl = objeditarticle.editfromcolabel;

            Assert.IsTrue(fromcolbl.InnerText.Contains("From CO"));

            Element tocolbl = objeditarticle.edittocolabel;

            Assert.IsTrue(tocolbl.InnerText.Contains("To CO"));

            Thread.Sleep(1000);
        }
Example #30
0
        public void TestMethod_deleteStandardactivity()
        {
            readData();

            CommonFunctions.Login(myManager, _username, _password, _Url);

            myManager.ActiveBrowser.Window.Maximize();

            // -- End of Login ---
            ObjMenus menus = new ObjMenus(myManager);

            HtmlAnchor process = menus.processlink.As <HtmlAnchor>();

            process.MouseHover();

            myManager.ActiveBrowser.RefreshDomTree();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            HtmlAnchor standardactivity = menus.standardactivitylink.As <HtmlAnchor>();

            standardactivity.MouseClick();

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();

            ObjDeleteStandardActivity objdeletestandardactivity = new ObjDeleteStandardActivity(myManager);

            // Search Standard Activity to DELETE

            HtmlInputText standardact = objdeletestandardactivity.searchnamefield.As <HtmlInputText>();

            standardact.Text = _searchtodelete;

            myManager.Desktop.Mouse.Click(MouseClickType.LeftClick, standardact.GetRectangle());
            myManager.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.Enter);

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            // Select one Standard Activity to Delete
            HtmlInputCheckBox row1;

            HtmlTable standardacttbl = objdeletestandardactivity.standardactivitytable.As <HtmlTable>();

            row1 = objdeletestandardactivity.rowcheck1.As <HtmlInputCheckBox>();
            row1.Check(true);

            // click on Delete button
            Element deletebutton = objdeletestandardactivity.deletebtn;

            myManager.ActiveBrowser.Actions.Click(deletebutton);

            Thread.Sleep(4000);
            myManager.ActiveBrowser.RefreshDomTree();

            Element verifymsg = objdeletestandardactivity.deleteconfirmationmsg;

            Assert.IsTrue(verifymsg.InnerText.Contains("Are you sure you want to delete the selected Standard Activity(s)?"));

            Thread.Sleep(2000);
            myManager.ActiveBrowser.RefreshDomTree();

            // If YES
            // Click on YES
            Element yesbutton = objdeletestandardactivity.yesbtn;

            myManager.ActiveBrowser.Actions.Click(yesbutton);

            Thread.Sleep(3000);
            myManager.ActiveBrowser.RefreshDomTree();

            Element verifydelete = objdeletestandardactivity.deletesuccessmsg;

            Assert.IsTrue(verifydelete.InnerText.Contains("Selected Standard Activity(s) has been deleted successfully"));

            Thread.Sleep(3000);
            myManager.ActiveBrowser.RefreshDomTree();

            Element verifyredirect = objdeletestandardactivity.standardacttblheading;

            Assert.IsTrue(verifyredirect.InnerText.Contains("Standard Activity"));

            Thread.Sleep(3000);
            myManager.ActiveBrowser.RefreshDomTree();

            /*
             * // Click on NO
             * Element nobutton = objdeletestandardactivity.nobtn;
             * myManager.ActiveBrowser.Actions.Click(nobutton);
             *
             * Element verifypage = objdeletestandardactivity.standardacttblheading;
             * Assert.IsTrue(verifypage.InnerText.Contains("Standard Activity"));
             *
             * Thread.Sleep(2000);
             * myManager.ActiveBrowser.RefreshDomTree();
             */
        }