Пример #1
0
        internal void EnterShareSkill()
        {
            Global.GlobalDefinitions.ExcelLib.PopulateInCollection(AppDomain.CurrentDomain.BaseDirectory.Replace(@"MarsFramework\bin\Debug\", @"MarsFramework\ExcelData\TestDataShareSkill.xlsx"), "ShareSkill");

            //wait for element to appear
            Global.GlobalDefinitions.WaitForElement(Global.GlobalDefinitions.Driver, By.LinkText("Share Skill"), (20));
            //Click on the share skill button
            ShareSkillButton.Click();

            //Click on the title field
            Global.GlobalDefinitions.WaitForElement(Global.GlobalDefinitions.Driver, By.Name("title"), (20));
            Title.Click();
            //Type on the title field
            Title.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(1, "Title"));

            //Click on the description
            Global.GlobalDefinitions.WaitForElement(Global.GlobalDefinitions.Driver, By.Name("description"), (20));
            Description.Click();
            //Type on the Description
            Description.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(1, "Description"));

            //Click on category dropdown
            CategoryDropDown.Click();
            //Choose an option from category dropdown
            CategoryDropDown.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(1, "Category") + Keys.Enter);

            //Click on sub category
            SubCategoryDropDown.Click();
            //Choose an option from subcategory dropdown
            SubCategoryDropDown.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(1, "SubCategory") + Keys.Enter);

            //Click on Tags Field
            Tags.Click();
            //Type on the Tags Field then press Enter
            Tags.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(1, "Tags") + Keys.Enter);

            //Click and choose an option for Service type
            ServiceTypeOptions.Click();

            //Click and Choose an option for location type
            LocationTypeOption.Click();

            //click on a skill trade option skill exchange
            SkillTradeOptionSkillExchange.Click();

            //Click on skill exchange
            SkillExchange.Click();

            //Type and add a tag
            SkillExchange.SendKeys("Test tag" + Keys.Enter);

            //click on a skill trade option credit
            SkillTradeOptionCredit.Click();

            //Click on credit amount
            CreditAmount.Click();

            //type and add a credit amount
            CreditAmount.SendKeys("2" + Keys.Enter);

            //Click an option on Active
            ActiveOption.Click();

            //Save the skill
            Save.Click();

            Thread.Sleep(2000);
        }
Пример #2
0
        public void AddNewSkill()
        {
            System.Threading.Thread.Sleep(2000);
            #region Navigate to Share Skills Page
            // Click on Share Skills Page
            ShareSkill.Click();
            System.Threading.Thread.Sleep(1500);
            //Populate the excel data
            GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "ShareSkills");

            #endregion


            #region Enter Title

            //Enter the data in Title textbox
            Title.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "title"));

            #endregion

            #region Enter Description

            //Enter the data in Description textbox
            Description.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "EnterDescription"));


            #endregion

            #region Category Drop Down

            // Click on Category Dropdown
            Category.Click();


            // Select Category from Category Drop Down
            var SelectElement = new SelectElement(Category);
            SelectElement.SelectByText((GlobalDefinitions.ExcelLib.ReadData(2, "category")));

            // Click on Sub-Category Dropdown
            SubCategory.Click();

            //Select Sub-Category from the Drop Down
            var SelectElement1 = new SelectElement(SubCategory);
            SelectElement1.SelectByText((GlobalDefinitions.ExcelLib.ReadData(2, "subcategory")));
            #endregion

            #region Tags
            // Eneter Tag
            Tag.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "TagName"));
            Tag.SendKeys(Keys.Enter);

            #endregion

            #region Service Type Selection

            // Service Type Selection

            if (GlobalDefinitions.ExcelLib.ReadData(2, "ServiceType") == "Hourly basis service")
            {
                ServiceTypeHourly.Click();
            }
            else if (GlobalDefinitions.ExcelLib.ReadData(2, "ServiceType") == "One-off service")
            {
                ServiceTypeOnOff.Click();
            }
            #endregion

            #region Select Location Type
            // Location Type Selection

            if (GlobalDefinitions.ExcelLib.ReadData(2, "SelectLocationType") == "On-site")
            {
                LocationTypeOnsite.Click();
            }
            else if (GlobalDefinitions.ExcelLib.ReadData(2, "SelectLocationType") == "Online")
            {
                LocationTypeOnline.Click();
            }
            #endregion

            #region Select Available Dates from Calendar
            // Select Start Date
            StartDate.Click();
            // Select End Date
            EndDate.Click();
            #endregion


            #region Select Skill Trade
            // Select Skill Trade

            if (GlobalDefinitions.ExcelLib.ReadData(2, "SelectSkillTrade") == "Skill-exchange")
            {
                RequiredSkills.Click();
                RequiredSkills.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "ExchangeSkill"));
                RequiredSkills.SendKeys(Keys.Enter);
            }
            else if (GlobalDefinitions.ExcelLib.ReadData(2, "SelectSkillTrade") == "Credit")
            {
                CreditAmount.Click();
                CreditAmount.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "AmountInExchange"));
                CreditAmount.SendKeys(Keys.Enter);
            }
            #endregion

            #region Select User Status
            // Select User Status

            if (GlobalDefinitions.ExcelLib.ReadData(2, "UserStatus") == "Active")
            {
                StatusActive.Click();
            }
            else if (GlobalDefinitions.ExcelLib.ReadData(2, "UserStatus") == "Hidden")
            {
                StatusHidden.Click();
            }
            #endregion


            #region Add Work Sample
            // Add Work Sample
            Thread.Sleep(2000);
            //Work Sample upload button path
            IWebElement upload = GlobalDefinitions.driver.FindElement(By.XPath("//*[@id='selectFile']"));

            // Uploading File path
            var    GetCurrentDirectory = Directory.GetCurrentDirectory();
            String path = GetCurrentDirectory + @"\MarsFramework\Upload Files\Samplework.txt";
            upload.SendKeys(path);



            #endregion

            #region Save / Cancel Skill
            // Save or Cancel New Skill

            if (Global.GlobalDefinitions.ExcelLib.ReadData(2, "SaveOrCancel") == "Save")
            {
                SaveShareSkills.Click();
            }
            else if (Global.GlobalDefinitions.ExcelLib.ReadData(2, "SaveOrCancel") == "Cancel")
            {
                CancelShareSkills.Click();
            }
            #endregion


            #region Check whether New  skill created sucessfully

            string ShareSkillSucess = Global.GlobalDefinitions.driver.FindElement(By.LinkText("Manage Listings")).Text;

            if (ShareSkillSucess == "Manage Listings")
            {
                Global.Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Shared Skill Successful");
            }
            else
            {
                Global.Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Share Skill Unsuccessful");
            }
            #endregion
        }
