internal void EditManageListings() { manageListingsLink.Clicks(); Thread.Sleep(3000); GlobalDefinitions.driver.FindElement(By.XPath("(//button[contains(@role,'button')])[2]")).Clicks(); Thread.Sleep(3000); GlobalDefinitions.driver.FindElement(By.XPath("(//i[contains(@class,'outline write icon')])[1]")).Clicks(); //Populate the Excel Sheet GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "ShareSkill"); //Read data from excel string Title = GlobalDefinitions.ExcelLib.ReadData(2, "Title"); string desc = GlobalDefinitions.ExcelLib.ReadData(2, "Description"); string cat = GlobalDefinitions.ExcelLib.ReadData(2, "Category"); string subCat = GlobalDefinitions.ExcelLib.ReadData(2, "SubCategory"); string tag = GlobalDefinitions.ExcelLib.ReadData(2, "Tags"); string location = GlobalDefinitions.ExcelLib.ReadData(2, "LocationType"); string ServiceType = GlobalDefinitions.ExcelLib.ReadData(2, "ServiceType"); //string SDate = GlobalDefinitions.ExcelLib.ReadData(2, "Startdate"); //string Edate = GlobalDefinitions.ExcelLib.ReadData(2, "Enddate"); //string StartTime = GlobalDefinitions.ExcelLib.ReadData(2, "Starttime"); //string EndTime = GlobalDefinitions.ExcelLib.ReadData(2, "Endtime"); string Skilltrade = GlobalDefinitions.ExcelLib.ReadData(2, "SkillTrade"); string SkillExchange = GlobalDefinitions.ExcelLib.ReadData(2, "Skill-Exchange"); string Credit = GlobalDefinitions.ExcelLib.ReadData(2, "Credit"); string Active = GlobalDefinitions.ExcelLib.ReadData(2, "Active"); ShareSkill es = new ShareSkill(); es.EditShareSkill(Title, desc, cat, subCat, tag, ServiceType, location, //SDate,Edate,StartTime,EndTime, Skilltrade, SkillExchange, Credit, Active); }
public void ServiceListing() { try { // Creates a toggle for the given test, adds all log events under it test = extent.StartTest("ShareSkill"); // Create an class and object to call the method Pages.ShareSkill obj1 = new Pages.ShareSkill(); // obj1.EnterShareSkill(); obj1.EnterShareSkill1(); Thread.Sleep(3000); string ExpectedValue = GlobalDefinitions.driver.Title; //Console.WriteLine(ExpectedValue); string ActualValue = "ListingManagement"; if (ExpectedValue == ActualValue) { test.Log(LogStatus.Pass, "Test Passed, Added a Skill Successfully"); Console.WriteLine("Test Passed Added a Skill Successfully"); } else { test.Log(LogStatus.Fail, "Test Failed Expected not equal"); Console.WriteLine("Test Failed not equal"); } } catch (Exception e) { test.Log(LogStatus.Fail, "Test Failed", e.StackTrace); Console.WriteLine("Test Failed"); } }
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); } }
internal void DeleteShareSkill() { //Populate the excel data GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPathManageListing, "ManageListings"); //Get the Category, Title, Description and Action for Deletion string CategoryToDelete = GlobalDefinitions.ExcelLib.ReadData(2, "Category"); string TitleToDelete = GlobalDefinitions.ExcelLib.ReadData(2, "Title"); string DescriptionToDelete = GlobalDefinitions.ExcelLib.ReadData(2, "Description"); string Action = GlobalDefinitions.ExcelLib.ReadData(2, "Deleteaction"); //Navigate to Manage Listing NavigateToManageListing(); //Call SearchListings Method to get count for existing records with same category,title and description as we are going to Delete int MatchingRecordsBeforeDelete = SearchListings(CategoryToDelete, TitleToDelete, DescriptionToDelete); Console.WriteLine("MatchingRecordsBeforeDelete== {0}", MatchingRecordsBeforeDelete); if (MatchingRecordsBeforeDelete < 1) { ShareSkill shareSkill = new ShareSkill(); shareSkill.AddShareSkill(); MatchingRecordsBeforeDelete = SearchListings(CategoryToDelete, TitleToDelete, DescriptionToDelete); } //Navigate to Manage Listing NavigateToManageListing(); //Calling DeleteRecord to delete Share Skill DeleteRecord(CategoryToDelete, TitleToDelete, DescriptionToDelete, Action); //Call SearchListings Method to get count for existing records with same category,title and description as we have Deleted int MatchingRecordsAfterDelete = SearchListings(CategoryToDelete, TitleToDelete, DescriptionToDelete); int ExpectedRecords = MatchingRecordsBeforeDelete - 1; Console.WriteLine("MatchingRecordsBeforeDelete== {0}", MatchingRecordsBeforeDelete); Console.WriteLine("MatchingRecordsAfterDelete =={0}", MatchingRecordsAfterDelete); //checking if number of records with same category,title and description is 1 less than it has before try { if (ExpectedRecords == MatchingRecordsAfterDelete) { Base.test.Log(LogStatus.Pass, "Test Passed, Deleted a Share Skill Successfully"); Base.test.Log(LogStatus.Pass, "Image-" + img); Assert.IsTrue(true); } else { Base.test.Log(LogStatus.Fail, "Test Failed, Deleted a Share Skill Successfully" + img); } } catch (Exception e) { Base.test.Log(LogStatus.Fail, "Test Failed, Deleted a Share Skill Successfully", e.Message); } }
internal void EditSharedSkill() { GlobalDefinitions.wait(3000); edit.Click(); GlobalDefinitions.TurnOnWait(); ShareSkill s = new ShareSkill(); s.editShareskill(); GlobalDefinitions.wait(3000); }
internal void EditListing() {//papulating the data from excelsheet GlobalDefinitions.WaitForElement(GlobalDefinitions.driver, By.XPath("//a[contains(.,'Manage Listings')]"), 10); manageListingsLink.Click(); GlobalDefinitions.WaitForElement(GlobalDefinitions.driver, By.XPath("(//i[@class='outline write icon'])[1]"), 10); //click on edit button edit.Click(); ShareSkill shareSkill = new ShareSkill(); shareSkill.EditShareSkill(); }
internal void EditManageListings() { //Click on the Manage Listings Tab ManageListingsTab.Click(); Thread.Sleep(2000); // Click on the Edit Icon EditButton.Click(); Thread.Sleep(2000); ShareSkill ShareSkillPage = new ShareSkill(); ShareSkillPage.EditShareSkill(); }
internal void ManageListingsEditListingSteps() { //Click on Manage Listings button ManageListingsbutton.Click(); Thread.Sleep(1500); //Click on Manage Listings edit button EditButton.Click(); Thread.Sleep(1500); ShareSkill ShareSkillPage = new ShareSkill(); ShareSkillPage.EditSkillSteps(); }
//Update Record public void EditManageListing() { //Click on Update Button Update.Click(); //Create an instance of share skill page ShareSkill share = new ShareSkill(); //click on Enter skill on share skill page share.AddShareSkills(); //implicit wait Driver.TurnOnWait(); }
internal void Edit() { //Click on Edit button edit.Click(); //Validate the Page Thread.Sleep(2000); String myTitle1 = GlobalDefinitions.driver.Title; Console.WriteLine(myTitle1); Assert.That(myTitle1, Is.EqualTo("ServiceListing")); ShareSkill.EditShareSkill(); }
//Check if existing Share SKill is present internal void CheckExistingSkillPresent() { //Navigate to Manage Listings NavigateToManageListing(); //Creating Share Skill Object ShareSkill shareSkill = new ShareSkill(); Thread.Sleep(1000); if (TableRows.Count < 1) { //Add a Share Skill shareSkill.AddShareSkill(); } }
public void SanityTest() { // Create an class and object to call the method Profile obj = new Profile(); //Click on Edit button obj.AvailabilityTimeEdit.Click(); //Availability Hours Edit obj.AvailabilityHoursEdit.Click(); //Salary obj.SalaryEdit.Click(); //Click on Add New Language button //obj.LanBtn.Click(); //Click on Skill Button obj.SkillBtn.Click(); //Click on Education Tab obj.EduBtn.Click(); //Click on Certificates Tab obj.CertiBtn.Click(); // Create an class and object to call the method ManageListings obj1 = new ManageListings(); //Click on Manage Listings obj1.manageListingsLink.Click(); // Create an class and object to call the method ShareSkill obj2 = new ShareSkill(); //Click on Manage Listings obj2.ShareSkillButton.Click(); }
internal void UpdateListing() { GlobalDefinitions.wait(2000); while (true) { for (int i = 1; i < 5; i++) { IWebElement ela = GlobalDefinitions.driver.FindElement(By.XPath("//*[@id='listing-management-section']/div[2]/div[1]/div[1]/table/tbody/tr[" + i + "]/td[3]")); String Eleme = ela.Text; if (Eleme == "Java") { Thread.Sleep(2000); GlobalDefinitions.driver.FindElement(By.XPath("//*[@id='listing-management-section']/div[2]/div[1]/div[1]/table/tbody/tr[" + i + "]/td[8]/div/button[2]/i")).Click(); ShareSkill updte = new ShareSkill(); updte.EditShareSkill(); return; } } Thread.Sleep(2000); GlobalDefinitions.driver.FindElement(By.XPath("//*[@id='listing-management-section']/div[2]/div[1]/div[2]/button[10]")).Click(); } }
//Delete the Share skill internal void DeleteShareSkill() { //Populate the excel data GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPathManageListing, "ManageListings"); //Get the Category, Title, Description and Action for Deletion string CategoryToDelete = GlobalDefinitions.ExcelLib.ReadData(2, "Category"); string TitleToDelete = GlobalDefinitions.ExcelLib.ReadData(2, "Title"); string DescriptionToDelete = GlobalDefinitions.ExcelLib.ReadData(2, "Description"); string Action = GlobalDefinitions.ExcelLib.ReadData(2, "Deleteaction"); //Navigate to Manage Listing NavigateToManageListing(); //Call SearchListings Method to get count for existing records with same category,title and description as we are going to Delete int MatchingRecordsBeforeDelete = SearchListings(CategoryToDelete, TitleToDelete, DescriptionToDelete); //Console.WriteLine("MatchingRecordsBeforeDelete== {0}", MatchingRecordsBeforeDelete); if (MatchingRecordsBeforeDelete < 1) { ShareSkill shareSkill = new ShareSkill(); shareSkill.AddShareSkill(); MatchingRecordsBeforeDelete = 1; //MatchingRecordsBeforeDelete = SearchListings(CategoryToDelete, TitleToDelete, DescriptionToDelete); } //Navigate to Manage Listing NavigateToManageListing(); //Calling DeleteRecord to delete Share Skill DeleteRecord(CategoryToDelete, TitleToDelete, DescriptionToDelete, Action); //Call SearchListings Method to get count for existing records with same category,title and description as we have Deleted int MatchingRecordsAfterDelete = SearchListings(CategoryToDelete, TitleToDelete, DescriptionToDelete); int ExpectedRecords = MatchingRecordsBeforeDelete - 1; //checking if number of records with same category,title and description is 1 less than it has before GlobalDefinitions.ValidateBoolean(ExpectedRecords == MatchingRecordsAfterDelete, "Share Skill Deleted"); }
//Edit by creating new element internal void CreatingNewElement(string titleRead) { ShareSkill skill = new ShareSkill(); skill.WriteTitle(titleRead); skill.WriteDescription(); skill.SelectCategory(); skill.SelectSubCategory(); skill.AddTag_1(); skill.SelectServiceType(); skill.SelectLocationType(); skill.StartingDate(); skill.EndingDate(); skill.CountDays(); skill.StartingTime(); skill.EndingTime(); skill.SkillsToTrade(); skill.AddTag_2(); skill.UploadFile(); skill.SelectStatus(); skill.SaveDetails(); }
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 EditShareSkillData method to add Edit data shareSkill.EditShareSkillData(); //Call SaveShareSkill Method to save the Share Skill 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")); //checking if number of records with same category,title and description is 1 more than it has before int ExpectedRecords = MatchingRecordsBeforeEdit + 1; GlobalDefinitions.ValidateBoolean(ExpectedRecords == MatchingRecordsAfterEdit, "Share Skill Edited"); }
public void AddNewSkill() { #region Navigate to Share Skills Page // Click on Share Skills Page ShareSkill.WaitForElementClickable(_driver, 60); ShareSkill.Click(); //Populate the excel data GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "ShareSkills"); #endregion #region Enter Title Title.WaitForElementClickable(_driver, 60); //Enter the data in Title textbox Title.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "title")); #endregion #region Enter Description //Enter the data in Description textbox Description.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "EnterDescription")); #endregion #region Category Drop Down // Click on Category Dropdown Category.Click(); // Select Category from Category Drop Down var SelectElement = new SelectElement(Category); SelectElement.SelectByText((GlobalDefinitions.ExcelLib.ReadData(2, "category"))); // Click on Sub-Category Dropdown SubCategory.Click(); //Select Sub-Category from the Drop Down var SelectElement1 = new SelectElement(SubCategory); SelectElement1.SelectByText((GlobalDefinitions.ExcelLib.ReadData(2, "subcategory"))); #endregion #region Tags // Eneter Tag Tag.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "TagName")); Tag.SendKeys(Keys.Enter); #endregion #region Service Type Selection // Service Type Selection if (GlobalDefinitions.ExcelLib.ReadData(2, "ServiceType") == "Hourly basis service") { ServiceTypeHourly.Click(); } else if (GlobalDefinitions.ExcelLib.ReadData(2, "ServiceType") == "One-off service") { ServiceTypeOnOff.Click(); } #endregion #region Select Location Type // Location Type Selection if (GlobalDefinitions.ExcelLib.ReadData(2, "SelectLocationType") == "On-site") { LocationTypeOnsite.Click(); } else if (GlobalDefinitions.ExcelLib.ReadData(2, "SelectLocationType") == "Online") { LocationTypeOnline.Click(); } #endregion #region Select Available Dates from Calendar // Select Start Date StartDate.Click(); // Select End Date EndDate.Click(); #endregion #region Select Skill Trade // Select Skill Trade if (GlobalDefinitions.ExcelLib.ReadData(2, "SelectSkillTrade") == "Skill-exchange") { RequiredSkills.Click(); RequiredSkills.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "ExchangeSkill")); RequiredSkills.SendKeys(Keys.Enter); } else if (GlobalDefinitions.ExcelLib.ReadData(2, "SelectSkillTrade") == "Credit") { CreditAmount.Click(); CreditAmount.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "AmountInExchange")); CreditAmount.SendKeys(Keys.Enter); } #endregion #region Select User Status // Select User Status if (GlobalDefinitions.ExcelLib.ReadData(2, "UserStatus") == "Active") { StatusActive.Click(); } else if (GlobalDefinitions.ExcelLib.ReadData(2, "UserStatus") == "Hidden") { StatusHidden.Click(); } #endregion #region Add Work Sample //Work Sample upload button path IWebElement upload = _driver.FindElement(By.XPath("//*[@id='selectFile']")); // Uploading File path var GetCurrentDirectory = Directory.GetCurrentDirectory(); String path = GetCurrentDirectory + @"\MarsFramework\Upload Files\Samplework.txt"; upload.SendKeys(path); #endregion #region Save / Cancel Skill // Save or Cancel New Skill if (Global.GlobalDefinitions.ExcelLib.ReadData(2, "SaveOrCancel") == "Save") { SaveShareSkills.Click(); } else if (Global.GlobalDefinitions.ExcelLib.ReadData(2, "SaveOrCancel") == "Cancel") { CancelShareSkills.Click(); } #endregion #region Check whether New skill created sucessfully string ShareSkillSucess = _driver.FindElement(By.LinkText("Manage Listings")).Text; if (ShareSkillSucess == "Manage Listings") { Global.Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Shared Skill Successful"); } else { Global.Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Share Skill Unsuccessful"); } #endregion }
public ManageListings(ShareSkill _ShareSkillRefObj) { PageFactory.InitElements(Global.GlobalDefinitions.driver, this); this.ShareSkillRefObj = _ShareSkillRefObj; }
internal void EditShareSkill(string CategoryToSearch, string TitleToSearch, string DescriptionToSearch) { GenericWait.ElementIsVisible(GlobalDefinitions.driver, "LinkText", "Manage Listings", 8); //Navigate to Manage Listing page manageListingsLink.Click(); int RecordFound = 0; GenericWait.ElementIsVisible(GlobalDefinitions.driver, "XPath", "//div[@id='listing-management-section']/div/div[1]/div[1]", 8); // GlobalDefinitions.WaitForElement(GlobalDefinitions.driver, By.XPath("//div[@id='listing-management-section']/div/div[1]/div[1]"), 5); Thread.Sleep(2000); // Searching for the added share skill record in the Manage Listing and validating is it available or not for (int i = 0; i < paginationButtons.Count - 2; i++) { Thread.Sleep(2000); //Loop for searching the added share skill through the pages foreach (IWebElement listingRecord in tableRows) { string Category = listingRecord.FindElement(By.XPath("td[2]")).Text; string Title = listingRecord.FindElement(By.XPath("td[3]")).Text; string Description = listingRecord.FindElement(By.XPath("td[4]")).Text; //Comparing Category,title,description to find out corresponding Edit button and Editing item if (Category == CategoryToSearch && Title == TitleToSearch && Description == DescriptionToSearch) { //Editing a matched record int rowToBeEdited = tableRows.IndexOf(listingRecord) + 1; listingRecord.FindElement(By.XPath("//tr[" + rowToBeEdited + "]/td[8]/div/button[2]/i")).Click(); Thread.Sleep(2000); //log after editing Base.test.Log(LogStatus.Pass, "Share skill with titlename" + " " + Title + " " + "edit button is clicked and navigated to Edit share skill page"); RecordFound++; GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPathAddShareSkill, "EditShareSkill"); //Calling EnterShareSkill() for adding share skill data ShareSkill shareSkill = new ShareSkill(); //shareSkill.EnterShareSkill(); shareSkill.EditShareSkillData(); Thread.Sleep(2000); //Clicking Save button Save.Click(); //Validating edited record int MatchingRecordFoundAfterAdding = SearchListings(GlobalDefinitions.ExcelLib.ReadData(2, "Category"), GlobalDefinitions.ExcelLib.ReadData(2, "Title"), GlobalDefinitions.ExcelLib.ReadData(2, "Description")); int ExpectedRecords = MatchingRecordFoundAfterAdding + 1; try { if (MatchingRecordFoundAfterAdding > 0) { Base.test.Log(LogStatus.Pass, "Edited and saved a Share Skill Successfully"); Assert.IsTrue(true); } else { Base.test.Log(LogStatus.Fail, "Edit and adding a Share Skill is unsuccessful" + " " + "Screenshot Image " + GlobalDefinitions.SaveScreenShotClass.SaveScreenshot(GlobalDefinitions.driver, "ShareSkillScreenshot")); } } catch (Exception e) { Base.test.Log(LogStatus.Fail, "Edit and adding a Share Skill is unsuccessful", e.Message); } return; } } if (nextButton.Enabled == true) { nextButton.Click(); } } }
internal void Listings() { Global.GlobalDefinitions.wait(60000); //Populate the Excel Sheet GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "ManageListings"); //Click on Manage Listings manageListingsLink.Click(); //Click on view the listing view.Click(); GlobalDefinitions.driver.Navigate().Back(); //Click on edit the listing edit.Click(); ShareSkill obj = new ShareSkill(); obj.EnterShareSkill1(); //Click on delete the listing // Actions action = new Actions(GlobalDefinitions.driver); // action.MoveToElement(delete).Build().Perform(); // IList<IWebElement> listings = delete.FindElements(By.XPath("//table[@class='ui striped table']/tbody/tr")); IList <IWebElement> listings = GlobalDefinitions.driver.FindElements(By.XPath("//table[@class='ui striped table']/tbody/tr")); int listingCount = listings.Count; Console.WriteLine("Number of Listings : " + listingCount); //GlobalDefinitions.driver.FindElement(By.XPath("//table[@class='ui striped table']/tbody/tr[2]/td[8]/div/button[3]/i")).Click(); for (int i = 1; i <= listingCount; i++) { // int j = i + 1; var Name = GlobalDefinitions.driver.FindElement(By.XPath("//table[@class='ui striped table']/tbody/tr[" + i + "]/td[3]")).Text; Console.WriteLine("Name is : " + Name); if (Name.Equals(ExcelLib.ReadData(2, "Title"))) { Thread.Sleep(3000); } { GlobalDefinitions.driver.FindElement(By.XPath("//table[@class='ui striped table']/tbody/tr[" + i + "]/td[8]/div/button[3]/i")).Click(); Base.test.Log(LogStatus.Pass, "Clicking on delete icon has been successfully performed"); } break; } // To click on yes or no in the alert message for deleting // action.MoveToElement(clickActionsButton).Build().Perform(); IList <IWebElement> clickAction = clickActionsButton.FindElements(By.TagName("button")); //Indicating the number of buttons present int clickActionCount = clickAction.Count; Console.WriteLine("Number of Actions for Deleting : " + clickActionCount); for (int i = 1; i <= clickActionCount; i++) { if (clickAction[i].Text == GlobalDefinitions.ExcelLib.ReadData(2, "Deleteaction")) { clickAction[i].Click(); Base.test.Log(LogStatus.Info, "Action has been performed successfully"); break; } } }