internal void EnterShareSkill(int dataRow) { GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "SkillDetails"); InputData(dataRow); InputCategory(dataRow); Service_Location(dataRow); Avalible_Days_Time_Details(dataRow); UploadFile(); ActiveOption2.Click(); Save.Click(); }
internal void EnterShareSkill() { try { //Populate the excel data GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "ShareSkill"); //Click on Share Skill button ShareSkillButton.Click(); //Enter the Title Title.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Title")); //Enter the Description Description.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Description")); //Choose the Category SelectElement Category = new SelectElement(CategoryDropDown); Category.SelectByText(GlobalDefinitions.ExcelLib.ReadData(2, "Category")); //Choose the Sub Category SelectElement SubCategory = new SelectElement(SubCategoryDropDown); SubCategory.SelectByText(GlobalDefinitions.ExcelLib.ReadData(2, "SubCategory")); //Enter the tags Tags.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Tags")); //Click the Enter button Tags.SendKeys(Keys.Enter); //Click on Service type radio button if (GlobalDefinitions.ExcelLib.ReadData(2, "ServiceType") == ServiceTypeOptionsText1.Text) { if (!ServiceTypeOptions1.Selected) { ServiceTypeOptions1.Click(); } } else if (GlobalDefinitions.ExcelLib.ReadData(2, "ServiceType") == ServiceTypeOptionsText2.Text) { if (!ServiceTypeOptions2.Selected) { GlobalDefinitions.wait(5000); ServiceTypeOptions2.Click(); } } //Click on Location type radio button if (GlobalDefinitions.ExcelLib.ReadData(2, "LocationType") == LocationTypeOptionsText1.Text) { GlobalDefinitions.wait(5000); if (!LocationTypeOptions1.Selected) { GlobalDefinitions.wait(5000); LocationTypeOptions1.Click(); } } else if (GlobalDefinitions.ExcelLib.ReadData(2, "LocationType") == LocationTypeOptionsText2.Text) { if (!LocationTypeOptions2.Selected) { GlobalDefinitions.wait(5000); LocationTypeOptions2.Click(); } } #region radio buttons //Click on Skill trade radio button if (GlobalDefinitions.ExcelLib.ReadData(2, "SkillTrade") == SkillTradeOptionText1.Text) { if (!SkillTradeOption1.Selected) { SkillTradeOption1.Click(); } //Enter the tag name in Skill exchange and press Enter key SkillExchange.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Skill-Exchange")); SkillExchange.SendKeys(Keys.Enter); //} } else if (GlobalDefinitions.ExcelLib.ReadData(2, "SkillTrade") == SkillTradeOptionText2.Text) { SkillTradeOption2.Click(); CreditAmount.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Credit")); } //Click on Active radio buttons if (GlobalDefinitions.ExcelLib.ReadData(2, "Active") == ActiveOptionText1.Text) { if (!ActiveOption1.Selected) { ActiveOption1.Click(); } } else if (GlobalDefinitions.ExcelLib.ReadData(2, "Active") == ActiveOptionText2.Text) { ActiveOption2.Click(); } #endregion //Click on File Upload FileUpload.Click(); //Using AutoIt // AutoItx Autoit = new AutoItx(); AutoItX.WinActivate("Open"); AutoItX.Sleep(500); AutoItX.Send(@"C:\Users\anvil\Desktop\TestAnalyst.txt"); //GlobalDefinitions.wait(1200); AutoItX.Send("{ENTER}"); //StartDateDropDown.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Startdate")); GlobalDefinitions.wait(10000); Save.Click(); GlobalDefinitions.wait(10000); Assert.Pass("Successfully Service Listing is Added"); } catch (Exception ex) { Console.WriteLine(ex.Message); } }