Пример #3
0
        internal void EditShareSkill()
        {
            //Populate the Excel sheet
            Global.GlobalDefinitions.ExcelLib.PopulateInCollection(Global.Base.ExcelPath, "ShareSkill");
            int excelRowToRead = 3;

            Title.Clear();
            Title.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "Title"));

            //Click on Description
            Description.Clear();
            Description.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "Description"));

            //Select A Category
            CategoryDropDown.Click();
            String categoryValue = Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "Category");
            IList <IWebElement> CategoriesDropDownList = CategoryDropDown.FindElements(By.XPath("//option"));
            int DpListCount = CategoriesDropDownList.Count;

            for (int i = 0; i < DpListCount; i++)
            {
                if (CategoriesDropDownList[i].Text == categoryValue)
                {
                    CategoriesDropDownList[i].Click();
                }
            }

            //Select Sub Category
            Thread.Sleep(1000);
            IWebElement SubCategorySelection = Global.GlobalDefinitions.driver.FindElement(By.Name("subcategoryId"));

            SubCategorySelection.Click();
            String SubCategoryValue = Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "SubCategory");
            IList <IWebElement> SubCategoriesDropDownList = SubCategorySelection.FindElements(By.XPath("//option"));
            int SbDpListCount = SubCategoriesDropDownList.Count;

            for (int i = 0; i < SbDpListCount; i++)
            {
                if (SubCategoriesDropDownList[i].Text == SubCategoryValue)
                {
                    SubCategoriesDropDownList[i].Click();
                }
            }

            //Clear and Add Tags
            IWebElement         tagsInputBox  = Global.GlobalDefinitions.driver.FindElement(By.XPath("//*[@id='service-listing-section']/div[2]/div/form/div[4]/div[2]/div"));
            IList <IWebElement> RemoveButtons = tagsInputBox.FindElements(By.ClassName("ReactTags__remove"));

            foreach (IWebElement element in RemoveButtons)
            {
                element.Click();
            }
            Tags.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "Tag"));
            Tags.SendKeys(Keys.Enter);

            //Select Service Type
            String ServiceType = Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "Service Type");

            if (ServiceType.Equals("Hourly basis Service"))
            {
                HourlyServiceType.Click();
            }

            else if (ServiceType.Equals("One-off Service"))
            {
                OneOffServiceType.Click();
            }

            //Select Location Type
            String LocatioType = Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "Location Type");

            if (LocatioType.Equals("On-site"))
            {
                OnSiteLocationType.Click();
            }

            else if (OnSiteLocationType.Equals("Online"))
            {
                OnlineLocationType.Click();
            }

            //Select Available Start Date
            IWebElement AvailableStartDateInput = AvailabilityForm.FindElement(By.Name("startDate"));

            AvailableStartDateInput.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "AvailableStartDate"));

            //Select Available End Date
            IWebElement AvailableEndDateInput = AvailabilityForm.FindElement(By.Name("endDate"));

            AvailableEndDateInput.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "AvailableEndDate"));

            String[] WeekDays = new String[] { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };

            //Cleared Selected Checkboxes
            IList <IWebElement> AvailableCheckBoxes = AvailabilityForm.FindElements(By.Name("Available"));

            foreach (IWebElement element in AvailableCheckBoxes)
            {
                if (element.Selected)
                {
                    element.Click();
                }
            }

            //Select Check boxes based on data
            String         AvailableDaysValue = Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "AvailableDays");
            IList <String> AvailableDays      = AvailableDaysValue.Split(',');

            for (int i = 0; i < WeekDays.Count(); i++)
            {
                if (AvailableDays.Contains(WeekDays[i]))
                {
                    AvailableCheckBoxes[i].Click();
                }
            }

            //Set Start times
            IList <IWebElement> AvailableStartTimeInputs = AvailabilityForm.FindElements(By.Name("StartTime"));
            String         AvailableStartTimesValue      = Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "AvailableStartTimes");
            IList <String> AvailableStartTimes           = AvailableStartTimesValue.Split(',');

            for (int i = 0; i < AvailableStartTimes.Count(); i++)
            {
                IList <String> startTimeInfo  = AvailableStartTimes[i].Split(':');
                String         startTimeDay   = startTimeInfo[0];
                String         startTimeValue = startTimeInfo[1];
                int            indexOfDay     = Array.IndexOf(WeekDays, startTimeDay);
                AvailableStartTimeInputs[indexOfDay].SendKeys(startTimeValue);
            }

            //Set End times
            IList <IWebElement> AvailableEndTimeInputs = AvailabilityForm.FindElements(By.Name("EndTime"));
            String         AvailableEndTimesValue      = Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "AvailableEndTimes");
            IList <String> AvailableEndTimes           = AvailableEndTimesValue.Split(',');

            for (int i = 0; i < AvailableEndTimes.Count(); i++)
            {
                IList <String> endTimeInfo  = AvailableEndTimes[i].Split(':');
                String         endTimeDay   = endTimeInfo[0];
                String         endTimeValue = endTimeInfo[1];
                int            indexOfDay   = Array.IndexOf(WeekDays, endTimeDay);
                AvailableEndTimeInputs[indexOfDay].SendKeys(endTimeValue);
            }

            //Select Skill Exchange Type
            String SkillTradeType = Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "SkillTradeType");

            if (SkillTradeType.Equals("Skill-exchange"))
            {
                SkillExchangeType.Click();

                //Clear and Add Tags
                IWebElement         SkillTagsInputBox = Global.GlobalDefinitions.driver.FindElement(By.XPath("//*[@id='service-listing-section']/div[2]/div/form/div[8]/div[4]/div/div"));
                IList <IWebElement> CrossButtons      = SkillTagsInputBox.FindElements(By.ClassName("ReactTags__remove"));
                foreach (IWebElement element in CrossButtons)
                {
                    element.Click();
                }
                SkillExchangeTag.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "SkillExchangeTab"));
                SkillExchangeTag.SendKeys(Keys.Enter);
            }

            else if (SkillTradeType.Equals("Credit"))
            {
                CreditsType.Click();
                CreditAmount.Clear();
                CreditAmount.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "CreditsAmount"));
            }

            //Select Active Status Button
            String ActiveType = Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "ActiveType");

            if (SkillTradeType.Equals("Active"))
            {
                ActiveButton.Click();
            }
            else if (SkillTradeType.Equals("Hidden"))
            {
                HiddenButton.Click();
            }

            //Click on Save Button
            SaveButton.Click();
            Thread.Sleep(3000);

            //Verify
            IWebElement         listingTable = Global.GlobalDefinitions.driver.FindElement(By.XPath("//*[@id='listing-management-section']/div[2]/div[1]/table"));
            IList <IWebElement> tableRows    = listingTable.FindElements(By.TagName("tr"));

            Boolean isListingEdited = false;

            for (int i = 0; i <= tableRows.Count; i++)
            {
                IWebElement row = tableRows[i];
                if (row.Text.Contains(Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "Title")) && row.Text.Contains(Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "Description")))
                {
                    isListingEdited = true;
                    break;
                }
            }
            if (isListingEdited == true)
            {
                Global.Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Edit Skill test Successful");
            }
            else
            {
                Global.Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Edit Skill test Failed");
            }
        }
        internal void EnterShareSkill()
        {
            // Populate data saved in excel to collection
            GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ShareSkillPath, "ShareSkill");

            // Click ShareSkill Button
            GlobalDefinitions.WaitForElementClickable(GlobalDefinitions.driver, "LinkText", "Share Skill", 5);
            ShareSkillBtn.Click();

            // Wait Elements on new page
            GlobalDefinitions.WaitForTextPresentInElement(GlobalDefinitions.driver, Title, "", 10);

            // Enter Title from excel
            Title.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Title"));

            // Enter Description from excel
            Description.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Description"));

            // Select Category from Excel
            GlobalDefinitions.WaitForElement(GlobalDefinitions.driver, "Name", "categoryId", 10);

            new SelectElement(CategoryDropdown).SelectByText(GlobalDefinitions.ExcelLib.ReadData(2, "Category"));
            new SelectElement(SubCategoryDropdown).SelectByText(GlobalDefinitions.ExcelLib.ReadData(2, "SubCategory"));

            // Enter tags from excel
            Tags.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Tags"));
            Tags.SendKeys(Keys.Enter);

            // Choose Service Type radio button from excel
            IWebElement ServiceTypeRadioBtn = GlobalDefinitions.driver.FindElement(By.XPath("//input[@name='serviceType' " +
                                                                                            "and @value='" + GlobalDefinitions.ExcelLib.ReadData(2, "ServiceType") + "'] "));

            ServiceTypeRadioBtn.Click();

            // Choose Location Type radio button from excel
            IWebElement LocationTypeRadioBtn = GlobalDefinitions.driver.FindElement(By.XPath("//input[@name='locationType' " +
                                                                                             "and @value='" + GlobalDefinitions.ExcelLib.ReadData(2, "LocationType") + "']"));

            LocationTypeRadioBtn.Click();

            // Enter Available days from excel
            // *** Enter start date and end date ***
            StartDateInputArea.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "StartDate"));
            EndDateInputArea.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "EndDate"));

            // *** Set loop for days checkbox ***
            for (int rows = 2; rows < 9; rows++)
            {
                var sr = GlobalDefinitions.ExcelLib.ReadData(rows, "SelectDay").ToString();
                if (sr != null && sr != "")
                {
                    // Select checkbox
                    IWebElement DaysCheckbox = GlobalDefinitions.driver.FindElement(By.XPath("//input[@name='Available' " +
                                                                                             "and @index='" + GlobalDefinitions.ExcelLib.ReadData(rows, "SelectDay") + "']"));
                    DaysCheckbox.Click();

                    // Enter start time
                    IWebElement StartTimeInputArea = GlobalDefinitions.driver.FindElement(By.XPath("//input[@name='StartTime' " +
                                                                                                   "and @index='" + GlobalDefinitions.ExcelLib.ReadData(rows, "SelectDay") + "']"));
                    StartTimeInputArea.SendKeys(GlobalDefinitions.ExcelLib.ReadData(rows, "StartTime"));

                    // Enter end time
                    IWebElement EndTimeInputArea = GlobalDefinitions.driver.FindElement(By.XPath("//input[@name='EndTime' " +
                                                                                                 "and @index='" + GlobalDefinitions.ExcelLib.ReadData(rows, "SelectDay") + "']"));
                    EndTimeInputArea.SendKeys(GlobalDefinitions.ExcelLib.ReadData(rows, "EndTime"));
                }
                else
                {
                    break;
                }
            }


            // Choose Skill Trade radio button
            try
            {
                string      SkillTradeTypeExcel = GlobalDefinitions.ExcelLib.ReadData(2, "SkillTrade").ToString();
                IWebElement SkillTradeRadioBtn  = GlobalDefinitions.driver.FindElement(By.XPath("//input[@name='skillTrades' " +
                                                                                                "and @value='" + SkillTradeTypeExcel + "']"));
                SkillTradeRadioBtn.Click();

                // Condition1: Enter Skill-Exchange from excel-------Condition2: Enter Credit
                if (SkillTradeTypeExcel == "true")
                {
                    SkillExchange.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Skill-Exchange Tag"));
                    SkillExchange.SendKeys(Keys.Enter);
                }
                if (SkillTradeTypeExcel == "false")
                {
                    try
                    {
                        var CreditExcel = Convert.ToDecimal(GlobalDefinitions.ExcelLib.ReadData(2, "Credit"));

                        if (0 <= CreditExcel && CreditExcel <= 10)
                        {
                            CreditAmount.SendKeys(CreditExcel.ToString());
                        }
                        else
                        {
                            Assert.Fail("Please enter a number between 0-10.");
                        }
                    } catch (Exception e)
                    {
                        Assert.Fail("Credit input is illegal, please check format!", e.Message);
                    }
                }
            } catch (Exception ex)
            {
                Assert.Fail("Test failed at choosing skill trade type", ex.Message);
            }


            // Upload document from the path saved in excel, if it's input type, then can send path directly
            try
            {
                IWebElement upload = GlobalDefinitions.driver.FindElement(By.XPath("//input[@id='selectFile']"));
                // Uploading File path
                var    SampleWorkPath = MarsResource.SampleWorkPath;
                string fullPath       = System.IO.Path.GetFullPath(SampleWorkPath);
                upload.SendKeys(fullPath);
            }
            catch (Exception e)
            {
                Assert.Fail("Failed to upload work sample", e.Message);
            }


            // Choose Active radio button
            GlobalDefinitions.WaitForElement(GlobalDefinitions.driver, "XPath", "//i[@class='remove sign icon floatRight']", 10);
            IWebElement IsActiveRadioBtn = GlobalDefinitions.driver.FindElement(By.XPath("//input[@name='isActive' and" +
                                                                                         " @value='" + GlobalDefinitions.ExcelLib.ReadData(2, "Active") + "']"));

            IsActiveRadioBtn.Click();

            // Click Save Button to save all data
            Save.Click();
        }
