Beispiel #1
0
        internal void EnterShareSkill()
        {
            //Extension custom method
            //Click on Share skill tab
            ShareSkillButton.Clicks();
            Title.EnterText("Selenium");

            Description.EnterText("Would you like to provide Selenium training?");

            //Select dropbox
            CategoryDropDown.SelectFromDDL("Programming & Tech");
            SubCategoryDropDown.SelectFromDDL("Databases");

            //Enter value in tag
            Tags.EnterText("Testing");
            //Enter Key
            Tags.SendKeys(Keys.Enter);
            Thread.Sleep(1000);

            //Select  Service Type
            ServiceTypeOptions.Click();

            //Select Location Type
            LocationTypeOption.Click();
            Thread.Sleep(1000);

            //Enter Skill Trade
            SkillTrade.Click();
            Thread.Sleep(1000);
            // GlobalDefinitions.driver.FindElement(By.XPath("//input[@name='skillTrades'][@tabindex='0'][@value='false']")).Clicks();

            //hidden credit
            AddCredit.Click();
            AddCredit.SendKeys(("10"));

            ActiveStatus.Click();
            Thread.Sleep(1000);


            //Save Button
            SaveButton1.Clicks();
        }
Beispiel #2
0
        internal void EnterShareSkill()
        {
            //Extension custom method
            //Click on Share skill tab
            ShareSkillButton.Clicks();
            Title.EnterText("Selenium");

            Description.EnterText("Would you like to provide Selenium training?");

            //Select dropbox
            CategoryDropDown.SelectFromDDL("Programming & Tech");
            SubCategoryDropDown.SelectFromDDL("Databases");

            //Enter value in tag
            Tags.EnterText("Tag14");
            //Enter Key
            Tags.SendKeys(Keys.Enter);
            Thread.Sleep(1000);

            //check Tag entered
            Assert.IsNotNull(Tags, "Test fail- Tag Empty");

            //Enter Service Type
            GlobalDefinitions.driver.FindElement(By.XPath("//input[@name='serviceType'][@type='radio'][@value='1']")).Clicks();
            //Enter Location Type
            GlobalDefinitions.driver.FindElement(By.XPath("//input[@name='locationType'][@value='0']")).Clicks();

            ////Enter Start date
            //GlobalDefinitions.driver.FindElement(By.Name("startDate")).EnterText("11192019");

            ////Enter End date
            //GlobalDefinitions.driver.FindElement(By.XPath("//input[@name='endDate']")).EnterText("11252019");


            ////select the days and time
            //GlobalDefinitions.driver.FindElement(By.XPath("//inpu" +
            //   "t[@tabindex='0'][@index='0'][@name='Available']")).Clicks();
            //GlobalDefinitions.driver.FindElement(By.XPath("(//input[@name='StartTime'])[1]")).EnterText("09:00AM");
            //GlobalDefinitions.driver.FindElement(By.XPath("(//input[@name='EndTime'])[1]")).EnterText("05:00PM");

            //GlobalDefinitions.driver.FindElement(By.XPath("//input[@tabindex='0'][@index='1'][@name='Available']")).Clicks();
            //GlobalDefinitions.driver.FindElement(By.XPath("(//input[@name='StartTime'])[2]")).EnterText("09:00AM");
            //GlobalDefinitions.driver.FindElement(By.XPath("(//input[@name='EndTime'])[2]")).EnterText("05:00PM");

            //GlobalDefinitions.driver.FindElement(By.XPath("//input[@tabindex='0'][@index='2'][@name='Available']")).Clicks();
            //GlobalDefinitions.driver.FindElement(By.XPath("(//input[@name='StartTime'])[3]")).EnterText("09:00AM");
            //GlobalDefinitions.driver.FindElement(By.XPath("(//input[@name='EndTime'])[3]")).EnterText("05:00PM");


            //GlobalDefinitions.driver.FindElement(By.XPath("//input[@tabindex='0'][@index='3'][@name='Available']")).Clicks();
            //GlobalDefinitions.driver.FindElement(By.XPath("(//input[@name='StartTime'])[4]")).EnterText("09:00AM");
            //GlobalDefinitions.driver.FindElement(By.XPath("(//input[@name='EndTime'])[4]")).EnterText("05:00PM");

            //GlobalDefinitions.driver.FindElement(By.XPath("//input[@tabindex='0'][@index='4'][@name='Available']")).Clicks();
            //GlobalDefinitions.driver.FindElement(By.XPath("(//input[@name='StartTime'])[5]")).EnterText("09:00AM");
            //GlobalDefinitions.driver.FindElement(By.XPath("(//input[@name='EndTime'])[5]")).EnterText("05:00PM");

            //GlobalDefinitions.driver.FindElement(By.XPath("//input[@tabindex='0'][@index='5'][@name='Available']")).Clicks();
            //GlobalDefinitions.driver.FindElement(By.XPath("(//input[@name='StartTime'])[6]")).EnterText("09:00AM");
            //GlobalDefinitions.driver.FindElement(By.XPath("(//input[@name='EndTime'])[6]")).EnterText("05:00PM");

            //GlobalDefinitions.driver.FindElement(By.XPath("//input[@tabindex='0'][@index='6'][@name='Available']")).Clicks();
            //GlobalDefinitions.driver.FindElement(By.XPath("(//input[@name='StartTime'])[7]")).EnterText("09:00AM");
            //GlobalDefinitions.driver.FindElement(By.XPath("(//input[@name='EndTime'])[7]")).EnterText("05:00PM");

            //Enter Skill Trade
            GlobalDefinitions.driver.FindElement(By.XPath("//input[@name='skillTrades'][@tabindex='0'][@value='false']")).Clicks();

            //hidden credit
            //GlobalDefinitions.driver.FindElement(By.XPath("GlobalDefinitions.driver.FindElement(By.XPath")).EnterText("9");


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

            ws.Clicks();
            //using AutoIT upload file
            AutoItX.WinWaitActive("Open");
            AutoItX.Send(@"C:\Mars\Test error.txt");
            AutoItX.Sleep(5);
            AutoItX.Send("{ENTER}");

            // Assert.IsTrue(ws != null, "File upload Fail");
            //IWebElement file = GlobalDefinitions.driver.FindElement(By.XPath("//span[@class='tooltiptext']"));
            // Assert.That(file.Text == "Test error.txt", "File uploaded Fail");

            try
            {
                IWebElement file = GlobalDefinitions.driver.FindElement(By.XPath("//span[@class='tooltiptext']"));
                Assert.That(file.Text != null, "File uploaded Fail");
            }
            catch (NoSuchElementException)
            {
                Assert.Fail("File Uploaded Fail");
            }


            //Click Hidden Bullet
            GlobalDefinitions.driver.FindElement(By.XPath("//input[@name='isActive'][@value='false']")).Clicks();
            Thread.Sleep(2000);

            //Save Button
            Save.Clicks();
        }