internal void EditShareSkill() { //Populate the Excel sheet Global.GlobalDefinitions.ExcelLib.PopulateInCollection(Global.Base.ExcelPath, "ShareSkill"); int excelRowToRead = 3; Title.Clear(); Title.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "Title")); //Click on Description Description.Clear(); Description.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "Description")); //Select A Category CategoryDropDown.Click(); String categoryValue = Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "Category"); IList <IWebElement> CategoriesDropDownList = CategoryDropDown.FindElements(By.XPath("//option")); int DpListCount = CategoriesDropDownList.Count; for (int i = 0; i < DpListCount; i++) { if (CategoriesDropDownList[i].Text == categoryValue) { CategoriesDropDownList[i].Click(); } } //Select Sub Category Thread.Sleep(1000); IWebElement SubCategorySelection = Global.GlobalDefinitions.driver.FindElement(By.Name("subcategoryId")); SubCategorySelection.Click(); String SubCategoryValue = Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "SubCategory"); IList <IWebElement> SubCategoriesDropDownList = SubCategorySelection.FindElements(By.XPath("//option")); int SbDpListCount = SubCategoriesDropDownList.Count; for (int i = 0; i < SbDpListCount; i++) { if (SubCategoriesDropDownList[i].Text == SubCategoryValue) { SubCategoriesDropDownList[i].Click(); } } //Clear and Add Tags IWebElement tagsInputBox = Global.GlobalDefinitions.driver.FindElement(By.XPath("//*[@id='service-listing-section']/div[2]/div/form/div[4]/div[2]/div")); IList <IWebElement> RemoveButtons = tagsInputBox.FindElements(By.ClassName("ReactTags__remove")); foreach (IWebElement element in RemoveButtons) { element.Click(); } Tags.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "Tag")); Tags.SendKeys(Keys.Enter); //Select Service Type String ServiceType = Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "Service Type"); if (ServiceType.Equals("Hourly basis Service")) { HourlyServiceType.Click(); } else if (ServiceType.Equals("One-off Service")) { OneOffServiceType.Click(); } //Select Location Type String LocatioType = Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "Location Type"); if (LocatioType.Equals("On-site")) { OnSiteLocationType.Click(); } else if (OnSiteLocationType.Equals("Online")) { OnlineLocationType.Click(); } //Select Available Start Date IWebElement AvailableStartDateInput = AvailabilityForm.FindElement(By.Name("startDate")); AvailableStartDateInput.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "AvailableStartDate")); //Select Available End Date IWebElement AvailableEndDateInput = AvailabilityForm.FindElement(By.Name("endDate")); AvailableEndDateInput.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "AvailableEndDate")); String[] WeekDays = new String[] { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; //Cleared Selected Checkboxes IList <IWebElement> AvailableCheckBoxes = AvailabilityForm.FindElements(By.Name("Available")); foreach (IWebElement element in AvailableCheckBoxes) { if (element.Selected) { element.Click(); } } //Select Check boxes based on data String AvailableDaysValue = Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "AvailableDays"); IList <String> AvailableDays = AvailableDaysValue.Split(','); for (int i = 0; i < WeekDays.Count(); i++) { if (AvailableDays.Contains(WeekDays[i])) { AvailableCheckBoxes[i].Click(); } } //Set Start times IList <IWebElement> AvailableStartTimeInputs = AvailabilityForm.FindElements(By.Name("StartTime")); String AvailableStartTimesValue = Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "AvailableStartTimes"); IList <String> AvailableStartTimes = AvailableStartTimesValue.Split(','); for (int i = 0; i < AvailableStartTimes.Count(); i++) { IList <String> startTimeInfo = AvailableStartTimes[i].Split(':'); String startTimeDay = startTimeInfo[0]; String startTimeValue = startTimeInfo[1]; int indexOfDay = Array.IndexOf(WeekDays, startTimeDay); AvailableStartTimeInputs[indexOfDay].SendKeys(startTimeValue); } //Set End times IList <IWebElement> AvailableEndTimeInputs = AvailabilityForm.FindElements(By.Name("EndTime")); String AvailableEndTimesValue = Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "AvailableEndTimes"); IList <String> AvailableEndTimes = AvailableEndTimesValue.Split(','); for (int i = 0; i < AvailableEndTimes.Count(); i++) { IList <String> endTimeInfo = AvailableEndTimes[i].Split(':'); String endTimeDay = endTimeInfo[0]; String endTimeValue = endTimeInfo[1]; int indexOfDay = Array.IndexOf(WeekDays, endTimeDay); AvailableEndTimeInputs[indexOfDay].SendKeys(endTimeValue); } //Select Skill Exchange Type String SkillTradeType = Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "SkillTradeType"); if (SkillTradeType.Equals("Skill-exchange")) { SkillExchangeType.Click(); //Clear and Add Tags IWebElement SkillTagsInputBox = Global.GlobalDefinitions.driver.FindElement(By.XPath("//*[@id='service-listing-section']/div[2]/div/form/div[8]/div[4]/div/div")); IList <IWebElement> CrossButtons = SkillTagsInputBox.FindElements(By.ClassName("ReactTags__remove")); foreach (IWebElement element in CrossButtons) { element.Click(); } SkillExchangeTag.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "SkillExchangeTab")); SkillExchangeTag.SendKeys(Keys.Enter); } else if (SkillTradeType.Equals("Credit")) { CreditsType.Click(); CreditAmount.Clear(); CreditAmount.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "CreditsAmount")); } //Select Active Status Button String ActiveType = Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "ActiveType"); if (SkillTradeType.Equals("Active")) { ActiveButton.Click(); } else if (SkillTradeType.Equals("Hidden")) { HiddenButton.Click(); } //Click on Save Button SaveButton.Click(); Thread.Sleep(3000); //Verify IWebElement listingTable = Global.GlobalDefinitions.driver.FindElement(By.XPath("//*[@id='listing-management-section']/div[2]/div[1]/table")); IList <IWebElement> tableRows = listingTable.FindElements(By.TagName("tr")); Boolean isListingEdited = false; for (int i = 0; i <= tableRows.Count; i++) { IWebElement row = tableRows[i]; if (row.Text.Contains(Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "Title")) && row.Text.Contains(Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "Description"))) { isListingEdited = true; break; } } if (isListingEdited == true) { Global.Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Edit Skill test Successful"); } else { Global.Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Edit Skill test Failed"); } }
//[FindsBy(How = How.XPath, Using = "//*[@id='listing-management-section']/div[2]/div[1]/table/tbody/tr/td[4]")] //private IWebElement ItemToDelete { get; set; } //[FindsBy(How = How.XPath, Using = "")] //private IWebElement { get; set; } //[FindsBy(How = How.XPath, Using = "")] //private IWebElement { get; set; } #endregion internal void AddSkill() { //Populate the Excel sheet Global.GlobalDefinitions.ExcelLib.PopulateInCollection(Global.Base.ExcelPath, "Skill"); ShareSkillBtn.Click(); Global.GlobalDefinitions.wait(5); TitleTextbox.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "Title")); DescriptionTextbox.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "Description")); CategoryDropdown.Click(); var category = Global.GlobalDefinitions.driver.FindElement(By.XPath("//*[@id='service-listing-section']/div[2]/div/form/div[3]/div[2]/div/div/select")); var selectElement = new SelectElement(category); selectElement.SelectByIndex(3); SubcategoryDropdown.Click(); var subcategory = Global.GlobalDefinitions.driver.FindElement(By.XPath("//*[@id='service-listing-section']/div[2]/div/form/div[3]/div[2]/div/div[2]/div[1]/select")); var selectElement1 = new SelectElement(subcategory); selectElement1.SelectByIndex(3); TagsTextbox.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "Tags")); TagsTextbox.SendKeys(Keys.Enter); TagsTextbox1.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(3, "Tags")); TagsTextbox1.SendKeys(Keys.Enter); OneoffService.Click(); Thread.Sleep(500); HourlyService.Click(); Thread.Sleep(500); OnSite.Click(); Thread.Sleep(500); Online.Click(); StartdateTextbox.Click(); StartdateTextbox.SendKeys(DateTime.Now.AddDays(5).ToString("dd/MM/yyyy")); EnddateTextbox.Click(); EnddateTextbox.SendKeys(DateTime.Now.AddMonths(1).ToString("dd/MM/yyyy")); SunCheckBox.Click(); SunStartTime.Click(); SunStartTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "StartHour")); SunStartTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "StartMinutes")); SunStartTime.SendKeys(Keys.Up); SunEndTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "EndHour")); SunEndTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "EndMinutes")); SunEndTime.SendKeys(Keys.ArrowDown); MonCheckBox.Click(); MonStartTime.Click(); MonStartTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "StartHour")); MonStartTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "StartMinutes")); MonStartTime.SendKeys(Keys.Up); MonEndTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "EndHour")); MonEndTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "EndMinutes")); MonEndTime.SendKeys(Keys.ArrowDown); TueCheckBox.Click(); TueStartTime.Click(); TueStartTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "StartHour")); TueStartTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "StartMinutes")); TueStartTime.SendKeys(Keys.Up); TueEndTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "EndHour")); TueEndTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "EndMinutes")); TueEndTime.SendKeys(Keys.ArrowDown); WedCheckBox.Click(); WedStartTime.Click(); WedStartTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "StartHour")); WedStartTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "StartMinutes")); WedStartTime.SendKeys(Keys.Up); WedEndTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "EndHour")); WedEndTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "EndMinutes")); WedEndTime.SendKeys(Keys.ArrowDown); ThuCheckBox.Click(); ThuStartTime.Click(); ThuStartTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "StartHour")); ThuStartTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "StartMinutes")); ThuStartTime.SendKeys(Keys.Up); ThuEndTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "EndHour")); ThuEndTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "EndMinutes")); ThuEndTime.SendKeys(Keys.ArrowDown); FriCheckBox.Click(); FriStartTime.Click(); FriStartTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "StartHour")); FriStartTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "StartMinutes")); FriStartTime.SendKeys(Keys.Up); FriEndTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "EndHour")); FriEndTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "EndMinutes")); FriEndTime.SendKeys(Keys.ArrowDown); SatCheckBox.Click(); SatStartTime.Click(); SatStartTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "StartHour")); SatStartTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "StartMinutes")); SatStartTime.SendKeys(Keys.Up); SatEndTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "EndHour")); SatEndTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "EndMinutes")); SatEndTime.SendKeys(Keys.ArrowDown); SkillExchangeButton.Click(); SkillExchangeTag.Click(); SkillExchangeTag.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "SkillToExchange")); SkillExchangeTag.SendKeys(Keys.Enter); CreditButton.Click(); CreditAmount.Click(); CreditAmount.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "CreditAmount")); PlusCircleIcon.Click(); //Upload file AutoItX3 autoIt = new AutoItX3(); autoIt.WinActivate("Open"); autoIt.Send(@"C:\Users\Nemesis\Pictures\TanslatePix\zodiac.jpg"); Thread.Sleep(500); autoIt.Send("{ENTER}"); Thread.Sleep(500); PlusCircleIcon.Click(); AutoItX3 autoIt1 = new AutoItX3(); autoIt1.WinActivate("Open"); Thread.Sleep(500); autoIt1.Send(@"C:\Users\Nemesis\Pictures\TanslatePix\doggie.jpg"); Thread.Sleep(500); autoIt1.Send("{ENTER}"); Thread.Sleep(500); RemoveItem.Click(); HiddenRadioButton.Click(); Thread.Sleep(1000); ActiveRadioButton.Click(); SaveButton.Click(); Global.GlobalDefinitions.wait(5); //Add Skill Verification ManageListingsTab.Click(); Global.GlobalDefinitions.wait(5); string ExpectedText = Global.GlobalDefinitions.ExcelLib.ReadData(2, "Description"); string ActualText = Global.GlobalDefinitions.driver.FindElement(By.XPath("//*[@id='listing-management-section']/div[2]/div[1]/table/tbody/tr/td[4]")).Text; if (ExpectedText.Equals(ActualText)) { Global.Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Add Skill Successful"); String img = SaveScreenShotClass.SaveScreenshot(GlobalDefinitions.driver, "AddSkill_Pass"); test.Log(LogStatus.Info, "Image example: " + img); } else { Global.Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Add Skill UnSuccessful"); String img1 = SaveScreenShotClass.SaveScreenshot(GlobalDefinitions.driver, "AddSkill_Fail"); test.Log(LogStatus.Info, "Image example: " + img1); } }
public void AddNewSkill() { //Populate the Excel Sheet Global.GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "Shareskills"); GlobalDefinitions.wait(1); //Enter a Title Title.SendKeys(ExcelLib.ReadData(2, "Title")); Base.test.Log(LogStatus.Info, "Added Title successfully"); // Enter description Description.SendKeys(ExcelLib.ReadData(2, "Description")); Base.test.Log(LogStatus.Info, "Added description successfully"); //Select a category from dropdown GlobalDefinitions.wait(2); //Thread.Sleep(500); Actions action = new Actions(GlobalDefinitions.driver); action.MoveToElement(SkillCategory).Build().Perform(); Thread.Sleep(1000); IList <IWebElement> SkillCategorylist = SkillCategory.FindElements(By.TagName("option")); int count = SkillCategorylist.Count; Thread.Sleep(1500); for (int i = 1; i < count; i++) { if (SkillCategorylist[i].Text == ExcelLib.ReadData(2, "Category").Trim()) { Thread.Sleep(500); SkillCategorylist[i].Click(); Base.test.Log(LogStatus.Info, "Added category successfully"); } } //Select a subcategory from dropdown GlobalDefinitions.wait(2); action.MoveToElement(SubCategory).Build().Perform(); GlobalDefinitions.wait(2); IList <IWebElement> SubCategorylist = SubCategory.FindElements(By.TagName("option")); for (int i = 0; i < SubCategorylist.Count; i++) { if (SubCategorylist[i].Text == ExcelLib.ReadData(2, "SubCategory")) { SubCategorylist[i].Click(); Base.test.Log(LogStatus.Info, "Added Subcategory successfully"); } } //Add Tag GlobalDefinitions.wait(2); Tags.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Tag")); Tags.SendKeys(Keys.Enter); Base.test.Log(LogStatus.Info, "Added tag successfully"); //Select Service type GlobalDefinitions.wait(2); string ExpectedService = GlobalDefinitions.ExcelLib.ReadData(2, "Service"); string ActualService = ServiceType1.Text; if (ExpectedService == ActualService) { ServiceType1.Click(); } else { ServiceType2.Click(); } //Select location type Thread.Sleep(2000); GlobalDefinitions.wait(2); string ExpectedLocation = ExcelLib.ReadData(2, "Location"); string ActualLocation = Location1.Text; if (ExpectedLocation == ActualLocation) { Location1.Click(); } else { GlobalDefinitions.wait(2); Location2.Click(); } ////Select start Date GlobalDefinitions.wait(2); //StartDate.SendKeys(ExcelLib.ReadData(2, "StartDate")); //StartDate.SendKeys(Keys.Tab); Thread.Sleep(2000); string sysday = DateTime.Today.Day.ToString(); StartDate.SendKeys(sysday); string sysmonth = DateTime.Today.Month.ToString(); StartDate.SendKeys(sysmonth); // Select EndDate Thread.Sleep(2000); // EndDate.SendKeys(ExcelLib.ReadData(2, "EndDate")); EndDate.SendKeys("20/11/2020"); GlobalDefinitions.wait(2); //Select Available day Thread.Sleep(2000); AvailableDay.Click(); // Select StartTime Thread.Sleep(2000); StartTime.SendKeys(ExcelLib.ReadData(2, "StartTime")); Thread.Sleep(2000); // Select EndTime GlobalDefinitions.wait(1); EndTime.SendKeys(ExcelLib.ReadData(2, "EndTime")); Base.test.Log(LogStatus.Info, "Added avilable date and time successfully"); Thread.Sleep(2000); //Select Skill Trade GlobalDefinitions.wait(2); string ExpectedSkillTrade = ExcelLib.ReadData(2, "Skill Trade"); string ActualSkillTrade = SkillExchange.Text; if (ExpectedSkillTrade == ActualSkillTrade) { SkillExchange.Click(); //Enter skill for exchange SkillExchangeTag.SendKeys(ExcelLib.ReadData(2, "Skillexchange")); } else { Credit.Click(); //Enter rate CreditRate.Clear(); CreditRate.SendKeys(ExcelLib.ReadData(2, "Rate")); } //Upload WorkSample Images string MyWork = ExcelLib.ReadData(2, "UploadImage"); WorkSample.Click(); AutoItX3 autoit = new AutoItX3(); autoit.WinActivate("Open"); autoit.Send(MyWork); GlobalDefinitions.wait(1); autoit.Send("{Enter}"); Base.test.Log(LogStatus.Info, "Uploaded image successfully"); Thread.Sleep(2000); //Select active/ Hidden button GlobalDefinitions.wait(1); GlobalDefinitions.wait(2); string ExpectedAction = ExcelLib.ReadData(2, "Location"); string ActualAction = ActiveBtn.Text; if (ExpectedAction == ActualAction) { ActiveBtn.Click(); } else { GlobalDefinitions.wait(2); HiddenBtn.Click(); } //Check if save button enabled GlobalDefinitions.wait(2); if (SaveBtn.Enabled) { // Click on Save button GlobalDefinitions.wait(2); SaveBtn.Click(); Thread.Sleep(10000); try { //Check for Skill share success message Thread.Sleep(2000); GlobalDefinitions.wait(2); String ExpectedMessage = "Service Listing Added Successfully"; Thread.Sleep(10000); String ActualMessage = driver.FindElement(By.CssSelector("div.ns-box-inner")).Text; Assert.AreEqual(ExpectedMessage, ActualMessage); Base.test.Log(LogStatus.Info, "Skill saved Successfully"); } catch (Exception) { Base.test.Log(LogStatus.Info, "Skill saved Successfully"); } } else { SaveScreenShotClass.SaveScreenshot(driver, "Save button not enabled"); Base.test.Log(LogStatus.Info, "Save button not enabled"); } //Search for the Shared skill in Manage Listing page GlobalDefinitions.wait(2); //Click on manage listing driver.FindElement(By.LinkText("Manage Listings")).Click(); Thread.Sleep(1000); //Check if navigated to service listing page try { string Expected = "Manage Listings"; string Actual = driver.FindElement(By.XPath("//div[@id='listing-management-section']/div[2]/h2")).Text; Assert.AreEqual(Expected, Actual); Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Navigated to manage listing page"); string screenshotpath = SaveScreenShotClass.SaveScreenshot(GlobalDefinitions.driver, "Navigated to manage listing page"); Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Snapshot below:" + Base.test.AddBase64ScreenCapture(screenshotpath)); } catch (Exception) { Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Could not navigate to Manage listing page"); string screenshotpath = SaveScreenShotClass.SaveScreenshot(GlobalDefinitions.driver, "Could not navigate to Manage listing page"); Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Snapshot below:" + Base.test.AddBase64ScreenCapture(screenshotpath)); } //Check if the added skill is present in the Manage listings GlobalDefinitions.wait(2); string ExpectedTitle = ExcelLib.ReadData(2, "Title"); string BeforeXPath = "//div[@id='listing-management-section']/div[2]/div/table/tbody/tr["; string AfterXpath = "]/td[3]"; for (int i = 1; i <= 5; i++) { GlobalDefinitions.wait(2); string ColElements = driver.FindElement(By.XPath(BeforeXPath + i + AfterXpath)).Text; if (ColElements.Contains(ExpectedTitle)) { Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Info, "Skill present in Manage Listing "); string screenshotpath = SaveScreenShotClass.SaveScreenshot(GlobalDefinitions.driver, "Skill present in Manage Listing"); Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Info, "Snapshot below:" + Base.test.AddBase64ScreenCapture(screenshotpath)); break; } else { Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Skill not present in Manage Listing "); string screenshotpath = SaveScreenShotClass.SaveScreenshot(GlobalDefinitions.driver, "Skill not present in Manage Listing"); Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Snapshot below:" + Base.test.AddBase64ScreenCapture(screenshotpath)); } } }