Пример #5
0
        internal void EditShareSkill()
        {
            //Thread.Sleep(3000);
            GlobalDefinitions.Wait(3000);
            ManagementListingBtn.Click();
            //Thread.Sleep(2000);
            GlobalDefinitions.Wait(2000);
            GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "EditShareSkill");

            try
            {
                //Thread.Sleep(1000);
                GlobalDefinitions.Wait(1000);


                var table = _driver.FindElement(By.XPath("//*[@id='listing-management-section']/div[2]/div[1]/div[1]/table/tbody")); //table

                var manageListRow = table.FindElements(By.TagName("tr")).ToList();                                                   //all rows picked


                var isFound = false;
                // var rows = _driver.FindElement(By.XPath("//*[@id='listing-management-section']/div[2]/div[1]/div[1]/table/tbody/tr"));  //each row and coloum


                for (int i = 1; i <= manageListRow.Count; i++)
                {
                    var row = _driver.FindElement(By.XPath("//*[@id='listing-management-section']/div[2]/div[1]/div[1]/table/tbody/tr[" + i + "]")); //each row and coloum

                    var columnList = row.FindElements(By.TagName("td")).ToList();                                                                    //all coloum

                    for (int j = 1; j <= columnList.Count; j++)
                    {
                        var oldManageList = _driver.FindElement(By.XPath("//*[@id='listing-management-section']/div[2]/div[1]/div[1]/table/tbody/tr[" + i + "]/td[" + j + "]"));  //each row and coloum

                        //click on edit button with specific row and column

                        if (oldManageList.Text == "Code")
                        {
                            isFound = true;

                            _driver.FindElement(By.XPath("//*[@id='listing-management-section']/div[2]/div[1]/div[1]/table/tbody/tr[" + i + "]/td[8]/div/button[2]/i")).Click();   //edit button



                            break;
                        }
                    }
                    if (isFound)
                    {
                        break;
                    }
                }

                if (isFound)
                {
                    Thread.Sleep(1000);
                    //Add Title {edit value update from (Code)}
                    EditTitle.Clear();
                    EditTitle.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "EditTitle"));
                    //Thread.Sleep(1000);
                    GlobalDefinitions.Wait(1000);


                    //Add Description
                    EditDescrp.Clear();
                    EditDescrp.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Description"));
                    //Thread.Sleep(1000);
                    GlobalDefinitions.Wait(1000);


                    //Service type
                    OneOff.Click();
                    //Thread.Sleep(1000);
                    GlobalDefinitions.Wait(1000);


                    //Skill Trade
                    EditCredit.Click();
                    CreditAmount.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "CreditAmount"));
                    //Thread.Sleep(1000);
                    GlobalDefinitions.Wait(1000);


                    Save.Click();
                }
                else
                {
                    Console.WriteLine("Test Fail, Edit un-successful");
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Пример #6
0
        internal void EnterShareSkill()
        {
            int rows;

            rows = GlobalDefinitions.ExcelLib.NumberofRows(@"C:\Users\JIJI\source\repos\marsframework-master\MarsFramework\ExcelData\TestDataShareSkill.xlsx", "ShareSkill");
            //Populate the excel data
            GlobalDefinitions.ExcelLib.PopulateInCollection(@"C:\Users\JIJI\source\repos\marsframework-master\MarsFramework\ExcelData\TestDataShareSkill.xlsx", "ShareSkill");
            Thread.Sleep(1500);

            for (int i = 2; i <= rows + 1; i++)
            {
                Thread.Sleep(1500);
                //Click on Share Skill
                ShareSkillButton.Click();
                //Enter Title
                Thread.Sleep(3500);
                Title.SendKeys(GlobalDefinitions.ExcelLib.ReadData(i, "Title"));
                //Enter Description
                Description.SendKeys(GlobalDefinitions.ExcelLib.ReadData(i, "Description"));
                //Enter Category
                CategoryDropDown.SendKeys(GlobalDefinitions.ExcelLib.ReadData(i, "Category"));
                //Enter Sub-Category
                SubCategoryDropDown.SendKeys(GlobalDefinitions.ExcelLib.ReadData(i, "SubCategory"));
                //Enter Tags
                Tags.SendKeys(GlobalDefinitions.ExcelLib.ReadData(i, "Tags"));
                Tags.SendKeys(Keys.Enter);
                //Enter ServiceType
                String Service = GlobalDefinitions.ExcelLib.ReadData(i, "ServiceType");
                if (Service == "One-off service")
                {
                    ServiceTypeOptions.FindElement(By.XPath("/ html / body / div / div / div[1] / div[2] / div / form / div[5] / div[2] / div[1] / div[2] / div / input")).Click();
                }
                else
                {
                    ServiceTypeOptions.FindElement(By.XPath("/html/body/div/div/div[1]/div[2]/div/form/div[5]/div[2]/div[1]/div[1]/div/input")).Click();
                }
                //Enter LocationType
                String LocationType = GlobalDefinitions.ExcelLib.ReadData(i, "LocationType");
                if (LocationType == "On-site")
                {
                    LocationTypeOption.FindElement(By.XPath("/html/body/div/div/div[1]/div[2]/div/form/div[6]/div[2]/div/div[1]/div/input")).Click();
                }
                else
                {
                    LocationTypeOption.FindElement(By.XPath("/html/body/div/div/div[1]/div[2]/div/form/div[6]/div[2]/div/div[2]/div/input")).Click();
                }
                //Enter Startdate

                //StartDateDropDown.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Startdate").ToString());
                //Enter Enddate
                // EndDateDropDown.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Enddate"));
                //Enter Selectday
                // String Day=GlobalDefinitions.ExcelLib.ReadData(2, "Selectday");
                //if(Day== "Sun")
                //{
                //    Days.FindElement(By.XPath("/html/body/div/div/div[1]/div[2]/div/form/div[7]/div[2]/div[1]/div[2]/div[1]/div/input")).Click();
                //}
                //else if(Day=="Mon")
                //{
                //    Days.FindElement(By.XPath("/html/body/div/div/div[1]/div[2]/div/form/div[7]/div[2]/div[1]/div[3]/div[1]/div/input")).Click();
                // }
                //else if (Day == "Tue")
                //{
                //    Days.FindElement(By.XPath("/html/body/div/div/div[1]/div[2]/div/form/div[7]/div[2]/div[1]/div[4]/div[1]/div/input")).Click();
                //}
                //else if (Day == "Wed")
                //{
                //    Days.FindElement(By.XPath("/html/body/div/div/div[1]/div[2]/div/form/div[7]/div[2]/div[1]/div[5]/div[1]/div/input")).Click();
                //}
                //else if (Day == "Thu")
                //{
                //    Days.FindElement(By.XPath("/html/body/div/div/div[1]/div[2]/div/form/div[7]/div[2]/div[1]/div[6]/div[1]/div/input")).Click();
                //}
                //else if (Day == "Fri")
                //{
                //    Days.FindElement(By.XPath("/html/body/div/div/div[1]/div[2]/div/form/div[7]/div[2]/div[1]/div[7]/div[1]/div/input")).Click();
                //}
                //else if (Day == "Sat")
                //{
                //    Days.FindElement(By.XPath("/html/body/div/div/div[1]/div[2]/div/form/div[7]/div[2]/div[1]/div[8]/div[1]/div/input")).Click();
                //}

                //Enter Starttime
                // StartTimeDropDown.SendKeys(GlobalDefinitions.ExcelLib.ReadData(i, "Starttime"));
                //Enter Endtime
                // EndTimeDropDown.SendKeys(GlobalDefinitions.ExcelLib.ReadData(i, "Endtime"));
                //Enter SkillTrade
                string SkillTrade = GlobalDefinitions.ExcelLib.ReadData(i, "SkillTrade");
                if (SkillTrade == "Skill-Exchange")
                {
                    SkillTradeOption.FindElement(By.XPath("/html/body/div/div/div[1]/div[2]/div/form/div[8]/div[2]/div/div[1]/div/label")).Click();
                }
                else
                {
                    SkillTradeOption.FindElement(By.XPath("/html/body/div/div/div[1]/div[2]/div/form/div[8]/div[2]/div/div[2]/div/label")).Click();
                }
                //Enter Skill-Exchange
                SkillExchange.SendKeys(GlobalDefinitions.ExcelLib.ReadData(i, "Skill-Exchange"));
                SkillExchange.SendKeys(Keys.Enter);
                //Enter Credit
                if (SkillExchange.Text == "Credit")
                {
                    CreditAmount.SendKeys(GlobalDefinitions.ExcelLib.ReadData(i, "Credit"));
                }
                ////Work Sample
                Driver.FindElement(By.XPath("/html/body/div/div/div[1]/div[2]/div/form/div[9]/div/div[2]/section/div/label/div/span/i")).Click();
                AutoItX3 autoit = new AutoItX3();
                autoit.WinActivate("Open");
                Thread.Sleep(1500);
                autoit.ControlSetText("Open", "", "Edit1", StrSendText);
                autoit.ControlClick("Open", "", "Button1");


                //Enter Active
                string Active = GlobalDefinitions.ExcelLib.ReadData(i, "Active");
                if (Active == "Active")
                {
                    ActiveOption.FindElement(By.XPath("/html/body/div/div/div[1]/div[2]/div/form/div[10]/div[2]/div/div[1]/div/input")).Click();
                }
                else
                {
                    ActiveOption.FindElement(By.XPath("/html/body/div/div/div[1]/div[2]/div/form/div[10]/div[2]/div/div[2]/div/input")).Click();
                }
                //Click on save
                Save.Click();
                Thread.Sleep(1500);
            }
        }
Пример #7
0
        public void EditSkill()
        {
            #region populate excel

            //Populate the excel data
            GlobalDefinitions.ExcelLib.PopulateInCollection(MarsResources.ExcelPath, "Managelisting");
            #endregion

            #region Enter Title
            Title.WaitForElementClickable(Global.Base.driver, 60);
            //Enter the data in Title textbox
            Title.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "title"));
            #endregion

            #region Enter Description
            //Enter the data in Description textbox
            Description.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "EnterDescription"));
            #endregion

            #region Category Drop Down

            // Click on Category Dropdown
            Category.Click();
            Thread.Sleep(1000);
            // Select Category from Category Drop Down
            var selectElement = new SelectElement(Category);
            selectElement.SelectByIndex(3);
            // Click on Sub-Category Dropdown
            SubCategory.Click();
            Thread.Sleep(1000);
            //Select Sub-Category from the Drop Down
            var SelectElement1 = new SelectElement(SubCategory);
            SelectElement1.SelectByIndex(4);
            #endregion

            #region Tags
            // Eneter Tag
            Tags.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "TagName"));
            Tags.SendKeys(Keys.Enter);
            Tags.SendKeys(GlobalDefinitions.ExcelLib.ReadData(3, "TagName"));
            Tags.SendKeys(Keys.Enter);
            #endregion

            #region Service Type Selection
            // Service Type Selection
            if (GlobalDefinitions.ExcelLib.ReadData(2, "ServiceType") == "Hourly basis service")
            {
                ServiceTypeHourly.Click();
            }
            else if (GlobalDefinitions.ExcelLib.ReadData(2, "ServiceType") == "One-off service")
            {
                ServiceTypeOnOff.Click();
            }
            #endregion

            #region Select Location Type
            // Location Type Selection

            if (GlobalDefinitions.ExcelLib.ReadData(2, "SelectLocationType") == "On-site")
            {
                LocationTypeOnsite.Click();
            }
            else if (GlobalDefinitions.ExcelLib.ReadData(2, "SelectLocationType") == "Online")
            {
                LocationTypeOnline.Click();
            }
            #endregion

            #region Select Available Dates from Calendar
            // Select Start Date
            //StartDate.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "StartDate"));
            // Select End Date
            EndDate.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "EndDate"));

            // select available days and start time and End time


            IList <IWebElement> Sttim = driver.FindElements(By.Name("StartTime"));
            IList <IWebElement> Edtim = driver.FindElements(By.Name("EndTime"));
            IList <IWebElement> Ckbx  = driver.FindElements(By.XPath("(//input[@name='Available'])"));

            if (Ckbx.Count != 0)
            {
                //Selecting checkboxes for days from Monday to Friday
                for (int i = 1; i <= Ckbx.Count - 2; i++)
                {
                    //Verify whether checkbox is not selected
                    if (!Ckbx.ElementAt(i).Selected)
                    {
                        Ckbx.ElementAt(i).Click();
                    }
                    //Validating the Count

                    Sttim.ElementAt(i).SendKeys(GlobalDefinitions.ExcelLib.ReadData(i + 1, "StartTime"));
                    Thread.Sleep(2000);
                    Edtim.ElementAt(i).SendKeys(GlobalDefinitions.ExcelLib.ReadData(i + 1, "EndTime"));
                    Thread.Sleep(2000);
                }
            }

            #endregion
            #region Select Skill Trade
            // Select Skill Trade
            if (GlobalDefinitions.ExcelLib.ReadData(2, "SelectSkillTrade") == "Skill-exchange")
            {
                SkillExchange.Click();
                RequiredSkills.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "ExchangeSkill"));
                RequiredSkills.SendKeys(Keys.Enter);
                RequiredSkills.SendKeys(GlobalDefinitions.ExcelLib.ReadData(3, "ExchangeSkill"));
                RequiredSkills.SendKeys(Keys.Enter);
            }
            else if (GlobalDefinitions.ExcelLib.ReadData(2, "SelectSkillTrade") == "Credit")

            {
                Credit.Click();
                CreditAmount.Click();
                string input = GlobalDefinitions.ExcelLib.ReadData(2, "AmountInExchange");

                int result = Int32.Parse(input);

                if (result >= 10)
                {
                    SaveScreenShotClass.SaveScreenshot(driver, "More than One digit not Possible");
                    Global.Base.test.Log(Status.Fail, "Two Digit not Added ");
                    Assert.Fail("Entering more than One digit not Possible");
                }
                else
                {
                    CreditAmount.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "AmountInExchange"));
                    CreditAmount.SendKeys(Keys.Enter);
                }
            }
            #endregion

            #region Select User Status
            // Select User Status

            if (GlobalDefinitions.ExcelLib.ReadData(2, "UserStatus") == "Active")
            {
                StatusActive.Click();
            }
            else if (GlobalDefinitions.ExcelLib.ReadData(2, "UserStatus") == "Hidden")
            {
                StatusHidden.Click();
            }
            #endregion



            #region Save / Cancel Skill
            // Save or Cancel New Skill
            if (Global.GlobalDefinitions.ExcelLib.ReadData(2, "SaveOrCancel") == "Save")
            {
                Save.Click();
            }
            else if (Global.GlobalDefinitions.ExcelLib.ReadData(2, "SaveOrCancel") == "Cancel")
            {
                Cancel.Click();
            }
            #endregion

            Thread.Sleep(3000);
            #region Check whether New  skill updated sucessfully

            //String expectedValue = GlobalDefinitions.ExcelLib.ReadData(2, "title");
            // Validate view listing through Page title
            String actualTitle = driver.Title;

            // Assert.AreEqual(actualTitle, "ListingManagement");

            if (actualTitle == "ListingManagement")
            {
                Assert.IsTrue(true);
                Global.Base.test.Log(Status.Pass, "Shared Skill Successful");
                SaveScreenShotClass.SaveScreenshot(driver, "AddShareSkill");
            }
            else
            {
                Console.WriteLine("Test failed");
                SaveScreenShotClass.SaveScreenshot(driver, "FailedAddShareSkill");
                Global.Base.test.Log(Status.Fail, "Share Skill Unsuccessful");
            }
            #endregion
        }
