public override void Action() { Tab tab = (Tab)control; ITabPage iTabPage = tab.Pages.Where(x => x.Name.Replace(" ", "").Contains(criteria)).FirstOrDefault(); TabPage tabPage = (TabPage)iTabPage; if (actionType == ActionType.click) { tabPage.Click(); return; } if (actionType == ActionType.doubleClick) { tabPage.DoubleClick(); return; } if (actionType == ActionType.select) { tabPage.Select(); return; } throw new Exception($"Control Doesn't Accept Action Type {actionType}"); }