internal void EditSkill() { Commondriver.Excellib.PopulateInCollection(Base.Excelpath, "Skills"); Commondriver.Wait(15); Editbutton.Click(); Skillname.Clear(); Commondriver.Wait(15); Skillname.SendKeys(Commondriver.Excellib.ReadData(3, "Skill")); Updatebutton.Click(); Commondriver.Wait(15); }
internal void ShareskillEdit() { //Explicit wait to find element GlobalDefinitions.WaitForElement(GlobalDefinitions.driver, By.XPath("//section//a[contains(.,'Manage Listings')]")); //click managelisting manageListingsLink.Click(); GlobalDefinitions.WaitForElement(GlobalDefinitions.driver, By.XPath("(//i[@class='outline write icon'])[1]")); Editbutton.Click(); // Populate the excel data GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "ShareSkill"); //Enter title Title.SendKeys(GlobalDefinitions.ExcelLib.ReadData(3, "Title")); //Enter Description Description.SendKeys(GlobalDefinitions.ExcelLib.ReadData(3, "Description")); // Select on Category Dropdown GlobalDefinitions.wait(10); SelectElement catg = new SelectElement(CategoryDropDown); catg.SelectByText(GlobalDefinitions.ExcelLib.ReadData(3, "Category")); //Select on SubCategory Dropdown GlobalDefinitions.wait(10); SelectElement subcatg = new SelectElement(SubCategoryDropDown); subcatg.SelectByText(GlobalDefinitions.ExcelLib.ReadData(3, "SubCategory")); //Enter Tag names in textbox Tags.SendKeys(GlobalDefinitions.ExcelLib.ReadData(3, "Tags")); Tags.SendKeys(Keys.Return); //Select the Service type if (GlobalDefinitions.ExcelLib.ReadData(3, "ServiceType") == "Hourly basis service") { Hourly.Click(); } else if (GlobalDefinitions.ExcelLib.ReadData(3, "ServiceType") == "One-off service") { Oneoff.Click(); } //Select the Location type if (GlobalDefinitions.ExcelLib.ReadData(3, "LocationType") == "On-site") { Onsite.Click(); } else if (GlobalDefinitions.ExcelLib.ReadData(3, "LocationType") == "Online") { Online.Click(); } //Click on Start Date dropdown StartDateDropDown.SendKeys(GlobalDefinitions.ExcelLib.ReadData(3, "Startdate")); //Click on End Date dropdown EndDateDropDown.SendKeys(GlobalDefinitions.ExcelLib.ReadData(3, "Enddate")); //Select available days Days.Click(); //Select startTime StartTime.SendKeys(GlobalDefinitions.ExcelLib.ReadData(3, "Starttime")); //select endtime EndTimeDropDown.SendKeys(GlobalDefinitions.ExcelLib.ReadData(3, "Endtime")); if (GlobalDefinitions.ExcelLib.ReadData(3, "SkillTrade") == "Skill-Exchange") { //select SkillTradeOption SkillTradeOption.Click(); //Enter SkillExchange SkillExchange.SendKeys(GlobalDefinitions.ExcelLib.ReadData(3, "Skill-Exchange")); SkillExchange.SendKeys(Keys.Return); } else if (GlobalDefinitions.ExcelLib.ReadData(3, "SkillTrade") == "Credit") { Credit.Click(); Creditvalue.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "Credit")); Creditvalue.SendKeys(Keys.Enter); } //Click worksample Worksample.Click(); //Worksample.SendKeys("path"); //upload file using AutoIT AutoItX3 autoit = new AutoItX3(); //Activate so that next action happens on this window autoit.WinActivate("Open"); //autoit.Send(@"D:\Shareskillmars\FileUploadScript.exe"); autoit.Send(@"D:\Shareskillmars\sample.txt"); autoit.Send("{ENTER}"); Thread.Sleep(20000); //Select user option if (GlobalDefinitions.ExcelLib.ReadData(3, "UserStatus") == "Active") { StatusActive.Click(); } else if (GlobalDefinitions.ExcelLib.ReadData(3, "UserStatus") == "Hidden") { StatusHidden.Click(); } //click save or cancel if (Global.GlobalDefinitions.ExcelLib.ReadData(3, "SaveOrCancel") == "Save") { Save.Click(); } else if (Global.GlobalDefinitions.ExcelLib.ReadData(3, "SaveOrCancel") == "Cancel") { Cancel.Click(); } }