Пример #8
0
        internal void EnterShareSkill()
        {
            try
            {
                //Populate the excel data
                GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "ShareSkill");
                //Click on Share Skill button
                ShareSkillButton.Click();
                //Enter the Title
                Title.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Title"));
                //Enter the Description
                Description.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Description"));
                //Choose the Category
                SelectElement Category = new SelectElement(CategoryDropDown);
                Category.SelectByText(GlobalDefinitions.ExcelLib.ReadData(2, "Category"));
                //Choose the Sub Category
                SelectElement SubCategory = new SelectElement(SubCategoryDropDown);
                SubCategory.SelectByText(GlobalDefinitions.ExcelLib.ReadData(2, "SubCategory"));
                //Enter the tags
                Tags.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Tags"));
                //Click the Enter button
                Tags.SendKeys(Keys.Enter);
                //Click on Service type radio button
                if (GlobalDefinitions.ExcelLib.ReadData(2, "ServiceType") == ServiceTypeOptionsText1.Text)
                {
                    if (!ServiceTypeOptions1.Selected)
                    {
                        ServiceTypeOptions1.Click();
                    }
                }
                else if (GlobalDefinitions.ExcelLib.ReadData(2, "ServiceType") == ServiceTypeOptionsText2.Text)
                {
                    if (!ServiceTypeOptions2.Selected)
                    {
                        GlobalDefinitions.wait(5000);
                        ServiceTypeOptions2.Click();
                    }
                }
                //Click on Location type radio button
                if (GlobalDefinitions.ExcelLib.ReadData(2, "LocationType") == LocationTypeOptionsText1.Text)
                {
                    GlobalDefinitions.wait(5000);
                    if (!LocationTypeOptions1.Selected)
                    {
                        GlobalDefinitions.wait(5000);
                        LocationTypeOptions1.Click();
                    }
                }
                else if (GlobalDefinitions.ExcelLib.ReadData(2, "LocationType") == LocationTypeOptionsText2.Text)
                {
                    if (!LocationTypeOptions2.Selected)
                    {
                        GlobalDefinitions.wait(5000);
                        LocationTypeOptions2.Click();
                    }
                }
                #region radio buttons
                //Click on Skill trade radio button

                if (GlobalDefinitions.ExcelLib.ReadData(2, "SkillTrade") == SkillTradeOptionText1.Text)
                {
                    if (!SkillTradeOption1.Selected)
                    {
                        SkillTradeOption1.Click();
                    }
                    //Enter the tag name in Skill exchange and press Enter key
                    SkillExchange.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Skill-Exchange"));
                    SkillExchange.SendKeys(Keys.Enter);
                    //}
                }
                else if (GlobalDefinitions.ExcelLib.ReadData(2, "SkillTrade") == SkillTradeOptionText2.Text)
                {
                    SkillTradeOption2.Click();
                    CreditAmount.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Credit"));
                }
                //Click on Active radio buttons
                if (GlobalDefinitions.ExcelLib.ReadData(2, "Active") == ActiveOptionText1.Text)
                {
                    if (!ActiveOption1.Selected)
                    {
                        ActiveOption1.Click();
                    }
                }
                else if (GlobalDefinitions.ExcelLib.ReadData(2, "Active") == ActiveOptionText2.Text)
                {
                    ActiveOption2.Click();
                }
                #endregion
                //Click on File Upload
                FileUpload.Click();
                //Using AutoIt
                // AutoItx Autoit = new AutoItx();
                AutoItX.WinActivate("Open");
                AutoItX.Sleep(500);
                AutoItX.Send(@"C:\Users\anvil\Desktop\TestAnalyst.txt");
                //GlobalDefinitions.wait(1200);
                AutoItX.Send("{ENTER}");
                //StartDateDropDown.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Startdate"));
                GlobalDefinitions.wait(10000);
                Save.Click();
                GlobalDefinitions.wait(10000);
                Assert.Pass("Successfully Service Listing is Added");
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
Пример #9
0
        public void AddNewSkill()
        {
            #region Navigate to Share Skills Page
            // Click on Share Skills Page
            ShareSkill.WaitForElementClickable(Global.Base.driver, 60);
            ShareSkill.Click();
            //Populate the excel data
            GlobalDefinitions.ExcelLib.PopulateInCollection(MarsResources.ExcelPath, "ShareSkills");
            #endregion

            #region Enter Title
            Title.WaitForElementClickable(Global.Base.driver, 60);
            //Enter the data in Title textbox
            Title.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "title"));
            #endregion

            #region Enter Description
            //Enter the data in Description textbox
            Description.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "EnterDescription"));
            #endregion

            #region Category Drop Down

            // Click on Category Dropdown
            Category.Click();
            // Select Category from Category Drop Down
            var SelectElement = new SelectElement(Category);
            SelectElement.SelectByText((GlobalDefinitions.ExcelLib.ReadData(2, "category")));
            // Click on Sub-Category Dropdown
            SubCategory.Click();
            //Select Sub-Category from the Drop Down
            var SelectElement1 = new SelectElement(SubCategory);
            SelectElement1.SelectByText((GlobalDefinitions.ExcelLib.ReadData(2, "subcategory")));
            #endregion

            #region Tags
            // Eneter Tag
            Tags.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "TagName"));
            Tags.SendKeys(Keys.Enter);
            Tags.SendKeys(GlobalDefinitions.ExcelLib.ReadData(3, "TagName"));
            Tags.SendKeys(Keys.Enter);
            #endregion

            #region Service Type Selection
            // Service Type Selection
            if (GlobalDefinitions.ExcelLib.ReadData(2, "ServiceType") == "Hourly basis service")
            {
                ServiceTypeHourly.Click();
            }
            else if (GlobalDefinitions.ExcelLib.ReadData(2, "ServiceType") == "One-off service")
            {
                ServiceTypeOnOff.Click();
            }
            #endregion

            #region Select Location Type
            // Location Type Selection

            if (GlobalDefinitions.ExcelLib.ReadData(2, "SelectLocationType") == "On-site")
            {
                LocationTypeOnsite.Click();
            }
            else if (GlobalDefinitions.ExcelLib.ReadData(2, "SelectLocationType") == "Online")
            {
                LocationTypeOnline.Click();
            }
            #endregion

            #region Select Available Dates from Calendar
            // Select Start Date
            //StartDate.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "StartDate"));
            // Select End Date

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

            // select available days and start time and End time

            // select available days and start time and End time
            Thread.Sleep(3000);
            IList <IWebElement> Sttim = driver.FindElements(By.Name("StartTime"));

            IList <IWebElement> Edtim = driver.FindElements(By.Name("EndTime"));
            //Driver.FindElements(By.Name("EndTime"));
            IList <IWebElement> Ckbx = driver.FindElements(By.XPath("(//input[@name='Available'])"));

            if (Ckbx.Count != 0)
            {
                //Selecting checkboxes for days from Monday to Friday
                for (int i = 1; i <= Ckbx.Count - 2; i++)
                {
                    //Verify whether checkbox is not selected
                    if (!Ckbx.ElementAt(i).Selected)
                    {
                        Ckbx.ElementAt(i).Click();
                    }
                    Console.WriteLine(driver);
                    //Validating the Count


                    Sttim.ElementAt(i).SendKeys(GlobalDefinitions.ExcelLib.ReadData(i + 1, "StartTime"));
                    // Sttim.ElementAt(i).SendKeys("10:00");


                    /*  var Svalue = Sttim.ElementAt(i).GetAttribute("value");
                     * Console.WriteLine(Svalue);
                     * Sttim.ElementAt(i).SendKeys(Svalue);*/

                    Thread.Sleep(2000);
                    // Sttim.ElementAt(i).Clear();
                    Edtim.ElementAt(i).SendKeys(GlobalDefinitions.ExcelLib.ReadData(i + 1, "EndTime"));
                    // Edtim.ElementAt(i).SendKeys("18:00");
                    Thread.Sleep(2000);
                }
            }



            #endregion
            #region Select Skill Trade
            // Select Skill Trade
            if (GlobalDefinitions.ExcelLib.ReadData(2, "SelectSkillTrade") == "Skill-exchange")
            {
                SkillExchange.Click();
                RequiredSkills.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "ExchangeSkill"));
                RequiredSkills.SendKeys(Keys.Enter);
                RequiredSkills.SendKeys(GlobalDefinitions.ExcelLib.ReadData(3, "ExchangeSkill"));
                RequiredSkills.SendKeys(Keys.Enter);
            }
            else if (GlobalDefinitions.ExcelLib.ReadData(2, "SelectSkillTrade") == "Credit")
            {
                CreditAmount.Click();
                CreditAmount.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "AmountInExchange"));
                CreditAmount.SendKeys(Keys.Enter);
            }
            #endregion

            #region Select User Status
            // Select User Status

            if (GlobalDefinitions.ExcelLib.ReadData(2, "UserStatus") == "Active")
            {
                StatusActive.Click();
            }
            else if (GlobalDefinitions.ExcelLib.ReadData(2, "UserStatus") == "Hidden")
            {
                StatusHidden.Click();
            }
            #endregion



            #region Save / Cancel Skill
            // Save or Cancel New Skill
            if (Global.GlobalDefinitions.ExcelLib.ReadData(2, "SaveOrCancel") == "Save")
            {
                Save.Click();
            }
            else if (Global.GlobalDefinitions.ExcelLib.ReadData(2, "SaveOrCancel") == "Cancel")
            {
                Cancel.Click();
            }
            #endregion
            Thread.Sleep(3000);
            #region Check whether New  skill created sucessfully

            //String expectedValue = GlobalDefinitions.ExcelLib.ReadData(2, "title");
            String actualTitle = driver.Title;
            //string ShareSkillSucess = Driver.FindElement(By.TagName("h2")).Text;
            if (actualTitle == "ListingManagement")
            {
                Assert.IsTrue(true);
                Global.Base.test.Log(Status.Pass, "Shared Skill Successful");
                SaveScreenShotClass.SaveScreenshot(driver, "AddShareSkill");
            }
            else
            {
                Console.WriteLine("Test failed");
                SaveScreenShotClass.SaveScreenshot(driver, "FailedAddShareSkill");
                Global.Base.test.Log(Status.Fail, "Share Skill Unsuccessful");
            }
            #endregion
        }
