예제 #1
0
        internal void AddNewSkill(string title, string description, string category, string subcategory, string tags, string credit)
        {
            // Click on the Share Skill button on Home page
            Shareskill.Click();
            Thread.Sleep(1000);

            // Wait for fields to load
            Thread.Sleep(1000);

            // Input information into the Title field
            Title.SendKeys(title);

            // Input information into the Description field
            Description.SendKeys(description);

            // Choose Category
            Category.SendKeys(category);

            // Choose Subcategory
            Subcategory.SendKeys(subcategory);

            // Input information into the Tags field and press Enter key
            Tags.SendKeys(tags);
            Tags.SendKeys(Keys.Enter);

            // Tick One-off service option of Service Type
            ServiceType.Click();

            // Tick On-site option of Location Type
            LocationType.Click();

            // Set Start date and End date of Available days
            Startdate.SendKeys("01-06-2019");
            Enddate.SendKeys("30-06-2019");

            // Tick all weekdays, set Start time as 9:00 and End time as 17:00

            for (int i = 1; i <= 5; i++)
            {
                GlobalDefinitions.driver.FindElement(By.XPath("//div[@class='fields']//input[@name='Available'][@index='" + i + "']")).Click();
                GlobalDefinitions.driver.FindElement(By.XPath("//input[@name='StartTime'][@index='" + i + "']")).SendKeys("0900");
                GlobalDefinitions.driver.FindElement(By.XPath("//input[@name='EndTime'][@index='" + i + "']")).SendKeys("1700");
            }

            // Tick Credit option of Skill Trade
            SkillTrade.Click();

            // Input number into price field
            Credit.SendKeys(credit);

            // Tick Hidden option of Active
            Active.Click();

            // Click on the Save button
            Save.Click();
            Thread.Sleep(500);
        }
예제 #2
0
        internal void SkillDetails(string title, string description, string category, string subcategory, string tags, string exchangetags)
        {
            // Wait 0.5 second
            Thread.Sleep(500);

            // Click the Share Skill button on Home page
            Shareskill.Click();
            Thread.Sleep(1500);

            // Input Title
            Title.SendKeys(title);

            // Inpu Description
            Description.SendKeys(description);

            // Wait 0.5 second
            Thread.Sleep(500);

            // Choose Category
            Category.SendKeys(category);

            // Choose Subcategory
            Subcategory.SendKeys(subcategory);

            // Input Tags
            Tags.SendKeys(tags);
            Tags.SendKeys(Keys.Enter);

            // Input ExchangeTags
            ExchangeTags.SendKeys(exchangetags);
            ExchangeTags.SendKeys(Keys.Enter);

            // Click the Save button
            Save.Click();
            Thread.Sleep(500);
        }