internal void SelectServiceTypeOptions() { //Select the Service type // ServiceTypeOptions.Click(); if (GlobalDefinitions.driver.FindElement(By.XPath("//input[@name='locationType' and @value='0']")).Text.Equals(GlobalDefinitions.ExcelLib.ReadData(2, "Service Type"))) { Hourlybasisservice.Click(); } else { Oneoffservice.Click(); } Base.test.Log(LogStatus.Info, "Selected Service Type"); }
public void Addshareskilldetails() { //Click on the "Share Skill" Button Addshareskill.Click(); Thread.Sleep(1000); //Send data to the "Title" textbox Title.SendKeys("I am the Software test analyst with five years of experience using Selenium"); Thread.Sleep(1000); //Send data to the "Description" textbox Description.SendKeys("I love to do projects in the software testing and implementing the Page factory."); Thread.Sleep(1000); //Click the "Category" and Select the options in it IWebElement Category = Driver.driver.FindElement(By.XPath("//select[@name='categoryId']")); SelectElement Category_dd = new SelectElement(Category); Category_dd.SelectByValue("Business"); Thread.Sleep(1000); //Click the "Sub Category" for "business" and Select the options in it IWebElement SubCategory = Driver.driver.FindElement(By.XPath("//select[@name='subcategoryId']")); SelectElement SubCategory_dd = new SelectElement(SubCategory); SubCategory_dd.SelectByValue("Other"); Thread.Sleep(1000); //Tags Addtag.SendKeys(Keys.Enter); Thread.Sleep(1000); //Select the "service type" in which options between (1.Hourly basis service, 2- One-off service), Selectin "One-off service" Oneoffservice.Click(); Thread.Sleep(1000); //IWebElement Servicetype = Driver.driver.FindElement(By.XPath("//select[@name='categoryId']")); //SelectElement Servicetype_dd = new SelectElement(Servicetype); //Servicetype_dd.SelectByValue("1"); //Select the "location type" In which options between (1. Onsite, 2. Off Site), Selecting "Online" option //IWebElement Locationtype = Driver.driver.FindElement(By.XPath("//select[@name='categoryId']")); //SelectElement Locationtype_dd = new SelectElement(Locationtype); //Locationtype_dd.SelectByValue("1"); Onsite.Click(); Thread.Sleep(1000); //Enter data to the "Available Days" Startdate.SendKeys("07132019"); Thread.Sleep(1000); //Select the "Skilltrade" //IWebElement Skilltrade = Driver.driver.FindElement(By.XPath("//select[@name='categoryId']")); //SelectElement Skilltrade_dd = new SelectElement(Skilltrade); //Skilltrade_dd.SelectByValue("1"); //Select the "Skill-Exchange" option under the "Skill Trade" option Skilltrade.Click(); Thread.Sleep(1000); //Sending data in "Skill-Exchange" textbox and press "Enter" Skillexchange.SendKeys("Python"); Skillexchange.SendKeys(Keys.Enter); Thread.Sleep(1000); //Send data to the "Amount" textbox under the "Credit" field //Credit.SendKeys("2"); //Thread.Sleep(1000); //Select the "Active" field in which options (1.Active, 2. Hidden), Selecting "Active" option Active.Click(); Thread.Sleep(1000); //IWebElement Active = Driver.driver.FindElement(By.XPath("//h3[contains(text(),'Active')]")); //SelectElement Active_dd = new SelectElement(Active); //Active_dd.SelectByValue("true"); //Click on the "Save" Button Save.Click(); Thread.Sleep(1000); }