Ejemplo n.º 1
0
        internal void AddShareSkill()
        {
            ExcelLib.PopulateInCollection(Base.ExcelPath, "ManageListings");

            GlobalDefinitions.WaitForElement(ShareSkillButton, 30);
            ShareSkillButton.Click();

            GlobalDefinitions.WaitForElement(Title, 30);
            Title.SendKeys(ExcelLib.ReadData(2, "Title"));

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

            Category(CategoryDropDown, ExcelLib.ReadData(2, "Category"));

            SubCategory(SubCategoryDropDown, ExcelLib.ReadData(2, "Sub Category"));

            Tags.SendKeys(ExcelLib.ReadData(2, "Tags"));
            Tags.SendKeys(Keys.Enter);

            OneOff.Click();

            OnLine.Click();

            StartDateDropDown.SendKeys(ExcelLib.ReadData(2, "Start Date"));

            EndDateDropDown.SendKeys(ExcelLib.ReadData(2, "End Date"));

            Sunday.Click();
            SundayStartTime.SendKeys(ExcelLib.ReadData(2, "Sunday Start Time"));
            SundayEndTime.SendKeys(ExcelLib.ReadData(2, "Sunday End Time"));

            Monday.Click();
            MondayStartTime.SendKeys(ExcelLib.ReadData(2, "Monday Start Time"));
            MondayEndTime.SendKeys(ExcelLib.ReadData(2, "Monday End Time"));

            Tuesday.Click();
            TuesdayStartTime.SendKeys(ExcelLib.ReadData(2, "Monday Start Time"));
            TuesdayEndTime.SendKeys(ExcelLib.ReadData(2, "Monday End Time"));

            CreditOption.Click();

            if (SkillExchangeOption.Selected)
            {
                SkillExchange.SendKeys(ExcelLib.ReadData(2, "Skill Exchange"));
            }
            else
            {
                CreditAmount.SendKeys(ExcelLib.ReadData(2, "Credit"));
            }

            Hidden.Click();

            Save.Click();
        }
Ejemplo n.º 2
0
        internal void EnterShareSkill()

        {//GlobalDefinitions.WaitForElement(driver, By.,20)
            GlobalDefinitions.wait(10);
            GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "ShareSkill");
            //clcik on Shareskill button
            ShareSkillButton.Click();
            //Click on Title text box
            Title.SendKeys(ExcelLib.ReadData(2, "Title"));
            //Enter Description in Title
            Description.SendKeys(ExcelLib.ReadData(2, "Description"));
            //CLick on dropdown
            CategoryDropDown.Click();
            //Thread.Sleep(5000);
            //Selecting option from Categorydropdown
            SelectElement oselect = new SelectElement(SelectSubDropdown);

            oselect.SelectByText(ExcelLib.ReadData(2, "Category"));

            //Click on SubCategory
            SubCategoryDropDown.Click();

            //Selecting option from SubCategorydropdown
            SelectElement subCategory = new SelectElement(SelectDropdown);

            subCategory.SelectByValue(ExcelLib.ReadData(2, "SubCategory"));

            //Enter Tags
            Tags.SendKeys(ExcelLib.ReadData(2, "Tags"));
            Tags.SendKeys(Keys.Enter);
            //Select Service Type(Radio buttons)
            switch (ExcelLib.ReadData(2, "ServiceType"))
            {
            case "One-off service":
                OneOffType.Click();
                break;

            case "Hourly basis service":
                HourlyType.Click();
                break;
            }
            //Select Location Type (Radio buttons)
            switch (ExcelLib.ReadData(2, "LocationType"))
            {
            case "On-site":
                OnSiteLocationTypeOption.Click();
                break;

            case "Online":
                OnlineLocationTypeOption.Click();
                break;
            }

            GlobalDefinitions.WaitForElement(driver, By.XPath("//div[3]/div[2]/input[1]"), 10);

            //Select Start Date
            StartDateDropDown.Click();
            Thread.Sleep(5000);
            StartDateDropDown.SendKeys(ExcelLib.ReadData(2, "Startdate"));

            GlobalDefinitions.WaitForElement(driver, By.Name("endDate"), 10);
            //Select End Date
            EndDateDropDown.Click();
            EndDateDropDown.SendKeys(ExcelLib.ReadData(2, "Enddate"));

            //DayAvailability
            switch (ExcelLib.ReadData(2, "Selectday"))
            {
            case "Sun":
                Sunday.Click();
                SundayTime.SendKeys(ExcelLib.ReadData(2, "Starttime"));
                SundayEndTime.SendKeys(ExcelLib.ReadData(2, "Endtime"));
                break;

            case "Mon":
                Monday.Click();
                MondayTime.SendKeys(ExcelLib.ReadData(2, "Starttime"));
                MondayEndTime.SendKeys(ExcelLib.ReadData(2, "Endtime"));
                break;

            case "Tue":
                Tuesday.Click();
                TuesdayTime.SendKeys(ExcelLib.ReadData(2, "Starttime"));
                TuesdayEndTime.SendKeys(ExcelLib.ReadData(2, "Endtime"));
                break;

            case "Wed":
                Wednesday.Click();
                WednesdayTime.SendKeys(ExcelLib.ReadData(2, "Starttime"));
                WednesdayEndTime.SendKeys(ExcelLib.ReadData(2, "Endtime"));
                break;

            case "Thu":
                Thursday.Click();
                ThursdayTime.SendKeys(ExcelLib.ReadData(2, "Starttime"));
                //MondayEndTime.SendKeys(ExcelLib.ReadData(2, "Endtime"));
                break;
            }
            //Select Skill Trade Radio buttons)
            switch (ExcelLib.ReadData(2, "SkillTrade"))
            {
            case "Skill-exchange":
                FirstSkillTradeOption.Click();
                break;

            case "Credit":
                SecondkillTradeOption.Click();
                break;
            }
            //Enter Skill-Exchange
            SkillExchange.SendKeys(ExcelLib.ReadData(2, "Skill-Exchange"));
            SkillExchange.SendKeys(Keys.Enter);
            //Enter WorkSample
            //FileUpload.SendKeys(@"C:\Users\minty\OneDrive\Pictures\FIle1.txt");
            GlobalDefinitions.WaitForElement(driver, By.XPath("//i[@Class = 'huge plus circle icon padding-25']"), 10);
            FileUpload.Click();
            AutoItX3 autoIt = new AutoItX3();

            autoIt.WinActivate("Open");
            Thread.Sleep(5000);
            autoIt.Send(@"C:\Users\minty\OneDrive\Pictures\Camera Roll\Garry.jpeg");
            Thread.Sleep(5000);
            autoIt.Send("{ENTER}");
            //Thread.Sleep(5000);
            ////WorkSample.Click();


            //Select ACtive/Hidden Options ( Radio Buttons)
            switch (ExcelLib.ReadData(2, "Active"))
            {
            case "Active":
                ActiveOption.Click();
                break;

            case "Hidden":
                HiddenOption.Click();
                break;
            }

            //Click on Save
            Save.Click();
            // Assert.IsTrue("Service Listing Saved Successfully".Exist, "OK");
        }