internal void EditShareSkill() { //Call CheckExistingSkillPresent method to check if any Share Skill is present, if not add a Share Skill CheckExistingSkillPresent(); //Creating Share Skill Object ShareSkill shareSkill = new ShareSkill(); //Populate the excel data GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPathManageListing, "EditShareSkill"); //Call SearchListings Method to get count for existing records with same category,title and description as we are going to update int MatchingRecordsBeforeEdit = SearchListings(GlobalDefinitions.ExcelLib.ReadData(2, "Category"), GlobalDefinitions.ExcelLib.ReadData(2, "Title"), GlobalDefinitions.ExcelLib.ReadData(2, "Description")); //Navigate to Manage Listing NavigateToManageListing(); Thread.Sleep(2000); //Click the Edit icon edit.Click(); //Call EnterShareSkillData method to add Edit data shareSkill.EnterShareSkillData(); //Call ValidateShareSkillData Method to Validate entered Share Skill data // shareSkill.ValidateShareSkillData(); //Call SaveShareSkill Method to save the Share Skill string img = shareSkill.SaveShareSkill(); //Call SearchListings Method to get count for records with same category,title and description as we edited int MatchingRecordsAfterEdit = SearchListings(GlobalDefinitions.ExcelLib.ReadData(2, "Category"), GlobalDefinitions.ExcelLib.ReadData(2, "Title"), GlobalDefinitions.ExcelLib.ReadData(2, "Description")); Console.WriteLine("MatchingRecordsBeforeEdit== {0}", MatchingRecordsBeforeEdit); Console.WriteLine("MatchingRecordsBeforeEdit== {0}", MatchingRecordsAfterEdit); //checking if number of records with same category,title and description is 1 more than it has before int ExpectedRecords = MatchingRecordsBeforeEdit + 1; try { if (ExpectedRecords == MatchingRecordsAfterEdit) { Base.test.Log(LogStatus.Pass, "Test Passed, Edited a Share Skill Successfully"); Base.test.Log(LogStatus.Pass, "Image-" + img); Assert.IsTrue(true); } else { Base.test.Log(LogStatus.Fail, "Test Failed, Edited a Share Skill Successfully" + img); } } catch (Exception e) { Base.test.Log(LogStatus.Fail, "Test Failed, Edited a Share Skill Successfully", e.Message); } }