Пример #10
0
        //Add share skill details
        internal void EnterShareSkill()
        {
            //Populate the excel data

            GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "ShareSkill");

            try
            {
                #region Navigate to Share Skills Page
                //Click on Share skill button
                GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "LinkText", "Share Skill", 10000);
                ShareSkillButton.Click();
                #endregion

                #region Enter Title
                //Enter the Title in textbox
                GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "Name", "title", 10000);
                Title.Click();
                Title.Clear();
                Title.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Title"));
                #endregion

                #region Enter Description
                //Enter the Description in textbox
                GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "Name", "description", 10000);
                Description.Click();
                Description.Clear();
                Description.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Description"));
                #endregion

                #region Category Drop Down
                //Select catagory from drop down
                GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "Name", "categoryId", 10000);
                CategoryDropDown.Click();
                new SelectElement(CategoryDropDown).SelectByText(GlobalDefinitions.ExcelLib.ReadData(2, "Category"));

                //Select catagory from drop down
                GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "Name", "subcategoryId", 10000);
                SubCategoryDropDown.Click();
                new SelectElement(SubCategoryDropDown).SelectByText(GlobalDefinitions.ExcelLib.ReadData(2, "SubCategory"));
                #endregion

                #region Tags
                //Enter Tag names in textbox
                GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "XPath", "//input[@value='']", 10000);
                Tags.Click();
                Tags.Clear();
                Tags.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Tags"));
                Tags.SendKeys(Keys.Enter);
                #endregion

                #region Service Type Selection
                //Select service type
                if (GlobalDefinitions.ExcelLib.ReadData(2, "ServiceType") == "Hourly basis service")
                {
                    GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "XPath", "//form/div[5]/div[@class='twelve wide column']/div/div[@class='field']", 10000);
                    ServiceTypeOptions.Click();
                    ServicetypeHourly.Click();
                }
                else if (GlobalDefinitions.ExcelLib.ReadData(2, "ServiceType") == "One-off service")
                {
                    GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "XPath", "//form/div[5]/div[@class='twelve wide column']/div/div[@class='field']", 10000);
                    ServiceTypeOptions.Click();
                    ServicetypeOneOff.Click();
                }
                #endregion

                #region Select Location Type
                //Select the Location Type
                if (GlobalDefinitions.ExcelLib.ReadData(2, "LocationType") == "On-site")
                {
                    GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "XPath", "//form/div[6]/div[@class='twelve wide column']/div/div[@class = 'field']", 10000);
                    LocationTypeOption.Click();
                    LocationSelOnsite.Click();
                }
                else if (GlobalDefinitions.ExcelLib.ReadData(2, "LocationType") == "Online")
                {
                    GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "XPath", "//form/div[6]/div[@class='twelve wide column']/div/div[@class = 'field']", 10000);
                    LocationTypeOption.Click();
                    LocationSelOnline.Click();
                }

                #endregion


                #region Select Available Dates from Calendar
                //Add start date
                StartDateDropDown.Click();
                // StartDateDropDown.Clear();
                StartDateDropDown.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Startdate"));

                //Add End date
                EndDateDropDown.Click();
                //EndDateDropDown.Clear();
                EndDateDropDown.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Enddate"));


                //Select available days
                GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "XPath", "//body/div/div/div[@id='service-listing-section']/div[@class='ui container']/div[@class='listing']/form[@class='ui form']/div[7]/div[2]/div[1]", 10000);
                Days.Click();
                Mon.Click();
                Tue.Click();
                Wed.Click();
                Thurs.Click();

                //Select start time and enter the time
                GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "XPath", "//*[@id='service-listing-section']/div[2]/div/form/div[7]/div[2]/div/div[3]/div[2]/input", 10000);
                StartTimeM.Click();

                StartTimeDropDownM.Click();

                StartTimeM.SendKeys(DateTime.Parse(GlobalDefinitions.ExcelLib.ReadData(2, "Starttime")).ToString("hh:mmtt"));

                GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "XPath", "//*[@id='service-listing-section']/div[2]/div/form/div[7]/div[2]/div/div[4]/div[2]/input", 10000);
                StartTimeT.Click();

                StartTimeDropDownT.Click();

                StartTimeT.SendKeys(DateTime.Parse(GlobalDefinitions.ExcelLib.ReadData(2, "Starttime")).ToString("hh:mmtt"));

                GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "XPath", "//*[@id='service-listing-section']/div[2]/div/form/div[7]/div[2]/div/div[5]/div[2]/input", 10000);
                StartTimeW.Click();

                StartTimeDropDownW.Click();

                StartTimeW.SendKeys(DateTime.Parse(GlobalDefinitions.ExcelLib.ReadData(2, "Starttime")).ToString("hh:mmtt"));

                GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "XPath", "//*[@id='service-listing-section']/div[2]/div/form/div[7]/div[2]/div/div[6]/div[2]/input", 10000);
                StartTimeTh.Click();

                StartTimeDropDownTh.Click();

                StartTimeTh.SendKeys(DateTime.Parse(GlobalDefinitions.ExcelLib.ReadData(2, "Starttime")).ToString("hh:mmtt"));



                //Select end time from box
                GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "XPath", "//*[@id='service-listing-section']/div[2]/div/form/div[7]/div[2]/div/div[3]/div[3]/input", 10000);
                EndTimeM.Click();

                EndTimeDropDownM.Click();

                EndTimeM.SendKeys(DateTime.Parse(GlobalDefinitions.ExcelLib.ReadData(2, "Endtime")).ToString("hh:mmtt"));

                GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "XPath", "//*[@id='service-listing-section']/div[2]/div/form/div[7]/div[2]/div/div[4]/div[3]/input", 10000);
                EndTimeT.Click();

                EndTimeDropDownT.Click();

                EndTimeT.SendKeys(DateTime.Parse(GlobalDefinitions.ExcelLib.ReadData(2, "Endtime")).ToString("hh:mmtt"));

                GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "XPath", "//*[@id='service-listing-section']/div[2]/div/form/div[7]/div[2]/div/div[5]/div[3]/input", 10000);
                EndTimeW.Click();

                EndTimeDropDownW.Click();

                EndTimeW.SendKeys(DateTime.Parse(GlobalDefinitions.ExcelLib.ReadData(2, "Endtime")).ToString("hh:mmtt"));

                GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "XPath", "//*[@id='service-listing-section']/div[2]/div/form/div[7]/div[2]/div/div[6]/div[3]/input", 10000);
                EndTimeTh.Click();

                EndTimeDropDownTh.Click();

                EndTimeTh.SendKeys(DateTime.Parse(GlobalDefinitions.ExcelLib.ReadData(2, "Endtime")).ToString("hh:mmtt"));
                Thread.Sleep(1000);
                #endregion

                #region Select Skill Trade
                //Click on Skill trade option

                if (GlobalDefinitions.ExcelLib.ReadData(2, "SkillTrade") == "Skill-Exchange")
                {
                    GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "XPath", "//form/div[8]/div[@class='twelve wide column']/div/div[@class='field']", 10000);
                    SkillTradeOption.Click();

                    //Add Skill exchange tag
                    GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "XPath", "//*[@id='service-listing-section']/div[2]/div/form/div[8]/div[4]/div/div/div/div/div/input", 10000);
                    SkillExchange.Click();
                    SkillExchange.Clear();
                    SkillExchange.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Skill-Exchange"));
                    SkillExchange.SendKeys(Keys.Enter);
                }
                else if (GlobalDefinitions.ExcelLib.ReadData(2, "SkillTrade") == "Credit")
                {
                    GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "XPath", "//form/div[8]/div[@class='twelve wide column']/div/div[@class='field']", 10000);
                    SkillTradeOption.Click();
                    CreditBtn.Click();

                    //Addcredit amount
                    GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "XPath", "//*[@id='service-listing-section']/div[2]/div/form/div[8]/div[4]/div/div/input", 10000);
                    CreditAmount.Click();
                    CreditAmount.Clear();
                    CreditAmount.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "AmountInExchange"));
                    CreditAmount.SendKeys(Keys.Enter);
                }

                #endregion

                #region Add Work Sample


                FileUpload.Click();

                AutoItX3 autoIt = new AutoItX3();
                AutoItX.WinWait("Open", "File Upload", 1);
                autoIt.WinActivate("Open");
                Thread.Sleep(2000);
                var SampleWorkPath = MarsResource.SampleWorkPath;
                autoIt.Send(Path.GetFullPath(SampleWorkPath));
                Thread.Sleep(2000);
                autoIt.Send("{Enter}");
                Thread.Sleep(2000);



                #endregion

                #region Select User Status
                //Select option Active or Hidden
                if (GlobalDefinitions.ExcelLib.ReadData(2, "UserStatus") == "Active")
                {
                    GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "XPath", "//form/div[10]/div[@class='twelve wide column']/div/div[@class = 'field']", 10000);
                    ActiveOption.Click();
                }
                else if (GlobalDefinitions.ExcelLib.ReadData(2, "UserStatus") == "Hidden")
                {
                    GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "XPath", "//form/div[10]/div[@class='twelve wide column']/div/div[@class = 'field']", 10000);
                    ActiveOption.Click();
                    HiddenOpt.Click();
                }
                #endregion


                #region Save / Cancel Skill
                // Save or Cancel New Skill

                if (Global.GlobalDefinitions.ExcelLib.ReadData(2, "SaveOrCancel") == "Save")
                {
                    GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "XPath", "//input[@value='Save']", 10000);
                    Save.Click();
                }
                else if (Global.GlobalDefinitions.ExcelLib.ReadData(2, "SaveOrCancel") == "Cancel")
                {
                    Cancel.Click();
                }
                #endregion
            }

            catch (Exception ex)
            {
                Assert.Fail("Test failed to enter Skill details", ex.Message);
            }
        }
Пример #11
0
        internal void EditShareSkill()
        {
            GlobalDefinitions.ExcelLib.PopulateInCollection(@"C:\Users\Owner\source\repos\marsframework-master\MarsFramework-master\MarsFramework\ExcelData\TestDataShareSkill.xlsx", "ShareSkill");
            GlobalDefinitions.wait(30);

            //Click on ShareSkill button
            //ShareSkillButton.Click();

            //Wait
            GlobalDefinitions.wait(30);

            //Enter data in Title textbox
            Title.Clear();
            Title.SendKeys(GlobalDefinitions.ExcelLib.ReadData(3, "Title"));
            string TitleTextbox = Title.GetAttribute("Value");

            if (TitleTextbox.Length == 0)
            {
                Assert.IsEmpty("Title");
            }

            //Enter data in Description textbox
            Description.Clear();
            Description.SendKeys(GlobalDefinitions.ExcelLib.ReadData(3, "Description"));
            Assert.That(Description.Text, Is.EqualTo(GlobalDefinitions.ExcelLib.ReadData(3, "Description")));

            CategoryDropDown.SendKeys(GlobalDefinitions.ExcelLib.ReadData(3, "Category"));
            CategoryDropDown.Click();

            SubCategoryDropDown.SendKeys(GlobalDefinitions.ExcelLib.ReadData(3, "SubCategory"));
            SubCategoryDropDown.Click();

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

            //Click on Hourly basis service or One-off service
            if (GlobalDefinitions.ExcelLib.ReadData(3, "Service Type") == "Hourly basis service")
            {
                Hourlybasisservice.Click();
            }
            else if (GlobalDefinitions.ExcelLib.ReadData(3, "Service Type") == "One-off service")
            {
                OneOffservice.Click();
            }

            //Click on On-site or Online
            if (GlobalDefinitions.ExcelLib.ReadData(3, "Location Type") == "On-site")
            {
                OnSite.Click();
            }
            else if (GlobalDefinitions.ExcelLib.ReadData(3, "Location Type") == "Online")
            {
                Online.Click();
            }

            //Wait
            GlobalDefinitions.wait(60);

            //Convert excel dateformat to C# - Enter data in Staredate
            string dateformat   = "dd / MM / yyyy";
            string sdate        = GlobalDefinitions.ExcelLib.ReadData(3, "Startdate");
            string newStartDate = DateTime.Parse(sdate).ToString(dateformat);

            StartDateDropDown.SendKeys(newStartDate);

            string StartDate = StartDateDropDown.GetAttribute("Value");

            if (StartDate.Length == 0)
            {
                Assert.IsEmpty("Startdate");
            }

            //Convert excel dateformat to C# - Enter data in Enddate
            //  string edate = GlobalDefinitions.ExcelLib.ReadData(3, "Enddate");
            //  string newEndDate = DateTime.Parse(edate).ToString(dateformat);
            // EndDateDropDown.SendKeys(newEndDate);
            EndDateDropDown.SendKeys("04152020");

            string EndDate = EndDateDropDown.GetAttribute("Value");

            if (EndDate.Length == 0)
            {
                Assert.IsEmpty("Enddate");
            }

            //Wait
            GlobalDefinitions.wait(60);

            //Click on a day
            Days.Click();

            //Convert excel timeformat to C# - enter data in Starttime
            string timeformat   = "hh:mmtt";
            string stime        = GlobalDefinitions.ExcelLib.ReadData(3, "Starttime");
            string newStartTime = DateTime.Parse(stime).ToString(timeformat);

            StartTimeDropDown.SendKeys(newStartTime);

            string Start = StartTimeDropDown.GetAttribute("Value");

            if (Start.Length == 0)
            {
                Assert.IsEmpty("Starttime");
            }

            //Convert excel timeformat to C# - enter data in Endtime
            // string etime = GlobalDefinitions.ExcelLib.ReadData(3, "Endtime");
            // string newEndTime = DateTime.Parse(etime).ToString(timeformat);
            // EndTimeDropDown.SendKeys(newEndTime);

            //string End = EndTimeDropDown.GetAttribute("Value");
            // if (End.Length == 0)
            // {
            //    Assert.IsEmpty("Endtime");
            // }

            //Click on Skill-exchange or Credit
            if (GlobalDefinitions.ExcelLib.ReadData(3, "SkillTrade") == "Skill-exchange")
            {
                SkillExchangeOption.Click();
                SkillExchange.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Skill-Exchange"));
                SkillExchange.SendKeys(Keys.Enter);
            }
            else if (GlobalDefinitions.ExcelLib.ReadData(3, "SkillTrade") == "Credit")
            {
                CreditOption.Click();
                CreditAmount.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Credit"));
            }


            //Click on Active or Hidden
            ActiveOption.Click();
            if (GlobalDefinitions.ExcelLib.ReadData(3, "Active") == "Active")
            {
                ActiveOption.Click();
            }
            else if (GlobalDefinitions.ExcelLib.ReadData(3, "Active") == "Hidden")
            {
                HiddenOption.Click();
            }

            //Upload a file
            WorkSample.Click();

            GlobalDefinitions.wait(20);
            // String path = GlobalDefinitions.ExcelLib.ReadData(2, "WorkSample");

            AutoItX.WinWaitActive("Open");

            //Wait
            GlobalDefinitions.wait(70);
            AutoItX.Send(@"C:\ProjMars\language.txt");
            AutoItX.Sleep(5);

            // AutoItX.Send(path);
            AutoItX.Send("{ENTER}");

            Save.Click();
        }
        internal void EditShareSkill()
        {
            GlobalDefinitions.ExcelLib.PopulateInCollections(Base.ExcelPath, "ShareSkill");
            GlobalDefinitions.wait(60);

            //Click on ShareSkill button
            ShareSkillButton.Click();

            //Wait
            GlobalDefinitions.wait(30);

            //Enter data in Title textbox
            Title.SendKeys(GlobalDefinitions.ExcelLib.ReadData(3, "Title"));
            string TitleTextbox = Title.GetAttribute("Value");

            if (TitleTextbox.Length == 0)
            {
                Assert.IsEmpty("Title");
            }

            //Enter data in Description textbox
            Description.SendKeys(GlobalDefinitions.ExcelLib.ReadData(3, "Description"));
            Assert.That(Description.Text, Is.EqualTo(GlobalDefinitions.ExcelLib.ReadData(3, "Description")));

            CategoryDropDown.SendKeys(GlobalDefinitions.ExcelLib.ReadData(3, "Category"));
            CategoryDropDown.Click();

            SubCategoryDropDown.SendKeys(GlobalDefinitions.ExcelLib.ReadData(3, "SubCategory"));
            SubCategoryDropDown.Click();

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

            //Click on Hourly basis service or One-off service
            if (GlobalDefinitions.ExcelLib.ReadData(3, "Service Type") == "Hourly basis service")
            {
                Hourlybasisservice.Click();
            }
            else if (GlobalDefinitions.ExcelLib.ReadData(3, "Service Type") == "One-off service")
            {
                OneOffservice.Click();
            }

            //Click on On-site or Online
            if (GlobalDefinitions.ExcelLib.ReadData(3, "Location Type") == "On-site")
            {
                OnSite.Click();
            }
            else if (GlobalDefinitions.ExcelLib.ReadData(3, "Location Type") == "Online")
            {
                Online.Click();
            }

            //Wait
            GlobalDefinitions.wait(60);

            //Convert excel dateformat to C# - Enter data in Staredate
            string dateformat   = "dd / MM / yyyy";
            string sdate        = GlobalDefinitions.ExcelLib.ReadData(3, "Startdate");
            string newStartDate = DateTime.Parse(sdate).ToString(dateformat);

            StartDateDropDown.SendKeys(newStartDate);

            string StartDate = StartDateDropDown.GetAttribute("Value");

            if (StartDate.Length == 0)
            {
                Assert.IsEmpty("Startdate");
            }

            //Convert excel dateformat to C# - Enter data in Enddate
            string edate      = GlobalDefinitions.ExcelLib.ReadData(3, "Enddate");
            string newEndDate = DateTime.Parse(edate).ToString(dateformat);

            EndDateDropDown.SendKeys(newEndDate);

            string EndDate = EndDateDropDown.GetAttribute("Value");

            if (EndDate.Length == 0)
            {
                Assert.IsEmpty("Enddate");
            }

            //Wait
            GlobalDefinitions.wait(60);

            //Click on a day
            Days.Click();

            //Convert excel timeformat to C# - enter data in Starttime
            string timeformat   = "hh:mmtt";
            string stime        = GlobalDefinitions.ExcelLib.ReadData(3, "Starttime");
            string newStartTime = DateTime.Parse(stime).ToString(timeformat);

            StartTimeDropDown.SendKeys(newStartTime);

            string Start = StartTimeDropDown.GetAttribute("Value");

            if (Start.Length == 0)
            {
                Assert.IsEmpty("Starttime");
            }

            //Convert excel timeformat to C# - enter data in Endtime
            string etime      = GlobalDefinitions.ExcelLib.ReadData(3, "Endtime");
            string newEndTime = DateTime.Parse(etime).ToString(timeformat);

            EndTimeDropDown.SendKeys(newEndTime);

            string End = EndTimeDropDown.GetAttribute("Value");

            if (End.Length == 0)
            {
                Assert.IsEmpty("Endtime");
            }

            //Click on Skill-exchange or Credit
            if (GlobalDefinitions.ExcelLib.ReadData(3, "SkillTrade") == "Skill-exchange")
            {
                SkillExchangeOption.Click();
                SkillExchange.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Skill-Exchange"));
                SkillExchange.SendKeys(Keys.Enter);
            }
            else if (GlobalDefinitions.ExcelLib.ReadData(3, "SkillTrade") == "Credit")
            {
                CreditOption.Click();
                CreditAmount.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Credit"));
            }


            //Click on Active or Hidden
            ActiveOption.Click();
            if (GlobalDefinitions.ExcelLib.ReadData(3, "Active") == "Active")
            {
                ActiveOption.Click();
            }
            else if (GlobalDefinitions.ExcelLib.ReadData(3, "Active") == "Hidden")
            {
                HiddenOption.Click();
            }

            //Upload a file
            WorkSample.Click();
            GlobalDefinitions.wait(60);
            string path = GlobalDefinitions.ExcelLib.ReadData(3, "WorkSample");

            AutoItX.WinActivate("File Upload");

            //Wait
            GlobalDefinitions.wait(60);

            AutoItX.Send(path);
            AutoItX.Send("{ENTER}");

            Save.Click();

            Assert.That(ManageTitle.Text, Is.EqualTo("Voice Actor"));
        }
Пример #13
0
        internal void EnterShareSkill()
        {
            //GlobalDefinitions.ExcelLib.PopulateInCollection(@"C:\Users\kranthi\source\repos\marsframework-master\marsframework-master\MarsFramework\ExcelData\TestDataShareSkill.xlsx", "ShareSkill");
            GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "ShareSkill");

            By WaitCondition = By.XPath("//a[text()=\"Share Skill\"]");

            GlobalDefinitions.WaitForElement(GlobalDefinitions.driver, WaitCondition, 60);


            //Click on ShareSkill button to enter the details of skill
            ShareSkillButton.Click();

            By WaitCondition1 = By.XPath("//input[@name='title']");

            GlobalDefinitions.WaitForElement(GlobalDefinitions.driver, WaitCondition1, 60);

            //Enter value for Title field
            Title.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Title"));

            //Enter value for Description field
            Description.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Description"));

            //Select value for Category
            SelectElement Category = new SelectElement(CategoryDropDown);

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

            //Select value for SubCategory
            SelectElement SubCategory = new SelectElement(SubCategoryDropDown);

            SubCategory.SelectByText(GlobalDefinitions.ExcelLib.ReadData(2, "SubCategory"));

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

            //Select Service type
            string ServiceType = GlobalDefinitions.ExcelLib.ReadData(2, "ServiceType");

            if (ServiceType == "One-off service")
            {
                ServiceTypeOptions.FindElement(By.XPath("//label[contains(text(),'One-off')]")).Click();
            }
            else
            {
                ServiceTypeOptions.FindElement(By.XPath("//label[contains(text(),'Hourly')]")).Click();
            }

            //Select Location type
            string LocationType = GlobalDefinitions.ExcelLib.ReadData(2, "LocationType");

            if (LocationType == "On-site")
            {
                LocationTypeOption.FindElement(By.XPath("//label[contains(text(),'On-site')]")).Click();
            }
            else
            {
                LocationTypeOption.FindElement(By.XPath("//label[contains(text(),'Online')]")).Click();
            }

            //Enter Calender values
            //SelectElement StartDate = new SelectElement(StartDateDropDown);

            //Click on Skill-Trade Option
            string SkillTrade = GlobalDefinitions.ExcelLib.ReadData(2, "SkillTrade");

            if (SkillTrade == "Skill-Exchange")
            {
                SkillTradeOption.FindElement(By.XPath("//label[contains(text(),'Skill-exchange')]")).Click();
                SkillExchange.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Skill-Exchange"));
                SkillExchange.SendKeys(Keys.Enter);
            }
            else
            {
                SkillTradeOption.FindElement(By.XPath("//label[contains(text(),'Credit')]")).Click();
                CreditAmount.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "CreditAmount"));
            }


            IWebElement Sample = GlobalDefinitions.driver.FindElement(By.XPath("//i[@class='huge plus circle icon padding-25']"));

            Sample.Click();

            Thread.Sleep(1500);

            AutoItX3 AutoIT = new AutoItX3();

            AutoIT.WinActivate("Open");

            Thread.Sleep(1500);

            AutoIT.Send(Base.ImagePath);

            Thread.Sleep(1500);

            AutoIT.Send("{ENTER}");

            //Click on Active field
            string Activefield = GlobalDefinitions.ExcelLib.ReadData(2, "Active");

            if (Activefield == "Active")
            {
                ActiveOption.FindElement(By.XPath("//label[contains(text(),'Active')]"));
            }
            else
            {
                ActiveOption.FindElement(By.XPath("//label[contains(text(),'Hidden')]"));
            }

            Save.Click();
        }