public static void SelectServer() { try { try{ repo.ChooseFromServer.ServerListInfo.WaitForExists(new Duration(10000)); } catch { SelectServer(); } TreeItem SelectedServer = repo.ChooseFromServer.ServerList.Items[0].Items[0].GetItem(Preconditions.Steps.SelectedServerName); if (SelectedServer == null) { TreeItem server = Preconditions.Steps.GetServerTreeFromTCName(Config.TestCaseName); Preconditions.Steps.SelectedServerTreeItem = server; Preconditions.Steps.SelectedServerName = server.Text; SelectedServer = repo.ChooseFromServer.ServerList.Items[0].Items[0].GetItem(server.Text); } SelectedServer.EnsureVisible(); TreeItem SelectedDB = SelectedServer.GetItem(Config.ADSDB); SelectedDB.EnsureVisible(); SelectedDB.Select(); Reports.ReportLog("SelectServer", Reports.ADSReportLevel.Success, null, Configuration.Config.TestCaseName); } catch (Exception ex) { throw new Exception("Failed : SelectServer : " + ex.Message); } }
public static void TreeItemCollapse(TreeItem treeitem) { try { treeitem.EnsureVisible(); treeitem.CollapseAll(); } catch (Exception ex) { throw new Exception("TreeItem Collapse failed : " + ex.Message); } }
public static void TreeItemDoubleClickToExpand(TreeItem treeitem) { try { treeitem.EnsureVisible(); treeitem.DoubleClick(); } catch (Exception ex) { throw new Exception("TreeItem Double Click To Expand failed : " + ex.Message); } }
public static TreeItem GetServerTreeFromTCName(string TCName) { TreeItem item = null; try { if (TCName.Contains(ServerListConstants.Amazon_Redshift)) { item = repo.ServersList.LocalDBServersTreeItem.GetItem(ServerListConstants.Amazon_Redshift.Replace('_', ' ')); } if (TCName.Contains(ServerListConstants.Cassandra_37)) { item = repo.ServersList.LocalDBServersTreeItem.GetItem(ServerListConstants.Cassandra_37.Replace('_', ' ')); } if (TCName.Contains(ServerListConstants.Cassandra_22)) { item = repo.ServersList.LocalDBServersTreeItem.GetItem(ServerListConstants.Cassandra_22.Replace('_', ' ')); } if (TCName.Contains(ServerListConstants.Apache_Derby_1014)) { item = repo.ServersList.LocalDBServersTreeItem.GetItem(ServerListConstants.Apache_Derby_1014.Replace('_', ' ')); } if (TCName.Contains(ServerListConstants.Derby_1013)) { item = repo.ServersList.LocalDBServersTreeItem.GetItem(ServerListConstants.Derby_1013.Replace('_', ' ')); } if (TCName.Contains(ServerListConstants.DB2_LUW_111)) { item = repo.ServersList.LocalDBServersTreeItem.GetItem(ServerListConstants.DB2_LUW_111.Replace('_', ' ')); } if (TCName.Contains(ServerListConstants.DB2_LUW_105)) { item = repo.ServersList.LocalDBServersTreeItem.GetItem(ServerListConstants.DB2_LUW_105.Replace('_', ' ')); } if (TCName.Contains(ServerListConstants.Greenplum_50)) { item = repo.ServersList.LocalDBServersTreeItem.GetItem(ServerListConstants.Greenplum_50.Replace('_', ' ')); } if (TCName.Contains(ServerListConstants.Greenplum_4312)) { item = repo.ServersList.LocalDBServersTreeItem.GetItem(ServerListConstants.Greenplum_4312.Replace('_', ' ')); } if (TCName.Contains(ServerListConstants.Informix_1170)) { item = repo.ServersList.LocalDBServersTreeItem.GetItem(ServerListConstants.Informix_1170.Replace('_', ' ')); } if (TCName.Contains(ServerListConstants.Informix_1210)) { item = repo.ServersList.LocalDBServersTreeItem.GetItem(ServerListConstants.Informix_1210.Replace('_', ' ')); } if (TCName.Contains(ServerListConstants.MariaDB_102)) { item = repo.ServersList.LocalDBServersTreeItem.GetItem(ServerListConstants.MariaDB_102.Replace('_', ' ')); } if (TCName.Contains(ServerListConstants.MongoDB_321)) { item = repo.ServersList.LocalDBServersTreeItem.GetItem(ServerListConstants.MongoDB_321.Replace('_', ' ')); } if (TCName.Contains(ServerListConstants.MongoDB_341)) { item = repo.ServersList.LocalDBServersTreeItem.GetItem(ServerListConstants.MongoDB_341.Replace('_', ' ')); } if (TCName.Contains(ServerListConstants.MySQL_80)) { item = repo.ServersList.LocalDBServersTreeItem.GetItem(ServerListConstants.MySQL_80.Replace('_', ' ')); } if (TCName.Contains(ServerListConstants.MySQL_57)) { item = repo.ServersList.LocalDBServersTreeItem.GetItem(ServerListConstants.MySQL_57.Replace('_', ' ')); } if (TCName.Contains(ServerListConstants.Netezza_72)) { item = repo.ServersList.LocalDBServersTreeItem.GetItem(ServerListConstants.Netezza_72.Replace('_', ' ')); } if (TCName.Contains(ServerListConstants.Oracle_121020)) { item = repo.ServersList.LocalDBServersTreeItem.GetItem(ServerListConstants.Oracle_121020.Replace('_', ' ')); } if (TCName.Contains(ServerListConstants.Oracle_11gR2)) { item = repo.ServersList.LocalDBServersTreeItem.GetItem(ServerListConstants.Oracle_11gR2.Replace('_', ' ')); } if (TCName.Contains(ServerListConstants.PostgreSQL_100)) { item = repo.ServersList.LocalDBServersTreeItem.GetItem(ServerListConstants.PostgreSQL_100.Replace('_', ' ')); } if (TCName.Contains(ServerListConstants.PostgreSQL_96)) { item = repo.ServersList.LocalDBServersTreeItem.GetItem(ServerListConstants.PostgreSQL_96.Replace('_', ' ')); } if (TCName.Contains(ServerListConstants.SAP_Hana_20)) { item = repo.ServersList.LocalDBServersTreeItem.GetItem(ServerListConstants.SAP_Hana_20.Replace('_', ' ')); } if (TCName.Contains(ServerListConstants.Microsoft_SQL_Azure_RTM_12020008)) { item = repo.ServersList.LocalDBServersTreeItem.GetItem(ServerListConstants.Microsoft_SQL_Azure_RTM_12020008.Replace('_', ' ')); } if (TCName.Contains(ServerListConstants.SQL_Server_2017)) { item = repo.ServersList.LocalDBServersTreeItem.GetItem(ServerListConstants.SQL_Server_2017.Replace('_', ' ')); } if (TCName.Contains(ServerListConstants.SQL_Server_2016)) { item = repo.ServersList.LocalDBServersTreeItem.GetItem(ServerListConstants.SQL_Server_2016.Replace('_', ' ')); } if (TCName.Contains(ServerListConstants.Sybase_Any_16)) { item = repo.ServersList.LocalDBServersTreeItem.GetItem(ServerListConstants.Sybase_Any_16.Replace('_', ' ')); } if (TCName.Contains(ServerListConstants.Sybase_Any_17)) { item = repo.ServersList.LocalDBServersTreeItem.GetItem(ServerListConstants.Sybase_Any_17.Replace('_', ' ')); } if (TCName.Contains(ServerListConstants.Sybase_ASE_16)) { item = repo.ServersList.LocalDBServersTreeItem.GetItem(ServerListConstants.Sybase_ASE_16.Replace('_', ' ')); } if (TCName.Contains(ServerListConstants.Sybase_ASE_157)) { item = repo.ServersList.LocalDBServersTreeItem.GetItem(ServerListConstants.Sybase_ASE_157.Replace('_', ' ')); } if (TCName.Contains(ServerListConstants.Sybase_IQ_154)) { item = repo.ServersList.LocalDBServersTreeItem.GetItem(ServerListConstants.Sybase_IQ_154.Replace('_', ' ')); } if (TCName.Contains(ServerListConstants.Sybase_IQ_160)) { item = repo.ServersList.LocalDBServersTreeItem.GetItem(ServerListConstants.Sybase_IQ_160.Replace('_', ' ')); } if (TCName.Contains(ServerListConstants.Teradata_150)) { item = repo.ServersList.LocalDBServersTreeItem.GetItem(ServerListConstants.Teradata_150.Replace('_', ' ')); } if (TCName.Contains(ServerListConstants.Teradata_151)) { item = repo.ServersList.LocalDBServersTreeItem.GetItem(ServerListConstants.Teradata_151.Replace('_', ' ')); } if (TCName.Contains(ServerListConstants.Teradata_1620)) { item = repo.ServersList.LocalDBServersTreeItem.GetItem(ServerListConstants.Teradata_1620.Replace('_', ' ')); } if (TCName.Contains(ServerListConstants.Vertica_80)) { item = repo.ServersList.LocalDBServersTreeItem.GetItem(ServerListConstants.Vertica_80.Replace('_', ' ')); } if (TCName.Contains(ServerListConstants.Vertica_91)) { item = repo.ServersList.LocalDBServersTreeItem.GetItem(ServerListConstants.Vertica_91.Replace('_', ' ')); } item.EnsureVisible(); item.ClickThis(); } catch (Exception ex) { throw new Exception("Get ServerTree From TCName failed : " + ex.Message); } return(item); }
public static TreeItem GetServerTreeFromTCName_old(string TCName) { TreeItem item = null; try { if (TCName.Contains(ServerListConstants.Amazon_Redshift)) { item = repo.ServersList.AmazonRedshift; } if (TCName.Contains(ServerListConstants.Cassandra_37)) { item = repo.ServersList.Cassandra37; } if (TCName.Contains(ServerListConstants.Cassandra_22)) { item = repo.ServersList.Cassandra22; } if (TCName.Contains(ServerListConstants.Apache_Derby_1014)) { item = repo.ServersList.Derby1014; } if (TCName.Contains(ServerListConstants.Derby_1013)) { item = repo.ServersList.Derby1013; } if (TCName.Contains(ServerListConstants.DB2_LUW_111)) { item = repo.ServersList.DB2111; } if (TCName.Contains(ServerListConstants.DB2_LUW_105)) { item = repo.ServersList.DB2105; } if (TCName.Contains(ServerListConstants.Greenplum_50)) { item = repo.ServersList.Greenplum50; } if (TCName.Contains(ServerListConstants.Greenplum_4312)) { return(repo.ServersList.Greenplum50); } if (TCName.Contains(ServerListConstants.Informix_1170)) { item = repo.ServersList.Informix1170; } if (TCName.Contains(ServerListConstants.Informix_1210)) { item = repo.ServersList.Informix1210; } if (TCName.Contains(ServerListConstants.MariaDB_102)) { item = repo.ServersList.MariaDB; } if (TCName.Contains(ServerListConstants.MongoDB_321)) { item = repo.ServersList.MongoDB321; } if (TCName.Contains(ServerListConstants.MongoDB_341)) { item = repo.ServersList.MongoDB341; } if (TCName.Contains(ServerListConstants.MySQL_80)) { item = repo.ServersList.MySQL80; } if (TCName.Contains(ServerListConstants.MySQL_57)) { item = repo.ServersList.MySQL57; } if (TCName.Contains(ServerListConstants.Netezza_72)) { item = repo.ServersList.Netezza72; } if (TCName.Contains(ServerListConstants.Oracle_121020)) { item = repo.ServersList.Oracle20; } if (TCName.Contains(ServerListConstants.Oracle_11gR2)) { item = repo.ServersList.OracleR2; } if (TCName.Contains(ServerListConstants.PostgreSQL_100)) { item = repo.ServersList.PostgreSQL100; } if (TCName.Contains(ServerListConstants.PostgreSQL_96)) { item = repo.ServersList.PostgreSQL96; } if (TCName.Contains(ServerListConstants.SAP_Hana_20)) { item = repo.ServersList.SAPHana20; } if (TCName.Contains(ServerListConstants.Microsoft_SQL_Azure_RTM_12020008)) { item = repo.ServersList.MicrosoftSQLAzure08; } if (TCName.Contains(ServerListConstants.SQL_Server_2017)) { item = repo.ServersList.SQLServer2017; } if (TCName.Contains(ServerListConstants.SQL_Server_2016)) { item = repo.ServersList.SQLServer2016; } if (TCName.Contains(ServerListConstants.Sybase_Any_16)) { item = repo.ServersList.SybaseAny16; } if (TCName.Contains(ServerListConstants.Sybase_Any_17)) { item = repo.ServersList.SybaseAny17; } if (TCName.Contains(ServerListConstants.Sybase_ASE_16)) { item = repo.ServersList.SybaseASE16; } if (TCName.Contains(ServerListConstants.Sybase_ASE_157)) { item = repo.ServersList.SybaseASE157; } if (TCName.Contains(ServerListConstants.Sybase_IQ_154)) { item = repo.ServersList.SybaseIQ154; } if (TCName.Contains(ServerListConstants.Sybase_IQ_160)) { item = repo.ServersList.SybaseIQ160; } if (TCName.Contains(ServerListConstants.Teradata_150)) { item = repo.ServersList.Teradata150; } if (TCName.Contains(ServerListConstants.Teradata_151)) { item = repo.ServersList.Teradata150; } if (TCName.Contains(ServerListConstants.Teradata_1620)) { item = repo.ServersList.Teradata1620; } if (TCName.Contains(ServerListConstants.Vertica_80)) { item = repo.ServersList.Vertica80; } if (TCName.Contains(ServerListConstants.Vertica_91)) { item = repo.ServersList.Vertica91; } item.EnsureVisible(); item.ClickThis(); } catch (Exception ex) { throw new Exception("Get ServerTree From TCName failed : " + ex.Message); } return(item); }