public static void SelectSchemaScriptGenerator_TC7() { try { TreeItem server = Preconditions.Steps.GetServerTreeFromTCName(Config.TestCaseName); Preconditions.Steps.CloseTab(server.Text); Preconditions.Steps.SelectedServerTreeItem = server; Preconditions.Steps.SelectedServerName = server.Text; server.RightClickThis(); Preconditions.Steps.ConnectServer(); TreeItem dbItem = server.GetItem("Security"); TreeItem adsdbItem = dbItem.GetItem("Roles", false); adsdbItem.RightClick(); repo.DataStudio.ToolsMenuInfo.WaitForItemExists(1000); repo.DataStudio.ToolsMenu.ClickThis(); repo.SunAwtWindow.ServerScriptGenMenuInfo.WaitForItemExists(30000); repo.SunAwtWindow.ServerScriptGenMenu.ClickThis(); Reports.ReportLog("SelectSchemaScriptGenerator_TC7", Reports.ADSReportLevel.Success, null, Config.TestCaseName); } catch (Exception ex) { throw new Exception("Failed : SelectSchemaScriptGenerator_TC7 : " + ex.Message); } }
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 SelectADSDB(string serverName) { try { TreeItem SelectedServer = null; SelectServer(ref SelectedServer, serverName); TreeItem adsDB = SelectedServer.GetItem(Configuration.Config.ADSDB.ToUpper(), false); adsDB.Select(); } catch (Exception e) { throw new Exception("Failed : SelectADSDB : " + e.Message); } }
public static void SelectAquafold() { try { TreeItem SelectedServerDb1 = null; SelectServer(ref SelectedServerDb1); TreeItem aquafold = SelectedServerDb1.GetItem(Configuration.Config.AQUAFOLD); ExplicitWait(); aquafold.Select(); Reports.ReportLog("SelectAquafold ", Reports.ADSReportLevel.Success, null, Config.TestCaseName); } catch (Exception ex) { throw new Exception("Failed : SelectADSDb1 : " + ex.Message); } }
public static void EditTableData(TreeItem dbTreeItem, string db, string schema, string table) { try { TreeItem item = dbTreeItem.GetItem(db); TreeItem item1 = item.GetItem(schema); TreeItem item2 = item1.GetItem("Tables"); TreeItem item3 = item2.GetItem(table); item3.RightClickThis(); repo.Datastudio.EditTableInfo.WaitForItemExists(2000); repo.Datastudio.EditTable.ClickThis(); Reports.ReportLog("EditTableData", Reports.ADSReportLevel.Success, null, Config.TestCaseName); } catch (Exception e) { throw new Exception("Failed : EditTableData : " + e.Message); } }
public static void SelectADSDB() { try { TreeItem SelectedServer = null; SelectServer(ref SelectedServer); TreeItem adsDB = SelectedServer.GetItem(Configuration.Config.ADSDB.ToUpper()); adsDB.Select(); Reports.ReportLog("SelectADSDB", Reports.ADSReportLevel.Success, null, Configuration.Config.TestCaseName); } catch (Exception ex) { if (repo.ChooseServer.SelfInfo.Exists(1000)) { repo.ChooseServer.Self.Close(); } throw new Exception("Failed : SelectADSDB : " + ex.Message); } }
public static void SelectADSDb1() { try { TreeItem SelectedServerDb1 = null; SelectServer(ref SelectedServerDb1); TreeItem adsDB1 = SelectedServerDb1.GetItem(Configuration.Config.ADSDB1); ExplicitWait(); adsDB1.Select(); Reports.ReportLog("SelectADSDb1 ", Reports.ADSReportLevel.Success, null, Config.TestCaseName); } catch (Exception ex) { if (repo.SchemaCompare.SelfInfo.Exists(1000)) { repo.SchemaCompare.Self.Close(); } throw new Exception("Failed : SelectADSDb1 : " + ex.Message); } }
public static void SelectServer() { try { repo.ChooseFromServers.SelfInfo.WaitForItemExists(10000); string serverName = Preconditions.Steps.GetServerFromTCName(Config.TestCaseName); TreeItem ServerItem = repo.ChooseFromServers.LocalServers.GetItem(serverName); if (ServerItem != null) { TreeItem adsdbItem = ServerItem.GetItem(Config.ADSDB, false); adsdbItem.ClickThis(); repo.ChooseFromServers.OkButton.ClickThis(); Reports.ReportLog("SelectServer", Reports.ADSReportLevel.Success, null, Config.TestCaseName); } } catch (Exception ex) { throw new Exception("Failed : SelectServer : " + ex.Message); } }
public static void SelectDatabase(TreeItem dbTreeItem, string db, string schema, string table) { try { TreeItem item = dbTreeItem.GetItem(db); TreeItem item1 = item.GetItem(schema); TreeItem item2 = item1.GetItem("Tables"); TreeItem item3 = item2.GetItem(table); item3.RightClickThis(); Preconditions.Steps.QueryAnalyser(); System.Threading.Thread.Sleep(2000); Preconditions.Steps.WriteSelectTable(); System.Threading.Thread.Sleep(2000); Keyboard.Press(Keyboard.ToKey("Ctrl+Alt+Enter"), Keyboard.DefaultScanCode, Keyboard.DefaultKeyPressTime, 1, true); Reports.ReportLog("SelectDatabase", Reports.ADSReportLevel.Success, null, Config.TestCaseName); } catch (Exception e) { throw new Exception("Failed : SelectDatabase : " + e.Message); } }
public static void SelectSchemaScriptGenerator_TC6() { try { TreeItem dbItem = Preconditions.Steps.SelectedServerTreeItem.GetItem(databasesTree[0]); TreeItem adsdbItem = dbItem.GetItem(Config.ADSDB, false); adsdbItem.RightClick(); repo.DataStudio.ToolsMenuInfo.WaitForItemExists(10000); repo.DataStudio.ToolsMenu.ClickThis(); repo.SunAwtWindow.ServerScriptGenMenuInfo.WaitForItemExists(30000); repo.SunAwtWindow.ServerScriptGenMenu.ClickThis(); Reports.ReportLog("SelectSchemaScriptGenerator_TC6", Reports.ADSReportLevel.Success, null, Config.TestCaseName); } catch (Exception ex) { throw new Exception("Failed : SelectSchemaScriptGenerator_TC6 : " + ex.Message); } }
public static void SelectSchemaScriptGenerator_View() { try { TreeItem dbItem = Preconditions.Steps.SelectedServerTreeItem.GetItem(databasesTree[0]); TreeItem adsdbItem = dbItem.GetItem(Config.ADSDB); TreeItem publicItem = adsdbItem.GetItem(schemaTree[0]); TreeItem viewItem = publicItem.GetItem(viewTree[0]); TreeItem adsviewItem = viewItem.GetItem("public.ads_view"); adsviewItem.RightClick(); repo.DataStudio.ToolsMenuInfo.WaitForItemExists(1000); repo.DataStudio.ToolsMenu.ClickThis(); repo.DataStudio.SchemaScriptGenMenuInfo.WaitForItemExists(30000); repo.DataStudio.SchemaScriptGenMenu.ClickThis(); Reports.ReportLog("SelectSchemaScriptGenerator_View", Reports.ADSReportLevel.Success, null, Config.TestCaseName); } catch (Exception ex) { throw new Exception("Failed : SelectSchemaScriptGenerator_View : " + ex.Message); } }