public void ListingSteps()
        {
            //click add new
            // IWebElement ShareSkills = Common.Driver.FindElement(By.CssSelector("div.ui:nth-child(1) section.nav-secondary:nth-child(2) div.ui.eight.item.menu div.right.item:nth-child(5) > a.ui.basic.green.button"));
            Thread.Sleep(7000);
            ShareSkills.Click();

            Thread.Sleep(8000);
            Title.SendKeys("Automation Testing");

            Description.SendKeys("Tools used in testing and methods followed in handling tools");

            Category1.SendKeys("Programming & Tech");

            Category2.SendKeys("QA");

            Tags1.SendKeys("Selenium");
            Tags1.SendKeys(Keys.Enter);
            Console.WriteLine("Enter pressed for tag1");


            ServiceType.Click();


            LocationType.Click();


            StartDate.SendKeys("17/10/2019");


            EndDate.SendKeys("17/4/2020");


            ChooseMon.Click();
            StartTimeMon.SendKeys("8.30AM");


            EndTimeMon.SendKeys("4.30PM");


            SkillTrade.Click();


            Credit.SendKeys("5");


            Active.Click();


            Save.Click();
            Thread.Sleep(6000);


            //verification


            ManagelistingsMenu.Click();
            Thread.Sleep(8000);
            try
            {
                Assert.AreEqual("Automation Testing", ActualResult1.Text);
                Console.WriteLine("Test case 1 PASS: record added succesfully");
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Esempio n. 2
0
        public void ListingSteps()
        {
            //populate excel data
            GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "AddSkill");


            //click add new
            // IWebElement ShareSkills = Common.Driver.FindElement(By.CssSelector("div.ui:nth-child(1) section.nav-secondary:nth-child(2) div.ui.eight.item.menu div.right.item:nth-child(5) > a.ui.basic.green.button"));
            Thread.Sleep(7000);
            ShareSkills.Click();

            Thread.Sleep(8000);
            Title.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Title"));

            Description.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Description"));

            Category1.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Category1"));

            Category2.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Category2"));

            Tags1.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Tags1"));
            Tags1.SendKeys(Keys.Enter);
            Console.WriteLine("Enter pressed for tag1");


            ServiceType.Click();


            LocationType.Click();


            StartDate.SendKeys("17/10/2019");


            EndDate.SendKeys("17/04/2020");


            ChooseMon.Click();
            StartTimeMon.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "StartTimeMon"));


            EndTimeMon.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "EndTimeMon"));


            SkillTrade.Click();


            Credit.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, " Credit"));

            PlusIcon.Click();
            Thread.Sleep(7000);
            AutoItX3 autoIt = new AutoItX3();

            autoIt.WinActivate("Open"); //activate the window, so that next set of action actives n this window
            Thread.Sleep(5000);
            autoIt.Send(@"C:\Users\Bhushan\Desktop\Updated - Mars(QA)-CompetitionTask.pdf");
            Thread.Sleep(7000);
            autoIt.Send("{ENTER}");

            Active.Click();

            Save.Click();

            //verify
            Thread.Sleep(9000);
            ManagelistingsMenu.Click();
            Thread.Sleep(9000);
            try
            {
                Console.WriteLine("Entered try");
                Assert.IsTrue(ActualResult1.Text.Contains("Automation testing"));
                {
                    Console.WriteLine("Test case 1 PASS : Added Record successfully");
                    Base.test.Log(LogStatus.Info, "Record added");
                }



                ////Screenshot
                //String img = Global.GlobalDefinitions.SaveScreenShotClass.SaveScreenshot(GlobalDefinitions.Driver, "Report");
                ////AddScreenCapture(@"E:\Dropbox\VisualStudio\Projects\Beehive\TestReports\ScreenShots\");
                //Base.test.Log(LogStatus.Info, "Image example: " + img);
                //// end test. (Reports)
                //Base.extent.EndTest(Base.test);
                //// calling Flush writes everything to the log file (Reports)
                //Base.extent.Flush();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }