Esempio n. 1
0
        internal void EditShareSkillData()
        {
            //Calling wait method
            GenericWait.ElementExists(GlobalDefinitions.driver, "Name", "title", 8);

            //Clearing the "Title"
            Title.Clear();

            //Entering the updated "Title"
            Title.SendKeys(GlobalDefinitions.ExcelLib.ReadData(4, "Title"));
            //Validating Title
            GlobalDefinitions.TextDataFieldValidation("Title", GlobalDefinitions.ExcelLib.ReadData(2, "Title"), Title.GetAttribute("value"));

            //Clearing the "Description"
            Description.Clear();

            //Entering the updated "Description"
            Description.SendKeys(GlobalDefinitions.ExcelLib.ReadData(4, "Description"));
            //Validating Description
            GlobalDefinitions.TextDataFieldValidation("Description", GlobalDefinitions.ExcelLib.ReadData(4, "Description"), Description.Text);

            // Select the Service type radio button
            HelperCallingMethods.SelectingRadiobutton("//form/div[5]/div[@class='twelve wide column']/div/div[@class='field']", "serviceType", GlobalDefinitions.ExcelLib.ReadData(4, "ServiceType"));
            //Validating Service Type Radiobutton selection
            GlobalDefinitions.RadiobuttonValidation("ServiceTypeRadioButtons", "//form/div[5]/div[@class='twelve wide column']/div/div[@class='field']", "serviceType", GlobalDefinitions.ExcelLib.ReadData(4, "ServiceType"));

            // Select the Location type radio button
            HelperCallingMethods.SelectingRadiobutton("//form/div[6]/div[@class='twelve wide column']/div/div[@class = 'field']", "locationType", GlobalDefinitions.ExcelLib.ReadData(4, "LocationType"));
            //Validating Location Type Radiobutton selection
            GlobalDefinitions.RadiobuttonValidation("LocationTypeRadioButtons", "//form/div[6]/div[@class='twelve wide column']/div/div[@class = 'field']", "locationType", GlobalDefinitions.ExcelLib.ReadData(4, "LocationType"));
        }
Esempio n. 2
0
        public void AddLanguage()
        {
            for (int i = 1; i <= NumberOfLanguagesToAdd; i++)

            {
                //Reading language data from excel sheet
                String languageData = GlobalDefinitions.ExcelLib.ReadData(i + 1, "Language");

                Thread.Sleep(2000);
                GenericWait.ElementIsVisible(GlobalDefinitions.driver, "XPath", "(//div[@class='ui teal button '][contains(.,'Add New')])[1]", 6);
                //Clicking on Add new button
                addNewLanguageButton.Click();

                //Entering the language data into the language textbox
                //Thread.Sleep(2000);
                GenericWait.ElementExists(GlobalDefinitions.driver, "XPath", "//input[@placeholder='Add Language']", 6);
                addNewLanguageText.SendKeys(languageData);

                //Selecting the language level
                GenericWait.ElementIsVisible(GlobalDefinitions.driver, "Name", "level", 6);
                SelectElement chooseLanguageLevel = new SelectElement(LanguageLevelDropdown);
                var           languageLevelData   = GlobalDefinitions.ExcelLib.ReadData(i + 1, "LanguageLevel");
                chooseLanguageLevel.SelectByValue(languageLevelData);

                //Clicking Add button
                //Thread.Sleep(4000);
                GenericWait.ElementIsClickable(GlobalDefinitions.driver, "XPath", "//input[@class='ui teal button'][contains(@value, 'Add')]", 6);
                addButtonLangauge.Click();
                string img = SaveScreenShotClass.SaveScreenshot(GlobalDefinitions.driver, "Add Language");
            }
        }
