diff options
Diffstat (limited to 'testautomation/spreadsheet/optional/includes/import_general/c_import_general.inc')
-rwxr-xr-x[-rw-r--r--] | testautomation/spreadsheet/optional/includes/import_general/c_import_general.inc | 62 |
1 files changed, 39 insertions, 23 deletions
diff --git a/testautomation/spreadsheet/optional/includes/import_general/c_import_general.inc b/testautomation/spreadsheet/optional/includes/import_general/c_import_general.inc index c8cc9ddb308f..d53c23fbbe3d 100644..100755 --- a/testautomation/spreadsheet/optional/includes/import_general/c_import_general.inc +++ b/testautomation/spreadsheet/optional/includes/import_general/c_import_general.inc @@ -25,7 +25,7 @@ ' '/************************************************************************ '** -'** owner : oliver.craemer@sun.com +'** owner : oliver.craemer@oracle.com '** '** short description : Imports every Document from a given path (gsSourcePath variable) '** @@ -41,6 +41,8 @@ sub tLoadAllDocuments ( gsSourcePath as string ) Dim i as integer Dim x as integer + dim gsSourceDocument( 50 ) as string + printlog "Source path: " & gsSourcePath 'Get the files into a list. Call GetAllFileList(gsSourcePath, "*.*" , gsSourceDocument()) @@ -55,7 +57,33 @@ end sub ' '------------------------------------------------------------------------------- ' +function IsItLoaded as boolean + '/// IsItLoaded + '/// Wait until document is loaded + Dim iLoop as integer + + IsItLoaded = FALSE + sleep(3) + for iLoop =1 to 20 + try + 'Calling slot 'IsDocLoading' + IsItLoaded = IsDocLoading + catch + IsItLoaded = FALSE + endcatch + + if IsItLoaded = TRUE then + exit for + end if + sleep(1) + next iLoop + sleep(2) +end function +' +'------------------------------------------------------------------------------- +' testcase tLoadSpreadsheetDocument (SourceFile) + Dim sOnlyFileName as string Dim sOnlyFileExtension as string Dim sTempFileName as String @@ -63,13 +91,13 @@ testcase tLoadSpreadsheetDocument (SourceFile) sTempFileName = SourceFile sOnlyFileName = DateiOhneExt(DateiExtract(SourceFile) - sOnlyFileExtension = GetExtention(sTempFileName) - select case sOnlyFileName - case "so3tmpl", "so4tmpl", "so5tmpl" : - printlog "Test case: " & sOnlyFileName & "." & sOnlyFileExtension - - case else printlog "Test case: " & sOnlyFileName & "." & sOnlyFileExtension + sOnlyFileExtension = GetExtention(sTempFileName) + + select case ( sOnlyFileName ) + case "so3tmpl", "so4tmpl", "so5tmpl" : printlog "Test case: " & sOnlyFileName & "." & sOnlyFileExtension + case else : printlog "Test case: " & sOnlyFileName & "." & sOnlyFileExtension end select + 'Maybe file name is empty if sOnlyFileName > "" then 'Some extensions make no sense to load @@ -81,27 +109,15 @@ testcase tLoadSpreadsheetDocument (SourceFile) Call hCloseDocument else warnlog sOnlyFileName + " document has not been loaded correctly [hIsNamedDocLoaded]!" - if GetDocumentCount > 1 then - Do Until GetDocumentCount = 1 - Call hCloseDocument - Loop - endif + hFileCloseAll() endif else warnlog sOnlyFileName + " document has not been loaded correctly [fCalcFileOpen; IsItLoaded]!" - if GetDocumentCount > 1 then - Do Until GetDocumentCount = 1 - Call hCloseDocument - Loop - endif + hFileCloseAll() endif else printlog "(" + sOnlyFileName + "." + sOnlyFileExtension + ") won't be loaded because of excluded extensions .so and .tmp." - if GetDocumentCount > 1 then - Do Until GetDocumentCount = 1 - Call hCloseDocument - Loop - endif + hFileCloseAll() endif endif endcase @@ -115,7 +131,7 @@ function fCalcFileOpen (sDocName as string, optional bLinked as boolean) as bool sSourceFile = ConvertPath ( sDocName ) fCalcFileOpen = TRUE - if hFileExists (sSourceFile) = FALSE then + if FileExists (sSourceFile) = FALSE then warnlog "fCalcFileOpen: '" + sSourceFile + "' does not exists!" fCalcFileOpen = FALSE else |