Exemplo n.º 1
0
 internal void Searchskill()
 {
     SearchClick.Click();
     Commondriver.Wait(10);
     Category.Click();
     Commondriver.Wait(15);
     Subcategory.Click();
     Commondriver.Wait(15);
     Filter.Click();
     Commondriver.Wait(15);
 }
Exemplo n.º 2
0
        internal void CategorySearchSkills()
        {
            // Wait 0.5 second
            Thread.Sleep(500);

            // Input Search skills "Testing"
            SearchSkillsField.SendKeys("Testing");

            // Click the Search button
            SearchIcon.Click();
            Thread.Sleep(1000);

            // Click the Category with results
            Category.Click();

            // Click the Subcategory with results
            Subcategory.Click();
            Thread.Sleep(500);

            // Verify if seller is able to see the selected category result
            IWebElement CategoryResult = GlobalDefinitions.driver.FindElement(By.XPath("//p[@class='row-padded'][contains(text(),'Testing')]"));

            Assert.That(CategoryResult.Text, Is.EqualTo("Testing"));
        }
Exemplo n.º 3
0
        public void ShareskillListings()
        {
            //Populate the Excel Sheet
            GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "ShareSkill");
            Thread.Sleep(1000);

            //Click on Share Skill Button
            Shareskillbutton.Click();
            Thread.Sleep(1000);

            //Enter the Details
            //Enter Title from Excel Sheet
            Title.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Title"));
            Thread.Sleep(1000);

            //Enter Description from Excel Sheet
            Description.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Description"));
            Thread.Sleep(1000);

            //Click on Category dropdown box
            Category.Click();
            Thread.Sleep(1000);
            //Select cartegory option from excel sheet by iterating the list of elements
            //I have declared CategoryOption as a IList<Iwebelement>
            int count = CategoryOption.Count;

            for (int i = 0; i < count; i++)
            {
                if (CategoryOption[i].Text == GlobalDefinitions.ExcelLib.ReadData(2, "CategoryOption"))
                {
                    CategoryOption[i].Click();
                }
            }

            Thread.Sleep(500);

            //Click on subcategory drop down box
            Subcategory.Click();
            Thread.Sleep(1000);

            //Click on 3 option from the dropdown
            int countsubcat = SubcategoryOption.Count;

            for (int i = 0; i < countsubcat; i++)
            {
                if (SubcategoryOption[i].Text == GlobalDefinitions.ExcelLib.ReadData(2, "SubCategoryOption"))
                {
                    SubcategoryOption[i].Click();
                }
            }
            Thread.Sleep(500);

            //Enter Tag from the Excel sheet
            Tag.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Tags"));
            Thread.Sleep(500);
            Tag.SendKeys(Keys.Enter);

            //Service Type as One-off service
            if (GlobalDefinitions.ExcelLib.ReadData(2, "ServiceType") == "Oneoff service")
            {
                OneOffService.Click();
            }
            else
            {
                HourlyBasisService.Click();
            }
            Thread.Sleep(500);

            //Location Type as On-site
            if (GlobalDefinitions.ExcelLib.ReadData(2, "LocationType") == "Onsite")
            {
                OnSite.Click();
            }
            else
            {
                Online.Click();
            }
            Thread.Sleep(500);

            //Enter Strt and End dates of Available days
            startDate.Click();
            Thread.Sleep(500);
            startDate.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "StartDate"));
            Thread.Sleep(500);
            endDate.Click();
            endDate.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "EndDate"));
            Thread.Sleep(500);

            //Enter the Available days and their Start and End Time from the Excel Sheet
            String availabledays = GlobalDefinitions.ExcelLib.ReadData(2, "Available");
            String starttimes    = GlobalDefinitions.ExcelLib.ReadData(2, "StartTime");
            String endtimes      = GlobalDefinitions.ExcelLib.ReadData(2, "EndTime");

            String[] availabledaysarray = new String[] { };
            availabledaysarray = availabledays.Split(',');
            int arraycount = availabledaysarray.Count();

            String[] starttimesarray = new String[] { };
            starttimesarray = starttimes.Split(',');
            int starttimecount = starttimesarray.Count();


            String[] endtimesarray = new String[] { };
            endtimesarray = endtimes.Split(',');
            int endtimecount = endtimesarray.Count();

            for (int i = 0; i < arraycount; i++)
            {
                switch (availabledaysarray[i])
                {
                case "sun":
                    sunday.Click();
                    sunstarttime.SendKeys(starttimesarray[i]);
                    sunendTime.SendKeys(endtimesarray[i]);
                    break;

                case "mon":
                    monday.Click();
                    monstarttime.SendKeys(starttimesarray[i]);
                    monendTime.SendKeys(endtimesarray[i]);
                    break;

                case "tue":
                    tuesday.Click();
                    tuestarttime.SendKeys(starttimesarray[i]);
                    tueendTime.SendKeys(endtimesarray[i]);
                    break;

                case "wed":
                    wednesday.Click();
                    wedstarttime.SendKeys(starttimesarray[i]);
                    wedendTime.SendKeys(endtimesarray[i]);
                    break;

                case "thu":
                    thursday.Click();
                    thustarttime.SendKeys(starttimesarray[i]);
                    thuendTime.SendKeys(endtimesarray[i]);
                    break;

                case "fri":
                    friday.Click();
                    fristarttime.SendKeys(starttimesarray[i]);
                    friendTime.SendKeys(endtimesarray[i]);
                    break;

                case "sat":
                    saturday.Click();
                    satstarttime.SendKeys(starttimesarray[i]);
                    satendTime.SendKeys(endtimesarray[i]);
                    break;
                }
            }

            //Skill Trade as Credit/SkillExchange
            if (GlobalDefinitions.ExcelLib.ReadData(2, "SkillTrade") == "Credit")
            {
                credit.Click();
                Thread.Sleep(500);
                //Credit charge as 6 per hour from Excel sheet
                creditCharge.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "CreditCharges"));
                Thread.Sleep(500);
            }
            else
            {
                skillExchange.Click();
                Thread.Sleep(500);
                skillexchangetag.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "SkillExchangetag"));
                Thread.Sleep(500);
            }

            //Work samples
            workSample.Click();
            AutoItX3 autolt = new AutoItX3();

            autolt.WinActivate("Open");
            autolt.Send(GlobalDefinitions.ExcelLib.ReadData(2, "WorkSample"));
            //autolt.Send(@"E:\Competition Task1\Mars Automation framework\MarsFramework\MarsFramework\Empty.docx");
            Thread.Sleep(1000);
            autolt.Send("{ENTER}");


            //Set Active as Hidden/Active
            if (GlobalDefinitions.ExcelLib.ReadData(2, "ActiveService") == "Hidden")
            {
                Hidden.Click();
            }
            else
            {
                Active.Click();
            }

            //Save the form
            Save.Click();
            Thread.Sleep(1000);
        }