Esempio n. 3
0
        internal void EnterShareSkill()
        {
            //Calling wait method
            GenericWait.ElementExists(GlobalDefinitions.driver, "Name", "title", 8);

            //Entering the "Title"
            Title.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Title"));
            //Validating Title
            GlobalDefinitions.TextDataFieldValidation("Title", GlobalDefinitions.ExcelLib.ReadData(2, "Title"), Title.GetAttribute("value"));

            //Entering the "Description"
            Description.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Description"));
            //Validating Description
            GlobalDefinitions.TextDataFieldValidation("Description", GlobalDefinitions.ExcelLib.ReadData(2, "Description"), Description.Text);

            //Selecting Category
            HelperCallingMethods.SelectingDropdown(CategoryDropDown, "SelectByText", GlobalDefinitions.ExcelLib.ReadData(2, "Category"));
            //Validating Category selection
            GlobalDefinitions.DropDownDataValidation("Category", CategoryDropDown, GlobalDefinitions.ExcelLib.ReadData(2, "Category"));

            //Selecting Sub-Category
            HelperCallingMethods.SelectingDropdown(SubCategoryDropDown, "SelectByText", GlobalDefinitions.ExcelLib.ReadData(2, "SubCategory"));
            //Validating Sub-Category selection
            GlobalDefinitions.DropDownDataValidation("SubCategory", SubCategoryDropDown, GlobalDefinitions.ExcelLib.ReadData(2, "SubCategory"));

            //Entering Tag
            Tags.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Tags") + "\n");
            //GlobalDefinitions.WaitForElement(GlobalDefinitions.driver, By.XPath("//span[@class='ReactTags__tag']"), 5);
            GenericWait.ElementIsVisible(GlobalDefinitions.driver, "XPath", "//span[@class='ReactTags__tag']", 6);
            string EnteredTagTxt = TagReact.Text;

            //Validating entered Tag
            GlobalDefinitions.TextDataFieldValidation("Tags", GlobalDefinitions.ExcelLib.ReadData(2, "Tags"), EnteredTagTxt.Remove(EnteredTagTxt.Length - 1, 1));

            // Select the Service type radio button
            HelperCallingMethods.SelectingRadiobutton("//form/div[5]/div[@class='twelve wide column']/div/div[@class='field']", "serviceType", GlobalDefinitions.ExcelLib.ReadData(2, "ServiceType"));
            //Validating Service Type Radiobutton selection
            GlobalDefinitions.RadiobuttonValidation("ServiceTypeRadioButtons", "//form/div[5]/div[@class='twelve wide column']/div/div[@class='field']", "serviceType", GlobalDefinitions.ExcelLib.ReadData(2, "ServiceType"));

            // Select the Location type radio button
            HelperCallingMethods.SelectingRadiobutton("//form/div[6]/div[@class='twelve wide column']/div/div[@class = 'field']", "locationType", GlobalDefinitions.ExcelLib.ReadData(2, "LocationType"));
            //Validating Location Type Radiobutton selection
            GlobalDefinitions.RadiobuttonValidation("LocationTypeRadioButtons", "//form/div[6]/div[@class='twelve wide column']/div/div[@class = 'field']", "locationType", GlobalDefinitions.ExcelLib.ReadData(2, "LocationType"));

            //Selecting date and time
            HelperCallingMethods helperCallingMethods = new HelperCallingMethods();

            helperCallingMethods.SelectingDateAndTime();
            //Validating Start Date, End Date, Start Time,End Time
            GlobalDefinitions.TextDataFieldValidation("Start Date", DateTime.Today.ToString("dd/MM/yyyy"), DateTime.Parse(StartDateDropDown.GetAttribute("value")).ToString("dd/MM/yyyy"));
            GlobalDefinitions.TextDataFieldValidation("End Date", DateTime.Today.AddDays(14).ToString("dd/MM/yyyy"), DateTime.Parse(EndDateDropDown.GetAttribute("value")).ToString("dd/MM/yyyy"));
            GlobalDefinitions.TextDataFieldValidation("Start Time", GlobalDefinitions.ExcelLib.ReadData(2, "Starttime"), DateTime.Parse(StartTime.GetAttribute("value")).ToString("hh:mmtt"));
            GlobalDefinitions.TextDataFieldValidation("End Time", GlobalDefinitions.ExcelLib.ReadData(2, "Endtime"), DateTime.Parse(EndTime.GetAttribute("value")).ToString("hh:mmtt"));


            //Selecting SkillTrade or Credit radio button
            HelperCallingMethods.SelectingRadiobutton("//form/div[8]/div[@class='twelve wide column']/div/div[@class = 'field']", "skillTrades", GlobalDefinitions.ExcelLib.ReadData(2, "SkillTrade"));
            string SkillTradeValue = GlobalDefinitions.ExcelLib.ReadData(2, "SkillTrade");

            //Enter Skill-Exchange or Credit
            if (SkillTradeValue == "Skill-exchange")
            {
                SkillExchange.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Skill-Exchange") + "\n");
                //Validating entered Skill exchange value
                GlobalDefinitions.TextDataFieldValidation("SkillExchange", GlobalDefinitions.ExcelLib.ReadData(2, "Skill-Exchange"), SkillExchangeTag.Text.Remove(SkillExchangeTag.Text.Length - 1, 1));
            }
            else if (SkillTradeValue == "Credit")
            {
                CreditAmount.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Credit"));
                //Validating entered Credit value
                GlobalDefinitions.TextDataFieldValidation("Credit", GlobalDefinitions.ExcelLib.ReadData(2, "Credit"), CreditAmount.GetAttribute("value"));
            }

            //Uploading file for Work Sample
            WorkSamples.Click();
            AutoItX3 autoIt = new AutoItX3();

            autoIt.WinWait("Open", "File Upload", 1);
            autoIt.WinActivate("Open", "File Upload");
            autoIt.ControlFocus("Open", "File Upload", "[CLASS:Edit; INSTANCE:1]");
            autoIt.Sleep(1000);
            //autoIt.Send(Path.GetFullPath(Path.Combine(Directory.GetCurrentDirectory()) + "\\FileUploadTest.txt"));
            autoIt.Send(Path.Combine(AppDomain.CurrentDomain.BaseDirectory + "..\\..\\FileUploadTest.txt"));
            autoIt.Sleep(1000);
            autoIt.Send("{ENTER}");
            autoIt.Sleep(2000);
            string[] FileSplitText     = WorkSampleFileName.Text.Split('.');
            string   FileSplitTextName = FileSplitText[0];

            //Validating uploaded worksample
            GlobalDefinitions.TextDataFieldValidation("WorkSamples", FileSplitTextName.ToString(), GlobalDefinitions.ExcelLib.ReadData(2, "FileName").ToString());

            //selecting Active radio button
            HelperCallingMethods.SelectingRadiobutton("//form/div[10]/div[@class='twelve wide column']/div/div[@class = 'field']", "isActive", GlobalDefinitions.ExcelLib.ReadData(2, "Active"));
            //Validating Active radio button selection
            GlobalDefinitions.RadiobuttonValidation("Active", "//form/div[10]/div[@class='twelve wide column']/div/div[@class = 'field']", "isActive", GlobalDefinitions.ExcelLib.ReadData(2, "Active"));

            //Clicking Save button
            Save.Click();

            string img = SaveScreenShotClass.SaveScreenshot(GlobalDefinitions.driver, "Share skill added");
        }