internal void ViewListing() { //extent Reports Base.test = Base.extent.StartTest("View Manage Listings"); //Populate the Excel sheet Global.GlobalDefinitions.ExcelLib.PopulateInCollection(Global.Base.ExcelPath, "ManageListings"); //Click on ManageListing tab ManageListingbtn.Click(); Thread.Sleep(500); //Click on Eye icon EyeIconbtn.Click(); Thread.Sleep(1000); //delete Action Actions action = new Actions(GlobalDefinitions.driver); action.MoveToElement(RemoveIcon).Build().Perform(); IList <IWebElement> listings = RemoveIcon.FindElements(By.XPath("//tr/td[8]/i[3]")); int listingCount = listings.Count; Console.WriteLine("Number of Listings : " + listingCount); for (int i = 0; i < listingCount; i++) { int j = i + 1; var Name = GlobalDefinitions.driver.FindElement(By.XPath("//tr[" + j + "]/td[3]")).Text; Console.WriteLine("Name is : " + Name); if (Name.Equals(ExcelLib.ReadData(2, "Title"))) { listings.ElementAt(i).Click(); Base.test.Log(LogStatus.Pass, "Clicking on delete icon has been successfully performed"); break; } } ////Deactivate listings //Thread.Sleep(1000); //RemoveIcon.Click(); //Click on Yes button Thread.Sleep(1000); Global.GlobalDefinitions.driver.SwitchTo().Alert().Accept(); //Verify listings is deactivated string text1 = Global.GlobalDefinitions.driver.FindElement(By.XPath("//input[@name='title']")).Text; Assert.AreEqual(" ", ListingTitle); }
public void LoadImageName() { // open folder, get all filenames //AppDomain.CurrentDomain.BaseDirectory string path = AppDomain.CurrentDomain.BaseDirectory + foldername; string[] filenames = Directory.GetFiles(path); // check filename to assign to variables foreach (var fullname in filenames) { string filename = Path.GetFileName(fullname); string[] tokens = StringProcess.SplitString(filename, new string[] { "_" }); if (tokens[0].ToLower() == "Application".ToLower()) { ApplicationIcon.Add ( new MyString() { Value = path + filename } ); } else if (tokens[0].ToLower() == "Option".ToLower()) { OptionIcon.Add ( new MyString() { Value = path + filename } ); } else if (tokens[0].ToLower() == "Remove".ToLower()) { RemoveIcon.Add ( new MyString() { Value = path + filename } ); } else if (tokens[0].ToLower() == "RemoveAll".ToLower()) { RemoveAllIcon.Add ( new MyString() { Value = path + filename } ); } else if (tokens[0].ToLower() == "Add".ToLower()) { AddIcon.Add ( new MyString() { Value = path + filename } ); } else if (tokens[0].ToLower() == "Preview".ToLower()) { PreviewIcon.Add ( new MyString() { Value = path + filename } ); } else if (tokens[0].ToLower() == "Start".ToLower()) { StartIcon.Add ( new MyString() { Value = path + filename } ); } else if (tokens[0].ToLower() == "Refresh".ToLower()) { RefreshIcon.Add ( new MyString() { Value = path + filename } ); } else if (tokens[0].ToLower() == "Help".ToLower()) { HelpIcon.Add ( new MyString() { Value = path + filename } ); } else if (tokens[0].ToLower() == "Open".ToLower()) { OpenIcon.Add ( new MyString() { Value = path + filename } ); } else if (tokens[0].ToLower() == "Save".ToLower()) { SaveIcon.Add ( new MyString() { Value = path + filename } ); } else if (tokens[0].ToLower() == "Information".ToLower()) { InformationIcon.Add ( new MyString() { Value = path + filename } ); } else if (tokens[0].ToLower() == "File".ToLower()) { FileIcon.Add ( new MyString() { Value = path + filename } ); } else if (tokens[0].ToLower() == "Folder".ToLower()) { FolderIcon.Add ( new MyString() { Value = path + filename } ); } else if (tokens[0].ToLower() == "Action".ToLower()) { ActionIcon.Add ( new MyString() { Value = path + filename } ); } else if (tokens[0].ToLower() == "List".ToLower()) { ListIcon.Add ( new MyString() { Value = path + filename } ); } } }
public void LoadImageName() { // open folder, get all filenames string path = AppDomain.CurrentDomain.BaseDirectory + foldername; string[] filenames = Directory.GetFiles(path); // check filename to assign to variables foreach (var fullname in filenames) { string filename = Path.GetFileName(fullname); string[] tokens = filename.Split(new string[] { "_" }, StringSplitOptions.RemoveEmptyEntries); if (tokens[0].ToLower() == "Application".ToLower()) { ApplicationIcon.Add ( path + filename ); } else if (tokens[0].ToLower() == "Option".ToLower()) { OptionIcon.Add ( path + filename ); } else if (tokens[0].ToLower() == "Remove".ToLower()) { RemoveIcon.Add ( path + filename ); } else if (tokens[0].ToLower() == "RemoveAll".ToLower()) { RemoveAllIcon.Add ( path + filename ); } else if (tokens[0].ToLower() == "Add".ToLower()) { AddIcon.Add ( path + filename ); } else if (tokens[0].ToLower() == "Preview".ToLower()) { PreviewIcon.Add ( path + filename ); } else if (tokens[0].ToLower() == "Start".ToLower()) { StartIcon.Add ( path + filename ); } else if (tokens[0].ToLower() == "Refresh".ToLower()) { RefreshIcon.Add ( path + filename ); } else if (tokens[0].ToLower() == "Help".ToLower()) { HelpIcon.Add ( path + filename ); } else if (tokens[0].ToLower() == "Open".ToLower()) { OpenIcon.Add ( path + filename ); } else if (tokens[0].ToLower() == "Save".ToLower()) { SaveIcon.Add ( path + filename ); } else if (tokens[0].ToLower() == "Information".ToLower()) { InformationIcon.Add ( path + filename ); } else if (tokens[0].ToLower() == "File".ToLower()) { FileIcon.Add ( path + filename ); } else if (tokens[0].ToLower() == "Folder".ToLower()) { FolderIcon.Add ( path + filename ); } else if (tokens[0].ToLower() == "Action".ToLower()) { ActionIcon.Add ( path + filename ); } else if (tokens[0].ToLower() == "List".ToLower()) { ListIcon.Add ( path + filename ); } else if (tokens[0].ToLower() == "UpDirection".ToLower()) { UpDirectionIcon.Add ( path + filename ); } else if (tokens[0].ToLower() == "RightDirection".ToLower()) { RightDirectionIcon.Add ( path + filename ); } else if (tokens[0].ToLower() == "DownDirection".ToLower()) { DownDirectionIcon.Add ( path + filename ); } else if (tokens[0].ToLower() == "LeftDirection".ToLower()) { LeftDirectionIcon.Add ( path + filename ); } else { Images.Add ( path + filename ); } } }