From 47ece945a698bcb64f88cdc9c832df6b7957c49b Mon Sep 17 00:00:00 2001 From: "Joerg Skottke [jsk]" Date: Fri, 30 Apr 2010 15:36:44 +0200 Subject: vitomation01: #i111282 - extended f_window_functions.bas to cover BASIC IDE, StartCenter and Database as well. Needed to get rid of fSplitWindowTitle (too complex and not flexible enough to do the job) and needed to build in some safeguard against hGetWindowCaption() which causes array out of bounds errors and modifies its function parameters. Removed QAErrorlog as the issue with the incorrect windowtitle of the StartCenter is never going to be fixed, printlog will do. --- testautomation/global/tools/includes/optional/t_ole.inc | 2 +- .../global/tools/includes/required/t_menu.inc | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) (limited to 'testautomation/global/tools') diff --git a/testautomation/global/tools/includes/optional/t_ole.inc b/testautomation/global/tools/includes/optional/t_ole.inc index f31798c37bbc..0ea179822cd2 100755 --- a/testautomation/global/tools/includes/optional/t_ole.inc +++ b/testautomation/global/tools/includes/optional/t_ole.inc @@ -73,7 +73,7 @@ function hGetOleObjectName( cApplication as string ) as string ' The application names for the API are case sensitive so we cannot use gApplication select case ( cApplication ) - case "WRITER" : Application_API_Name = "Writer + case "WRITER" : Application_API_Name = "Writer" case "CALC" : Application_API_Name = "Calc" case "IMPRESS": Application_API_Name = "Impress" case "DRAW" : Application_API_Name = "Draw" diff --git a/testautomation/global/tools/includes/required/t_menu.inc b/testautomation/global/tools/includes/required/t_menu.inc index f78e2239e943..a7c64b37865d 100755 --- a/testautomation/global/tools/includes/required/t_menu.inc +++ b/testautomation/global/tools/includes/required/t_menu.inc @@ -687,19 +687,22 @@ end function '******************************************************************************* -function hGetWindowCaption(sApplication as string, optional bAll as boolean) +function hGetWindowCaption( sApplication as string, optional bAll as boolean ) '/// function hGetWindowCaption () ///' '///+ just returns the string from the application main window ///' '///+ If optional parameter = true, thenn go throught all applications and get caption; return array ///' + ' BEWARE: THIS FUNCTION MODIFIES ITS FUNCTION PARAMETER UNDER CERTAIN + ' CONDITIONS! + dim sTemp as string dim aApplication() as string dim aTemp(10) as string dim iTimes as integer dim i as integer - aApplication = array("SWRITER","SGLOBAL","SWEB","SCALC","SDRAW","SIMPRESS","SMATH","BASIC","BACK") + aApplication = array("SWRITER","SGLOBAL","SWEB","SCALC","SDRAW","SIMPRESS","SMATH","BASIC","DATABASE","SOFFICE") if (isMissing(bAll) OR (NOT bAll)) then iTimes = 0 else @@ -756,7 +759,13 @@ function hGetWindowCaption(sApplication as string, optional bAll as boolean) sTemp = BasicIDE.caption catch endcatch - Case "BACK" + Case "DATABASE" + Kontext "DATABASE" + try + sTemp = DataBase.caption + catch + endcatch + Case "SOFFICE" Kontext "DocumentBackground" try sTemp = DocumentBackground.caption @@ -782,7 +791,7 @@ end function '******************************************************************************* -function fSplitWindowTitle(sInString as string) +function fSplitWindowTitle( sInString as string ) dim a, b, x, i, iProductname as integer dim sTemp() as string -- cgit