Ejemplo n.º 1
0
        public void updateArticle()
        {
            ObjEditArticle objeditarticle = new ObjEditArticle(myManager);

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

            HtmlInputText artnum  = objeditarticle.editnumbertxt.As <HtmlInputText>();
            HtmlInputText artname = objeditarticle.editnametxt.As <HtmlInputText>();
            //HtmlInputText amt;
            HtmlSelect arttype = objeditarticle.edittypetxt.As <HtmlSelect>();
            // HtmlSelect fromco = objeditarticle.editfromcotxt.As<HtmlSelect>();
            HtmlSelect toco      = objeditarticle.edittocotxt.As <HtmlSelect>();
            Element    updatebtn = objeditarticle.updatebtn;

            //amt = myManager.ActiveBrowser.Find.ById("l4").As<HtmlInputText>();
            artnum.Text  = _articlenumber;
            artname.Text = _articlename;
            //amt.Text = _amount;

            arttype.MouseClick();
            Thread.Sleep(1000);
            arttype.SelectByText(_articletype, true);

            /*
             * fromco.MouseClick();
             * Thread.Sleep(1000);
             * fromco.SelectByText(_fromco, true);
             */

            /*
             * toco.MouseClick();
             * Thread.Sleep(1000);
             * toco.SelectByText(_toco, true);
             */

            myManager.ActiveBrowser.Actions.Click(updatebtn);
            //Element verifymandatorymsg = myManager.ActiveBrowser.Find.ByXPath("//*[@id='body']/div/div/div[2]/div/div/div/form/div[2]/div[2]/span");
            //Assert.AreEqual(verifymandatorymsg.InnerText, "tttt");
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
0
        public void TestMethod_VerifyEditPage()
        {
            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();

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


            HtmlInputCheckBox rowcheckedit = objeditarticle.editrowcheck1.As <HtmlInputCheckBox>();

            rowcheckedit.MouseClick();

            Element editbutton = objarticle.editArticlebtn;

            myManager.ActiveBrowser.Actions.Click(editbutton);

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

            Element verifytitle = objeditarticle.editpagetitle;

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

            Element articlenum = objeditarticle.editnumberlabel;

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

            Element articlename = objeditarticle.editnamelabel;

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

            Element amount = objeditarticle.editamountlabel;

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

            Element artitype = objeditarticle.edittypelabel;

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

            Element fromco = objeditarticle.editfromcolabel;

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

            Element toco = objeditarticle.edittocolabel;

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

            //Element verifybutton1 = myManager.ActiveBrowser.Find.ByXPath("//*[@id='body']/div/div/div[2]/div/div/div/form/div[5]/div/div[2]/div[1]/input");
            //Assert.IsTrue(verifybutton1.InnerText.Contains("Update"));

            Element verifybutton2 = objeditarticle.updatebackbtn;

            Assert.IsTrue(verifybutton2.InnerText.Contains("Back"));

            Thread.Sleep(1000);
            myManager.ActiveBrowser.RefreshDomTree();
        }
Ejemplo n.º 4
0
        public void TestMethod_EditArticle()
        {
            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);

            ObjEditArticle objeditarticle = new ObjEditArticle(myManager);

            // Search Article to Edit

            HtmlInputText articleno = objarticle.searcharticlenum.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 articletbl = objarticle.articletable.As <HtmlTable>();

            if (articletbl.BodyRows.Count > 0)
            {
                firstrowcheck = objeditarticle.editrowcheck1.As <HtmlInputCheckBox>();
                firstrowcheck.Check(true);

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

            updateArticle();

            verifyArticle();
        }
Ejemplo n.º 5
0
        public void TestMethod_EditArticleBackbutton()
        {
            readData();

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

            myManager.ActiveBrowser.Window.Maximize();

            // -- End of Login ---

            // -- 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);
            ObjEditArticle objeditarticle = new ObjEditArticle(myManager);

            HtmlInputCheckBox rowcheckedit = objeditarticle.check1.As<HtmlInputCheckBox>();
            rowcheckedit.MouseClick();

            Element editbutton = objeditarticle.editbtn;
            myManager.ActiveBrowser.Actions.Click(editbutton);

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

            /*
            // Back with data
            HtmlInputText artnumb = myManager.ActiveBrowser.Find.ById("l0").As<HtmlInputText>();
            HtmlInputText artnm = myManager.ActiveBrowser.Find.ById("l1").As<HtmlInputText>();
            HtmlInputText amn = myManager.ActiveBrowser.Find.ById("l4").As<HtmlInputText>();
            
            artnumb.Text = "5678";
            artnm.Text = "edit";
            amn.Text = "5";
            */

            Element bckbutton = objeditarticle.updatebackbtn;
            myManager.ActiveBrowser.Actions.Click(bckbutton);

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

            // Redirect to Article Page
            Element verifyPage = objarticle.articlepagetitle;
            Assert.AreEqual(verifyPage.InnerText, "Article");

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

        }