Ejemplo n.º 1
0
        //Choose the SkillTrade for the services rendered
        public void ChooseSkillTrade(String SkillTrade, int Cnt)
        {
            if (SkillTrade == "Skill-exchange")
            {
                //Click on the SkillExchange radio button
                SkillExchangeButton.Click();

                //Implicit wait
                Wait.wait(1, driver);

                String[] Skills = ServiceData.SkillExchangeData(RowNum);
                //Loop in to read all the tags
                for (int TagCount = 0; TagCount < Cnt; TagCount++)
                {
                    //Read the data for Tags from excel in case the services is edited to add new tags
                    SkillExchngTag.SendKeys(Skills[TagCount]);

                    //Press ENTER key to add the tag
                    SkillExchngTag.SendKeys(Keys.Enter);
                }
            }
            else
            {
                //Delete the Skill Exchange tags if present any
                if (Cnt > 0)
                {
                    for (int TagCount = Cnt; TagCount >= 1; TagCount--)
                    {
                        driver.FindElement(By.XPath("//*[@id='service-listing-section']/div[2]/div/form/div[8]/div[4]/div/div/div/div/span[" + TagCount + "]/a")).Click();
                    }
                    Thread.Sleep(100);
                }
                //Change the Skill Trade option to Credit
                CreditButton.Click();

                //Enter the value for Credit
                Credit.SendKeys(ServiceData.CreditValue(RowNum));
            }
        }
Ejemplo n.º 2
0
        //Choose the radio button based on the Skill Trade
        public void ChooseSkillTrade(String SkillTrade, int Cnt)
        {
            if (SkillTrade == "Skill-exchange")
            {
                SkillExchangeButton.Click();
                Thread.Sleep(200);

                String[] Skills = ServiceData.SkillExchangeData(RowNum);
                for (int TagCount = 0; TagCount < Cnt; TagCount++)
                {
                    //Read the data for Tags from excel and enter the data into the Tags field for Skill-Exchange
                    SkillExchngTag.SendKeys(Skills[TagCount]);

                    //Press ENTER key to add the tag
                    SkillExchngTag.SendKeys(Keys.Enter);
                }
            }
            else
            {
                CreditButton.Click();
                Credit.SendKeys(ServiceData.CreditValue(RowNum));
            }
        }