Anonymous avatar Anonymous committed 3d82efe

CWS-TOOLING: integrate CWS automationdev300m58cat0
2009-09-29 14:46:30 +0200 oc r276530 : #i105448# sleep added to resolv timingproblem
2009-09-28 10:29:46 +0200 oc r276482 : #i105404# t_ToolsMacro needs saved file
2009-09-27 10:51:09 +0200 tbo r276478 : #105393# on MacOS X only 3 items in tools menu
2009-09-25 18:02:25 +0200 oc r276473 : CWS-TOOLING: rebase CWS automationdev300m58cat0 to trunk@276429 (milestone: DEV300:m60)
2009-09-24 11:06:00 +0200 hde r276411 : save test-files locally
2009-09-23 15:40:07 +0200 hde r276400 : deleting of autotext optimized
2009-09-23 15:39:20 +0200 hde r276399 : Dialog 'Bereiche' opened after deleting autotext
2009-09-23 10:42:26 +0200 jsk r276370 : Added warnlog for exceeded timeout, i want the test to warn instead of aborting. Connected issue is #i105289#
2009-09-22 10:41:22 +0200 oc r276347 : #i105254# c_arrayconstants.inc enhanced
2009-09-21 20:37:26 +0200 tbo r276344 : #i105249# workaround firststartwizard regression by calling hDisableQuickstarterAPI()
2009-09-17 10:55:59 +0200 wg r276231 : i105141
2009-09-16 09:20:58 +0200 oc r276191 : #i105109# sleeps increased

Comments (0)

Files changed (15)

testautomation/chart2/required/includes/ch2_menu.inc

     dim iHelpMenuItemCount as integer
         iHelpMenuItemCount = 5  : if ( gPlatform = "osx" ) then iHelpMenuItemCount = 4
     
+    dim iToolsMenuItemCount as integer
+        iToolsMenuItemCount = 4  : if ( gPlatform = "osx" ) then iToolsMenuItemCount = 3
+        'Options entry is called Preferences and resides in application MacOS X menu
+    
     printlog "Close all document windows (File / Close)"
     Do Until GetDocumentCount = 0
         Call hCloseDocument
             warnlog "There should 8 items in the FORMAT/Title menu but there are " + iCount + " items."
         end if
 
-        printlog "check if there are 4 items in the TOOLS menu."        
+        printlog "check if there are " + iToolsMenuItemCount + " items in the TOOLS menu."        
         DocumentCalc.UseMenu 
         hMenuSelectNr(6)        
         iCount = hMenuItemGetCount()
-        if (iCount <> 4) then
-            warnlog "There should 4 items in the tools menu but there are " + iCount + " items."
+        if (iCount <> iToolsMenuItemCount) then
+            warnlog "There should " + iToolsMenuItemCount + " items in the tools menu but there are " + iCount + " items."
         end if
         call hMenuClose()
         

testautomation/framework/optional/includes/filedlg_multiselection.inc

     dim lTime as long
     dim lWait as long
     dim lTimeSum as long
+    dim iCurrentTime as long
     
     
     dim iDocType as integer
     dim brc as boolean
     
     const TESTFILE_COUNT = 60 ' the number of documents in cWorkPath
-    const TESTFILE_TIMEOUT = 120000
+    const TESTFILE_TIMEOUT = 480000
 
     ' Minimum cleanup
     while( getDocumentCount > 0 ) 
             lTime = GetSystemTicks
             iOpenDocuments = 0   
             while ( iOpenDocuments < TESTFILE_COUNT )
-                iOpenDocuments = getDocumentCount
-                if ( (getSystemTicks - lTime) > TESTFILE_TIMEOUT ) then
-                    warnlog( "Loading files max wait time exceed (120 seconds), aborting" )
+                iOpenDocuments = getDocumentCount()
+                iCurrentTime = getSystemTicks - lTime
+                
+                ' exit the hard way
+                if ( iCurrentTime > TESTFILE_TIMEOUT ) then
+                    warnlog( "Loading files max wait time exceed (" & _
+                              TESTFILE_TIMEOUT/1000 & "), aborting" )
                     goto endsub
                 endif
             wend
+            
+            if ( iCurrentTime > 120000 ) then
+                warnlog( "#i105289# Slow loading of files, should be less than 120 seconds on all platforms" )
+            endif
             lWait = getSystemTicks - lTime ' time diff
 
             printlog( "All documents loaded in " & lWait & " ms" )

testautomation/framework/required/includes/wizard_firsttime.inc

         OptionenDlg.cancel()
     endif
     
+    ' due to issue i105248 the Quickstart disabler needs to get called again, because the First Start Wizard resets the veto
+    call hDisableQuickstarterAPI()
+
     do while( getDocumentCount() > 0 )
         call hCloseDocument()
     loop
     '///</ul>
 endcase
 
-

testautomation/graphics/optional/includes/global/g_tables.inc

 ' #1 tiInsertTableUsingMenu
 ' #1 tiInsertTableUsingButton
 ' #1 tiTableObjectBar
-' #1 tiInsertTableUsingToolbarbutton
+' #1 tiInsertTableUsingToolbarbuttonView
 '*
 '\******************************************************************
 
         DocumentDraw.TypeKeys "<SHIFT RIGHT>"
     endif
     Kontext "TableObjectBar"
+    if TableObjectBar.NotExists(2) then ViewToolbarsTable
     ZellenVerbinden.Click
     printlog "Cells merged."
 

testautomation/spreadsheet/optional/includes/arrayconstants/c_arrayconstants.inc

     '///Check that the cellvalue is "Err:533"
     printlog "Check that the cellvalue is ""Err:533"""
     call fCalcCompareCellValue ("A8",sError533)
+    
+    '///In cell A9 enter "={-1;2;3}"
+    printlog "In cell A9 enter ""={-1;2;3}"""
+    call fCalcSelectRange ("A9")
+    kontext "DocumentCalc"
+    DocumentCalc.TypeKeys ("={-1;2;3} <RETURN>")
+    '///Check that the cellvalue is "-1"
+    printlog "Check that the cellvalue is ""-1"""
+    call fCalcCompareCellValue ("A9",-1)
 
     '///Save document 
     printlog "Save document"
     scellcontent = "={1;2;{3;4;5}}"
     call fCalcCompareCellFormular ("A8",scellcontent)
     
+    '///+Check that the editline shows "={-1;2;3}" for cell A9
+    printlog "  Check that the editline shows ""={-1;2;3}"" for cell A9"
+    scellcontent = "={-1;2;3}"
+    call fCalcCompareCellFormular ("A9",scellcontent)
+    
     '///Close Document
     printlog "Close Document"
     call hCloseDocument

testautomation/spreadsheet/optional/includes/so7pp1/c_so7_pp1_ibis.inc

     end if
     '/// Close all disturbing menus
     Kontext "ControlPropertiesDialog" 
+    sleep(1)
     ControlPropertiesDialog.close
     sleep(2)
     Kontext "FormularNavigator"

testautomation/spreadsheet/required/includes/c_upd_toolsmenu2.inc

     printlog " Close ' BeanShell Macros' dialog by 'Close'"
     ScriptOrganizer.Close
     Call hCloseDocument
-	printlog " Open testdocument 'gTesttoolPath + spreadsheet\required\input\DocwithMacro.ods'"
+    printlog " Open testdocument 'gTesttoolPath + spreadsheet\required\input\DocwithMacro.ods'"
     Call hFileOpen (Convertpath (gTesttoolPath + "spreadsheet\required\input\DocwithMacro.ods" ))
-	Kontext
+    Kontext
     if Active.exists then 
         Active.ok
     end if
-    Call sMakeReadOnlyDocumentEditable
-    '/// Use 'Tools – Macro – Signature'
+    Printlog " Save document as 'user/work/DocwithMacro.ods'"
+    Call hFileSaveAsKill convertpath(gOfficePath & "user/work/DocwithMacro.ods")
     printlog " Use 'Tools – Macro – Signature'"
     ToolsMacrosSignature
     Kontext "DigitalSignature"

testautomation/writer/optional/includes/fields/w_fields2.inc

 '-----------------------------------------------------------------
 
 testcase tDocumentFilename
-    if bAsianLan = true then
-        QaErrorLog "No testing with Asian language. Aborting."
-        exit sub
-    end if
-
-  Dim  sTestFile     as String
-  Dim  sFilename(4)  as String
-  Dim  i             as Integer
-
-  sTestFile    = Convertpath (gTesttoolpath + "writer\optional\input\fields\pageTest.sxw")
-
-  sFilename(0) = "pageTest.sxw"
-  sFilename(1) = "pageTest"
-  sFilename(2) = Convertpath (gTesttoolpath + "writer\optional\input\fields\")
-  sFilename(3) = sTestFile
-
-  printlog "Insert/Fields/Other/Document / File name"
- '/// <b> Insert/Fields/Other/Document / File name </b>
-
-  Call hNewDocument
-
-  '/// Open test file pageTest.sxw
-   Call hFileOpen(sTestFile)
-   Call sMakeReadOnlyDocumentEditable
-
-   Call wTypeKeys "<MOD1 Home>"
-   Call wTypeKeys "<End><Return>"
-
-  '/// Insert/Fields/Other/Document / File name
-  '/// Insert File name, File name without extension ,
-  '/// Path , Path/File name
-  '/// Check if the insertion is correct
-   Call fInsertFieldsOther("TabDokumentFeldbefehle")
-     Feldtyp.Select fGetType("File name")
-     for i = 0 to 3
-         Kontext "TabDokumentFeldbefehle"
-         Formatliste.Select i+1
-         Sleep 1
-         Einfuegen.Click
-         sleep 1
-         Call wTypeKeys "<F9>"
-         Sleep 2
-         Call wTypeKeys "<Shift LEFT>"  'HOME
-         Sleep 1
-         if fGetFieldContent() <> sFilename(i) then
-             Warnlog i &" - Should get " & sFilename(i) & " but get " & fGetFieldContent()
-         end if
-         Call wTypeKeys "<Delete>"
-     next i
-     Kontext "TabDokumentFeldbefehle"
-   TabDokumentFeldbefehle.Close
-
- Call hCloseDocument
+	if bAsianLan = true then
+		QaErrorLog "No testing with Asian language. Aborting."
+		goto endsub
+	end if
+	
+	Dim  sOriginalFile as String
+	Dim  sTestFile     as String
+	Dim  sFilename(4)  as String
+	Dim  i             as Integer
+	
+	sTestFile    = Convertpath (gOfficepath + "user\work\pageTest.sxw")
+	sOriginalFile    = Convertpath (gTesttoolpath + "writer\optional\input\fields\pageTest.sxw")
+	' document has to be copied to local file system to avoid opening a read-only file
+	' because all field data gets lost if documents write-protection is removed via 'sMakeReadOnlyDocumentEditable'
+	FileCopy (sOriginalFile, sTestFile)
+	if hFileExists ( sTestFile ) = false then
+		Warnlog "Test document couldn't be copied to local file system. Test aborted!"
+		goto endsub
+	end if
+	
+	sFilename(0) = "pageTest.sxw"
+	sFilename(1) = "pageTest"
+	sFilename(2) = Convertpath (gOfficepath + "user\work\")
+	sFilename(3) = sTestFile
+	
+	printlog "Insert/Fields/Other/Document / File name"
+	
+	Call hNewDocument
+	
+	'/// Open test file pageTest.sxw
+	Call hFileOpen(sTestFile)
+	
+	Call wTypeKeys "<MOD1 Home>"
+	Call wTypeKeys "<End><Return>"
+	
+	printlog "Insert/Fields/Other/Document / File name"
+	printlog "Insert File name, File name without extension , Path , Path/File name"
+	printlog "Check if the insertion is correct"
+	Call fInsertFieldsOther("TabDokumentFeldbefehle")
+	Feldtyp.Select fGetType("File name")
+	for i = 0 to 3
+		Kontext "TabDokumentFeldbefehle"
+		Formatliste.Select i+1
+		Sleep 1
+		Einfuegen.Click
+		sleep 1
+		Call wTypeKeys "<F9>"
+		Sleep 2
+		Call wTypeKeys "<Shift LEFT>"  'HOME
+		Sleep 1
+		if fGetFieldContent() <> sFilename(i) then
+			Warnlog i &" - Should get " & sFilename(i) & " but get " & fGetFieldContent()
+		end if
+		Call wTypeKeys "<Delete>"
+	next i
+	Kontext "TabDokumentFeldbefehle"
+	TabDokumentFeldbefehle.Close
+	
+	Call hCloseDocument
 
 endcase
 

testautomation/writer/optional/includes/fields/w_fields4.inc

 '-----------------------------------------------------------------
 
 testcase tDocInformationUserDefined
-qaerrorlog "#i93906# - Testcase outcommented due to bug. 'Copied field-content not pastable outside Office'"
-goto endsub
+	qaerrorlog "#i93906# - Testcase outcommented due to bug. 'Copied field-content not pastable outside Office'"
+	goto endsub
 
-  Dim sTestFile as String
-  Dim sVarResult() as String
-  Dim sFixResult() as String
-  Dim i as integer
-  Dim j as Integer
-
-  j = UBound(sVarResult)
-  sTestFile  = Convertpath (gTesttoolpath + "writer\optional\input\fields\fields_docinfos.sxw")
-  sVarResult = Array( _
+	Dim sTestFile as String
+	Dim sOriginalFile as string
+	Dim sVarResult() as String
+	Dim sFixResult() as String
+	Dim i as integer
+	Dim j as Integer
+	
+	j = UBound(sVarResult)
+	sTestFile  = Convertpath (gOfficepath + "user\work\fields_docinfos.sxw")
+	sOriginalFile  = Convertpath (gTesttoolpath + "writer\optional\input\fields\fields_docinfos.sxw")
+	' document has to be copied to local file system to avoid opening a read-only file
+	' because all field data gets lost if documents write-protection is removed via 'sMakeReadOnlyDocumentEditable'
+	FileCopy (sOriginalFile, sTestFile)
+	if hFileExists ( sTestFile ) = false then
+		Warnlog "Test document couldn't be copied to local file system. Test aborted!"
+		goto endsub
+	end if
+	
+	sVarResult = Array( _
                       "A1"     , _
                       "B2"     , _
                       "C3"     , _
                       "D4"     , _
                      )
 
-  sFixResult = Array( _
+     sFixResult = Array( _
                       "Lennon"     , _
                       "McCartney"  , _
                       "Harrison"   , _
                       "Star"       , _
                      )
 
-  printlog "Doc Information - User Defined"
- '/// <b> Doc Information - User Defined </b>
-
-  Call hNewDocument
-
-  '/// Open test file fields_docinfos.sxw
-   Call hFileOpen(sTestFile)
-   Call sMakeReadOnlyDocumentEditable
-
-  '/// File / Properties / Description , input some
-  '/// + text in Description
-   Call fFileProperties("TabDokument")
-     Info0.Settext sVarResult(0)
-     Info1.Settext sVarResult(1)
-     Info2.Settext sVarResult(2)
-     Info3.Settext sVarResult(3)
-   TabBenutzer.OK
-
-  '/// Check if the User defined is changed in the document
-  '/// It should be changed in Var
-  '/// It should NOT be changed in Fix
-   Call fFindWord ("Info fields")
-
-   Call wTypeKeys "<End><Right><Down><Home>"
-   Sleep 1
-
-   for i= 0 to UBound(sVarResult)
-       Call wTypeKeys "<Shift Right>"
-       if fGetFieldContent() <> sVarResult(i) then
-           Warnlog "Should get " & sVarResult(i) & " but get " & fGetFieldContent()
-       end if
-
-       Call wTypeKeys "<End><Right>"
-       Sleep 1
-       Call wTypeKeys "<Shift Right>"
-       if fGetFieldContent() <> sFixResult(i) then
-           Warnlog "Should get " & sFixResult(i) & " but get " & fGetFieldContent()
-       end if
-
-       Call wTypeKeys "<End><Down><Home><Left><Home>"
-   next i
-
- Call hCloseDocument
+	printlog "Doc Information - User Defined"
+	
+	
+	Call hNewDocument
+	
+	'/// Open test file fields_docinfos.sxw
+	Call hFileOpen(sTestFile)
+	
+	'/// File / Properties / Description , input some
+	'/// + text in Description
+	Call fFileProperties("TabDokument")
+	Info0.Settext sVarResult(0)
+	Info1.Settext sVarResult(1)
+	Info2.Settext sVarResult(2)
+	Info3.Settext sVarResult(3)
+	TabBenutzer.OK
+	
+	'/// Check if the User defined is changed in the document
+	'/// It should be changed in Var
+	'/// It should NOT be changed in Fix
+	Call fFindWord ("Info fields")
+	
+	Call wTypeKeys "<End><Right><Down><Home>"
+	Sleep 1
+	
+	for i= 0 to UBound(sVarResult)
+	Call wTypeKeys "<Shift Right>"
+	if fGetFieldContent() <> sVarResult(i) then
+	Warnlog "Should get " & sVarResult(i) & " but get " & fGetFieldContent()
+	end if
+	
+	Call wTypeKeys "<End><Right>"
+	Sleep 1
+	Call wTypeKeys "<Shift Right>"
+	if fGetFieldContent() <> sFixResult(i) then
+	Warnlog "Should get " & sFixResult(i) & " but get " & fGetFieldContent()
+	end if
+	
+	Call wTypeKeys "<End><Down><Home><Left><Home>"
+	next i
+	
+	Call hCloseDocument
 
 endcase
 
 
 testcase tDocInformationCreated
 
-  Dim sTestFile     as String
-  Dim sFirstName    as String
-  Dim sLastName     as String
-  Dim sFirstName1   as String
-  Dim sLastName1    as String
-  Dim sVarResult(3) as String
-  Dim sFixResult(3) as String
-  Dim i as Integer
-
-  sFirstName1 = "Test1" : sLastName1 = "Test2"
-  sTestFile   = Convertpath (gTesttoolpath + "writer\optional\input\fields\fields_docinfos.sxw")
-
-  sVarResult(0) =  sFirstName1 + " " + sLastName1
-  sVarResult(1) =  fGetDate1(Date)
-
-  sFixResult(0) =  "Éric Savary"
-  sFixResult(1) =  "07/20/2000"
-  sFixResult(2) =  "11:41:21"
-
-  printlog "Doc Information - Created"
- '/// <b> Doc Information - Created </b>
-
-  Call hNewDocument
-
-  '/// Open test file fields_docinfos.sxw
-   Call hFileOpen(sTestFile)
-   Call sMakeReadOnlyDocumentEditable
-
-   Call fFindWord ("Created")
-   Call wTypeKeys "<End><Right><Down><Down><Down><Home>"
-   Sleep 1
-   Call wTypeKeys "<Shift Right>"
-   sVarResult(2)= fGetFieldContent()
-   Call wTypeKeys "<MOD1 Home>" , 3
-
-  '/// Change author to author :Test2 Test1
-   ToolsOptions
-   Call hToolsOptions("STAROFFICE","USERDATA")
-     sFirstName = VorName.GetText
-     sLastName  = ZuName.GetText
-     VorName.SetText sFirstName1
-     ZuName.SetText  sLastName1
-     Kontext "ExtrasOptionenDlg"
-   ExtrasOptionenDlg.OK
-
-  '/// File / Properties / General , check "Apply user
-  '/// + data" , click "delete" button
-   Call fFileProperties("TabDokument")
-     BenutzerdatenVerwenden.Check
-     Sleep 1
-     Loeschen.Click
-     Sleep 1
-   TabDokument.OK
-
-  '/// Check if the Created field is changed in the document
-  '/// It should be changed in Var
-  '/// It should NOT be changed in Fix
-   Call fFindWord ("Created")
-
-   Call wTypeKeys "<End><Right><Down><Home>"
-   Sleep 1
-
-   for i = 0 to 1
-       Call wTypeKeys "<Shift Right>"
-       if fGetFieldContent() <> sVarResult(i) then
-           Warnlog "Should get " & sVarResult(i) & " but get " & fGetFieldContent()
-       end if
-
-       Call wTypeKeys "<End><Right>"
-       Sleep 1
-       Call wTypeKeys "<Shift Right>"
-       if fGetFieldContent() <> sFixResult(i) then
-           Warnlog "Should get " & sFixResult(i) & " but get " & fGetFieldContent()
-       end if
-       Call wTypeKeys "<End><Down><Home><Left><Home>"
-   next i
-
-   Call wTypeKeys "<Shift Right>"
-   if fGetFieldContent() = sVarResult(2) then
-       Warnlog "Should get " & sFixResult(2) & " but get " & fGetFieldContent()
-   end if
-
-   Call wTypeKeys "<End><Right>"
-   Call wTypeKeys "<Shift Right>"
-   if fGetFieldContent() <> sFixResult(2) then
-       Warnlog "Should get " & sFixResult(2) & " but get " & fGetFieldContent()
-   end if
-
-  'Recover author to default
-   ToolsOptions
-   Call hToolsOptions("STAROFFICE","USERDATA")
-     VorName.SetText sFirstName
-     ZuName.SetText  sLastName
-     Kontext "ExtrasOptionenDlg"
-   ExtrasOptionenDlg.OK
-
- Call hCloseDocument
+	Dim sTestFile     as String
+	Dim sOriginalFile as String	
+	Dim sFirstName    as String
+	Dim sLastName     as String
+	Dim sFirstName1   as String
+	Dim sLastName1    as String
+	Dim sVarResult(3) as String
+	Dim sFixResult(3) as String
+	Dim i as Integer
+	
+	sFirstName1 = "Test1" : sLastName1 = "Test2"
+	sTestFile   = Convertpath (gOfficePath + "user\work\fields_docinfos.sxw")
+	sOriginalFile   = Convertpath (gTesttoolpath + "writer\optional\input\fields\fields_docinfos.sxw")
+	' document has to be copied to local file system to avoid opening a read-only file
+	' because all field data gets lost if documents write-protection is removed via 'sMakeReadOnlyDocumentEditable'
+	FileCopy (sOriginalFile, sTestFile)
+	if hFileExists ( sTestFile ) = false then
+		Warnlog "Test document couldn't be copied to local file system. Test aborted!"
+		goto endsub
+	end if
+	
+	sVarResult(0) =  sFirstName1 + " " + sLastName1
+	sVarResult(1) =  fGetDate1(Date)
+	
+	sFixResult(0) =  "Éric Savary"
+	sFixResult(1) =  "07/20/2000"
+	sFixResult(2) =  "11:41:21"
+	
+	printlog "Doc Information - Created"
+	'/// <b> Doc Information - Created </b>
+	
+	Call hNewDocument
+	
+	'/// Open test file fields_docinfos.sxw
+	Call hFileOpen(sTestFile)
+	Call sMakeReadOnlyDocumentEditable
+	
+	Call fFindWord ("Created")
+	Call wTypeKeys "<End><Right><Down><Down><Down><Home>"
+	Sleep 1
+	Call wTypeKeys "<Shift Right>"
+	sVarResult(2)= fGetFieldContent()
+	Call wTypeKeys "<MOD1 Home>" , 3
+	
+	'/// Change author to author :Test2 Test1
+	ToolsOptions
+	Call hToolsOptions("STAROFFICE","USERDATA")
+	sFirstName = VorName.GetText
+	sLastName  = ZuName.GetText
+	VorName.SetText sFirstName1
+	ZuName.SetText  sLastName1
+	Kontext "ExtrasOptionenDlg"
+	ExtrasOptionenDlg.OK
+	
+	'/// File / Properties / General , check "Apply user
+	'/// + data" , click "delete" button
+	Call fFileProperties("TabDokument")
+	BenutzerdatenVerwenden.Check
+	Sleep 1
+	Loeschen.Click
+	Sleep 1
+	TabDokument.OK
+	
+	'/// Check if the Created field is changed in the document
+	'/// It should be changed in Var
+	'/// It should NOT be changed in Fix
+	Call fFindWord ("Created")
+	
+	Call wTypeKeys "<End><Right><Down><Home>"
+	Sleep 1
+	
+	for i = 0 to 1
+		Call wTypeKeys "<Shift Right>"
+		if fGetFieldContent() <> sVarResult(i) then
+			Warnlog "Should get " & sVarResult(i) & " but get " & fGetFieldContent()
+		end if
+	
+		Call wTypeKeys "<End><Right>"
+		Sleep 1
+		Call wTypeKeys "<Shift Right>"
+		if fGetFieldContent() <> sFixResult(i) then
+			Warnlog "Should get " & sFixResult(i) & " but get " & fGetFieldContent()
+		end if
+		Call wTypeKeys "<End><Down><Home><Left><Home>"
+	next i
+	
+	Call wTypeKeys "<Shift Right>"
+	if fGetFieldContent() = sVarResult(2) then
+		Warnlog "Should get " & sFixResult(2) & " but get " & fGetFieldContent()
+	end if
+	
+	Call wTypeKeys "<End><Right>"
+	Call wTypeKeys "<Shift Right>"
+	if fGetFieldContent() <> sFixResult(2) then
+		Warnlog "Should get " & sFixResult(2) & " but get " & fGetFieldContent()
+	end if
+	
+	'Recover author to default
+	ToolsOptions
+	Call hToolsOptions("STAROFFICE","USERDATA")
+	VorName.SetText sFirstName
+	ZuName.SetText  sLastName
+	Kontext "ExtrasOptionenDlg"
+	ExtrasOptionenDlg.OK
+	
+	Call hCloseDocument
 
 endcase
 
 
 testcase tDocInformationModified
 
-  Dim sTestFile     as String
-  Dim sSaveasFile   as String
-  Dim sFirstName    as String
-  Dim sLastName     as String
-  Dim sFirstName1   as String
-  Dim sLastName1    as String
-  Dim sVarResult(3) as String
-  Dim sFixResult(3) as String
-  Dim i             as Integer
-
-  sFirstName1 = "Test1" : sLastName1 = "Test2"
-  sTestFile   = Convertpath (gTesttoolpath + "writer\optional\input\fields\fields_docinfos.sxw")
-  sSaveasFile = ConvertPath (gOfficePath + "user\work\fields_docinfos.sxw" )
-
-  sVarResult(0) =  sFirstName1 + " " + sLastName1
-  sVarResult(1) =  fGetDate1(Date)
-
-  sFixResult(0) =  "Éric Savary"
-  sFixResult(1) =  "08/18/2000"
-  sFixResult(2) =  "11:40:11"
-
-  printlog "Doc Information - Modified"
- '/// <b> Doc Information - Modified </b>
-
-  if hFileExists ( sSaveAsFile ) then app.kill ( sSaveAsFile )
-
-  Call hNewDocument
-
-  '/// Open test file fields_docinfos.sxw
-   Call hFileOpen(sTestFile)
-   Call sMakeReadOnlyDocumentEditable
-   Call hFileSaveAsKill (sSaveAsFile)
-
-   Call fFindWord ("Modified")
-   Call wTypeKeys "<End><Right><Down><Down><Down><Home>"
-   Sleep 1
-   Call wTypeKeys "<Shift Right>"
-   sVarResult(2)= fGetFieldContent()
-   Call wTypeKeys "<MOD1 Home>" , 3
-
-  '/// Change author to author : Test2 Test1
-   ToolsOptions
-   Call hToolsOptions("STAROFFICE","USERDATA")
-     sFirstName = VorName.GetText
-     sLastName  = ZuName.GetText
-     VorName.SetText sFirstName1
-     ZuName.SetText  sLastName1
-     Kontext "ExtrasOptionenDlg"
-   ExtrasOptionenDlg.OK
-
-  '/// File / Properties / General , check "Apply user
-  '/// + data" , click "delete" button
-   Call fFileProperties("TabDokument")
-     BenutzerdatenVerwenden.Check
-     Sleep 1
-     Loeschen.Click
-     Sleep 1
-   TabDokument.OK
-
-   FileSave
-   try
-       Kontext "Active"
-       Active.Yes
-   catch
-   endcatch
-   Sleep 3
-
-  '/// Check if the Modified field is changed in the document
-  '/// It should be changed in Var
-  '/// It should NOT be changed in Fix
-   Call fFindWord ("Modified")
-
-   Call wTypeKeys "<End><Right><Down><Home>"
-   Sleep 1
-
-   for i = 0 to 1
-       Call wTypeKeys "<Shift Right>"
-       if fGetFieldContent() <> sVarResult(i) then
-           Warnlog "Should get " & sVarResult(i) & " but get " & fGetFieldContent()
-       end if
-
-       Call wTypeKeys "<End><Right>"
-       Sleep 1
-       Call wTypeKeys "<Shift Right>"
-       if fGetFieldContent() <> sFixResult(i) then
-           Warnlog "Should get " & sFixResult(i) & " but get " & fGetFieldContent()
-       end if
-       Call wTypeKeys "<End><Down><Home><Left><Home>"
-   next i
-
-   Call wTypeKeys "<Shift Right>"
-   if fGetFieldContent() = sVarResult(2) then
-       Warnlog "Should get " & sFixResult(2) & " but get " & fGetFieldContent()
-   end if
-
-   Call wTypeKeys "<End><Right>"
-   Call wTypeKeys "<Shift Right>"
-   if fGetFieldContent() <> sFixResult(2) then
-       Warnlog "Should get " & sFixResult(2) & " but get " & fGetFieldContent()
-   end if
-
-  'Recover author to default
-   ToolsOptions
-   Call hToolsOptions("STAROFFICE","USERDATA")
-     VorName.SetText sFirstName
-     ZuName.SetText  sLastName
-     Kontext "ExtrasOptionenDlg"
-   ExtrasOptionenDlg.OK
-
-   FileClose
-   Sleep 1
-   Kontext "Active"
-   if Active.Exists(2) then
-      try
-         Active.Yes
-      catch
-      endcatch
-   end if
-
-   if hFileExists ( sSaveAsFile ) then app.kill ( sSaveAsFile )
+	Dim sTestFile     as String
+	Dim sOriginalFile as String
+	Dim sSaveasFile   as String
+	Dim sFirstName    as String
+	Dim sLastName     as String
+	Dim sFirstName1   as String
+	Dim sLastName1    as String
+	Dim sVarResult(3) as String
+	Dim sFixResult(3) as String
+	Dim i             as Integer
+	
+	sFirstName1 = "Test1" : sLastName1 = "Test2"
+	sTestFile   = Convertpath (gOfficePath + "user\work\fields_docinfos.sxw")
+	sOriginalFile   = Convertpath (gTesttoolpath + "writer\optional\input\fields\fields_docinfos.sxw")
+	' document has to be copied to local file system to avoid opening a read-only file
+	' because all field data gets lost if documents write-protection is removed via 'sMakeReadOnlyDocumentEditable'
+	FileCopy (sOriginalFile, sTestFile)
+	if hFileExists ( sTestFile ) = false then
+		Warnlog "Test document couldn't be copied to local file system. Test aborted!"
+		goto endsub
+	end if
+	sSaveasFile = ConvertPath (gOfficePath + "user\work\fields_docinfos1.sxw" )
+	
+	sVarResult(0) =  sFirstName1 + " " + sLastName1
+	sVarResult(1) =  fGetDate1(Date)
+	
+	sFixResult(0) =  "Éric Savary"
+	sFixResult(1) =  "08/18/2000"
+	sFixResult(2) =  "11:40:11"
+	
+	printlog "Doc Information - Modified"
+	'/// <b> Doc Information - Modified </b>
+	
+	if hFileExists ( sSaveAsFile ) then app.kill ( sSaveAsFile )
+	
+	Call hNewDocument
+	
+	'/// Open test file fields_docinfos.sxw
+	Call hFileOpen(sTestFile)
+	Call hFileSaveAsKill (sSaveAsFile)
+	
+	Call fFindWord ("Modified")
+	Call wTypeKeys "<End><Right><Down><Down><Down><Home>"
+	Sleep 1
+	Call wTypeKeys "<Shift Right>"
+	sVarResult(2)= fGetFieldContent()
+	Call wTypeKeys "<MOD1 Home>" , 3
+	
+	'/// Change author to author : Test2 Test1
+	ToolsOptions
+	Call hToolsOptions("STAROFFICE","USERDATA")
+	sFirstName = VorName.GetText
+	sLastName  = ZuName.GetText
+	VorName.SetText sFirstName1
+	ZuName.SetText  sLastName1
+	Kontext "ExtrasOptionenDlg"
+	ExtrasOptionenDlg.OK
+	
+	'/// File / Properties / General , check "Apply user
+	'/// + data" , click "delete" button
+	Call fFileProperties("TabDokument")
+	BenutzerdatenVerwenden.Check
+	Sleep 1
+	Loeschen.Click
+	Sleep 1
+	TabDokument.OK
+	
+	FileSave
+	try
+		Kontext "Active"
+		Active.Yes
+	catch
+	endcatch
+	Sleep 3
+	
+	'/// Check if the Modified field is changed in the document
+	'/// It should be changed in Var
+	'/// It should NOT be changed in Fix
+	Call fFindWord ("Modified")
+	
+	Call wTypeKeys "<End><Right><Down><Home>"
+	Sleep 1
+	
+	for i = 0 to 1
+		Call wTypeKeys "<Shift Right>"
+		if fGetFieldContent() <> sVarResult(i) then
+			Warnlog "Should get " & sVarResult(i) & " but get " & fGetFieldContent()
+		end if
+	
+		Call wTypeKeys "<End><Right>"
+		Sleep 1
+		Call wTypeKeys "<Shift Right>"
+		if fGetFieldContent() <> sFixResult(i) then
+			Warnlog "Should get " & sFixResult(i) & " but get " & fGetFieldContent()
+		end if
+		Call wTypeKeys "<End><Down><Home><Left><Home>"
+	next i
+	
+	Call wTypeKeys "<Shift Right>"
+	if fGetFieldContent() = sVarResult(2) then
+		Warnlog "Should get " & sFixResult(2) & " but get " & fGetFieldContent()
+	end if
+	
+	Call wTypeKeys "<End><Right>"
+	Call wTypeKeys "<Shift Right>"
+	if fGetFieldContent() <> sFixResult(2) then
+		Warnlog "Should get " & sFixResult(2) & " but get " & fGetFieldContent()
+	end if
+	
+	'Recover author to default
+	ToolsOptions
+	Call hToolsOptions("STAROFFICE","USERDATA")
+	VorName.SetText sFirstName
+	ZuName.SetText  sLastName
+	Kontext "ExtrasOptionenDlg"
+	ExtrasOptionenDlg.OK
+	
+	FileClose
+	Sleep 1
+	Kontext "Active"
+	if Active.Exists(2) then
+		try
+			Active.Yes
+		catch
+		endcatch
+	end if
+	
+	if hFileExists ( sSaveAsFile ) then app.kill ( sSaveAsFile )
 
 endcase
 
 '-----------------------------------------------------------------
 
 testcase tDocInformationModifiedSavefile
-    QaErrorLog "#i102792# - tDocInformationModifiedSavefile outcommented due to issue."
-    goto endsub
-
-  Dim sTestFile     as String
-  Dim sSaveasFile   as String
-  Dim sFirstName    as String
-  Dim sLastName     as String
-  Dim sFirstName1   as String
-  Dim sLastName1    as String
-  Dim sVarResult(3) as String
-  Dim sFixResult(3) as String
-  Dim i             as Integer
-
-  sFirstName1 = "Test1" : sLastName1 = "Test2"
-  sTestFile   = Convertpath (gTesttoolpath + "writer\optional\input\fields\fields_docinfos.sxw")
-  sSaveasFile = ConvertPath (gOfficePath + "user\work\fields_docinfos.sxw" )
-
-  sVarResult(0) =  sFirstName1 + " " + sLastName1
-  sVarResult(1) =  fGetDate1(Date)
-
-  sFixResult(0) =  "Éric Savary"
-  sFixResult(1) =  "08/18/2000"
-  sFixResult(2) =  "11:40:11"
-
-  if hFileExists ( sSaveAsFile ) then app.kill ( sSaveAsFile )
-
-  printlog "Doc Information - Modified (save file)"
- '/// <b> Doc Information - Modified (save file)</b>
-
-  Call hNewDocument
-
-  '/// Open test file fields_docinfos.sxw
-   Call hFileOpen(sTestFile)
-   Call sMakeReadOnlyDocumentEditable
-
-   Call fFindWord ("Modified")
-   Call wTypeKeys "<End><Right><Down><Down><Down><Home>"
-   Sleep 1
-   Call wTypeKeys "<Shift Right>"
-   sVarResult(2)= fGetFieldContent()
-   Call wTypeKeys "<MOD1 Home>" , 3
-
-  '/// Change author to author : Test2 Test1
-   ToolsOptions
-   Call hToolsOptions("STAROFFICE","USERDATA")
-     sFirstName = VorName.GetText
-     sLastName  = ZuName.GetText
-     VorName.SetText sFirstName1
-     ZuName.SetText  sLastName1
-     Kontext "ExtrasOptionenDlg"
-   ExtrasOptionenDlg.OK
-
-  '/// Save the file as another file
-   Call hFileSaveAsKill(sSaveAsFile)
-
-  '/// Check if the Modified field is changed in the document
-  '/// It should be changed in Var
-  '/// It should NOT be changed in Fix
-   Call fFindWord ("Modified")
-
-   Call wTypeKeys "<End><Right><Down><Home>"
-   Sleep 1
-
-   for i = 0 to 1
-       Call wTypeKeys "<Shift Right>"
-       if fGetFieldContent() <> sVarResult(i) then
-           QAErrorlog "#i41327# Should get " & sVarResult(i) & " but get " & fGetFieldContent()
-       end if
-
-       Call wTypeKeys "<End><Right>"
-       Sleep 1
-       Call wTypeKeys "<Shift Right>"
-       if fGetFieldContent() <> sFixResult(i) then
-           Warnlog "Should get " & sFixResult(i) & " but get " & fGetFieldContent()
-       end if
-       Call wTypeKeys "<End><Down><Home><Left><Home>"
-   next i
-
-   Call wTypeKeys "<Shift Right>"
-   if fGetFieldContent() = sVarResult(2) then
-       QAErrorlog "#i41327# Should get " & sFixResult(2) & " but get " & fGetFieldContent()
-   end if
-
-   Call wTypeKeys "<End><Right>"
-   Call wTypeKeys "<Shift Right>"
-   if fGetFieldContent() <> sFixResult(2) then
-       Warnlog "Should get " & sFixResult(2) & " but get " & fGetFieldContent()
-   end if
-
-  'Recover author to default
-   ToolsOptions
-   Call hToolsOptions("STAROFFICE","USERDATA")
-     VorName.SetText sFirstName
-     ZuName.SetText  sLastName
-     Kontext "ExtrasOptionenDlg"
-   ExtrasOptionenDlg.OK
-
-   FileClose
-   Sleep 1
-   Kontext "Active"
-   if Active.Exists(2) then
-      try
-         Active.Yes
-      catch
-      endcatch
-   end if
-
-   if hFileExists ( sSaveAsFile ) then app.kill ( sSaveAsFile )
+	QaErrorLog "#i102792# - tDocInformationModifiedSavefile outcommented due to issue."
+	goto endsub
+	
+	Dim sTestFile     as String
+	Dim sOriginalFile as string
+	Dim sSaveasFile   as String
+	Dim sFirstName    as String
+	Dim sLastName     as String
+	Dim sFirstName1   as String
+	Dim sLastName1    as String
+	Dim sVarResult(3) as String
+	Dim sFixResult(3) as String
+	Dim i             as Integer
+	
+	sFirstName1 = "Test1" : sLastName1 = "Test2"
+	sTestFile   = Convertpath (gOfficePath + "user\work\fields_docinfos.sxw")
+	sOriginalFile   = Convertpath (gTesttoolpath + "writer\optional\input\fields\fields_docinfos.sxw")
+	' document has to be copied to local file system to avoid opening a read-only file
+	' because all field data gets lost if documents write-protection is removed via 'sMakeReadOnlyDocumentEditable'
+	FileCopy (sOriginalFile, sTestFile)
+	if hFileExists ( sTestFile ) = false then
+		Warnlog "Test document couldn't be copied to local file system. Test aborted!"
+		goto endsub
+	end if
+	sSaveasFile = ConvertPath (gOfficePath + "user\work\fields_docinfos1.sxw" )
+	
+	sVarResult(0) =  sFirstName1 + " " + sLastName1
+	sVarResult(1) =  fGetDate1(Date)
+	
+	sFixResult(0) =  "Éric Savary"
+	sFixResult(1) =  "08/18/2000"
+	sFixResult(2) =  "11:40:11"
+	
+	if hFileExists ( sSaveAsFile ) then app.kill ( sSaveAsFile )
+	
+	printlog "Doc Information - Modified (save file)"
+	'/// <b> Doc Information - Modified (save file)</b>
+	
+	Call hNewDocument
+	
+	'/// Open test file fields_docinfos.sxw
+	Call hFileOpen(sTestFile)
+	
+	Call fFindWord ("Modified")
+	Call wTypeKeys "<End><Right><Down><Down><Down><Home>"
+	Sleep 1
+	Call wTypeKeys "<Shift Right>"
+	sVarResult(2)= fGetFieldContent()
+	Call wTypeKeys "<MOD1 Home>" , 3
+	
+	'/// Change author to author : Test2 Test1
+	ToolsOptions
+	Call hToolsOptions("STAROFFICE","USERDATA")
+	sFirstName = VorName.GetText
+	sLastName  = ZuName.GetText
+	VorName.SetText sFirstName1
+	ZuName.SetText  sLastName1
+	Kontext "ExtrasOptionenDlg"
+	ExtrasOptionenDlg.OK
+	
+	'/// Save the file as another file
+	Call hFileSaveAsKill(sSaveAsFile)
+	
+	'/// Check if the Modified field is changed in the document
+	'/// It should be changed in Var
+	'/// It should NOT be changed in Fix
+	Call fFindWord ("Modified")
+	
+	Call wTypeKeys "<End><Right><Down><Home>"
+	Sleep 1
+	
+	for i = 0 to 1
+	Call wTypeKeys "<Shift Right>"
+	if fGetFieldContent() <> sVarResult(i) then
+	QAErrorlog "#i41327# Should get " & sVarResult(i) & " but get " & fGetFieldContent()
+	end if
+	
+	Call wTypeKeys "<End><Right>"
+	Sleep 1
+	Call wTypeKeys "<Shift Right>"
+	if fGetFieldContent() <> sFixResult(i) then
+	Warnlog "Should get " & sFixResult(i) & " but get " & fGetFieldContent()
+	end if
+	Call wTypeKeys "<End><Down><Home><Left><Home>"
+	next i
+	
+	Call wTypeKeys "<Shift Right>"
+	if fGetFieldContent() = sVarResult(2) then
+	QAErrorlog "#i41327# Should get " & sFixResult(2) & " but get " & fGetFieldContent()
+	end if
+	
+	Call wTypeKeys "<End><Right>"
+	Call wTypeKeys "<Shift Right>"
+	if fGetFieldContent() <> sFixResult(2) then
+	Warnlog "Should get " & sFixResult(2) & " but get " & fGetFieldContent()
+	end if
+	
+	'Recover author to default
+	ToolsOptions
+	Call hToolsOptions("STAROFFICE","USERDATA")
+	VorName.SetText sFirstName
+	ZuName.SetText  sLastName
+	Kontext "ExtrasOptionenDlg"
+	ExtrasOptionenDlg.OK
+	
+	FileClose
+	Sleep 1
+	Kontext "Active"
+	if Active.Exists(2) then
+	try
+	Active.Yes
+	catch
+	endcatch
+	end if
+	
+	if hFileExists ( sSaveAsFile ) then app.kill ( sSaveAsFile )
 
 endcase
 
 
 testcase tDocInformationPrinted
 
-  Dim sTestFile     as String
-  Dim sFirstName    as String
-  Dim sLastName     as String
-  Dim sFirstName1   as String
-  Dim sLastName1    as String
-  Dim sVarResult(3) as String
-  Dim sFixResult(3) as String
-  Dim i             as Integer
+	Dim sTestFile     as String
+	Dim sOriginalFile as String
+	Dim sFirstName    as String
+	Dim sLastName     as String
+	Dim sFirstName1   as String
+	Dim sLastName1    as String
+	Dim sVarResult(3) as String
+	Dim sFixResult(3) as String
+	Dim i             as Integer
+	
+	sFirstName1 = "Test1" : sLastName1 = "Test2"
+	sTestFile   = Convertpath (gOfficePath + "user\work\fields_docinfos.sxw")
+	sOriginalFile   = Convertpath (gTesttoolpath + "writer\optional\input\fields\fields_docinfos.sxw")
+	' document has to be copied to local file system to avoid opening a read-only file
+	' because all field data gets lost if documents write-protection is removed via 'sMakeReadOnlyDocumentEditable'
+	FileCopy (sOriginalFile, sTestFile)
+	if hFileExists ( sTestFile ) = false then
+		Warnlog "Test document couldn't be copied to local file system. Test aborted!"
+		goto endsub
+	end if
 
-  sFirstName1 = "Test1" : sLastName1 = "Test2"
-  sTestFile   = Convertpath (gTesttoolpath + "writer\optional\input\fields\fields_docinfos.sxw")
 
-  sVarResult(0) =  sFirstName1 + " " + sLastName1
-  sVarResult(1) =  fGetDate1(Date)
-
-  sFixResult(0) =  "Éric Savary"
-  sFixResult(1) =  "08/11/2004"
-  sFixResult(2) =  "11:46:06"
-
-  printlog "Doc Information - Printed"
- '/// <b> Doc Information - Printed </b>
-
-  Call hNewDocument
-
-  '/// Open test file fields_docinfos.sxw
-   Call hFileOpen(sTestFile)
-   Call sMakeReadOnlyDocumentEditable
-
-   Call fFindWord ("Last printed")
-   Call wTypeKeys "<End><Right><Down><Down><Down><Home>"
-   Call wTypeKeys "<Shift Right>"
-   Sleep 1
-   sVarResult(2)= fGetFieldContent()
-   Call wTypeKeys "<MOD1 Home>" , 3
-
-  '/// Change author to author : Test2 Test1
-   ToolsOptions
-   Call hToolsOptions("STAROFFICE","USERDATA")
-     sFirstName = VorName.GetText
-     sLastName  = ZuName.GetText
-     VorName.SetText sFirstName1
-     ZuName.SetText  sLastName1
-     Kontext "ExtrasOptionenDlg"
-   ExtrasOptionenDlg.OK
-
-  '/// Print file
-   FilePrint
-   Kontext "Active"
-   if Active.Exists then
-       if Active.GetRT = 304 then
-           Active.Ok
-           QAErrorLog "No Default-Printer! The testcase isn't tested !"
-           Kontext "DruckenDlg"
-           Sleep 1
-           DruckenDlg.Cancel
-           goto NoTest
-       end if
-   else
-       Kontext "DruckenDlg"
-       Sleep 1
-       DruckenDlg.OK
-        kontext "active"
-        if active.exists(5) then
-            QaErrorLog "Error Printing..."
-            Active.ok
-        end if
-   end if
-
-  '/// Check if the Printed field is changed in the document
-  '/// It should be changed in Var
-  '/// It should NOT be changed in Fix
-   Call fFindWord ("Last printed")
-
-   Call wTypeKeys "<End><Right><Down><Home>"
-   Sleep 1
-
-   for i = 0 to 1
-       Call wTypeKeys "<Shift Right>"
-       if fGetFieldContent() <> sVarResult(i) then
-           Warnlog "Should get " & sVarResult(i) & " but get " & fGetFieldContent()
-       end if
-
-       Call wTypeKeys "<End><Right>"
-       Sleep 1
-       Call wTypeKeys "<Shift Right>"
-       if fGetFieldContent() <> sFixResult(i) then
-           Warnlog "Should get " & sFixResult(i) & " but get " & fGetFieldContent()
-       end if
-       Call wTypeKeys "<End><Down><Home><Left><Home>"
-   next i
-
-   Call wTypeKeys "<Shift Right>"
-   if fGetFieldContent() = sVarResult(2) then
-       Warnlog "Should NOT get " & sFixResult(2)
-   end if
-
-   Call wTypeKeys "<End><Right>"
-   Call wTypeKeys "<Shift Right>"
-   if fGetFieldContent() <> sFixResult(2) then
-       Warnlog "Should get " & sFixResult(2) & " but get " & fGetFieldContent()
-   end if
-
-  'Recover author to default
-   ToolsOptions
-   Call hToolsOptions("STAROFFICE","USERDATA")
-     VorName.SetText sFirstName
-     ZuName.SetText  sLastName
-     Kontext "ExtrasOptionenDlg"
-   ExtrasOptionenDlg.OK
-NoTest:
- Call hCloseDocument
+	sVarResult(0) =  sFirstName1 + " " + sLastName1
+	sVarResult(1) =  fGetDate1(Date)
+	
+	sFixResult(0) =  "Éric Savary"
+	sFixResult(1) =  "08/11/2004"
+	sFixResult(2) =  "11:46:06"
+	
+	printlog "Doc Information - Printed"
+	'/// <b> Doc Information - Printed </b>
+	
+	Call hNewDocument
+	
+	'/// Open test file fields_docinfos.sxw
+	Call hFileOpen(sTestFile)
+	
+	Call fFindWord ("Last printed")
+	Call wTypeKeys "<End><Right><Down><Down><Down><Home>"
+	Call wTypeKeys "<Shift Right>"
+	Sleep 1
+	sVarResult(2)= fGetFieldContent()
+	Call wTypeKeys "<MOD1 Home>" , 3
+	
+	'/// Change author to author : Test2 Test1
+	ToolsOptions
+	Call hToolsOptions("STAROFFICE","USERDATA")
+	sFirstName = VorName.GetText
+	sLastName  = ZuName.GetText
+	VorName.SetText sFirstName1
+	ZuName.SetText  sLastName1
+	Kontext "ExtrasOptionenDlg"
+	ExtrasOptionenDlg.OK
+	
+	'/// Print file
+	FilePrint
+	Kontext "Active"
+	if Active.Exists then
+	   	if Active.GetRT = 304 then
+			Active.Ok
+			QAErrorLog "No Default-Printer! The testcase isn't tested !"
+			Kontext "DruckenDlg"
+			Sleep 1
+			DruckenDlg.Cancel
+			goto NoTest
+	   end if
+	else
+	   Kontext "DruckenDlg"
+	   Sleep 1
+	   DruckenDlg.OK
+		kontext "active"
+		if active.exists(5) then
+			QaErrorLog "Error Printing..."
+			Active.ok
+		end if
+	end if
+	
+	'/// Check if the Printed field is changed in the document
+	'/// It should be changed in Var
+	'/// It should NOT be changed in Fix
+	Call fFindWord ("Last printed")
+	
+	Call wTypeKeys "<End><Right><Down><Home>"
+	Sleep 1
+	
+	for i = 0 to 1
+	   Call wTypeKeys "<Shift Right>"
+	   if fGetFieldContent() <> sVarResult(i) then
+		   Warnlog "Should get " & sVarResult(i) & " but get " & fGetFieldContent()
+	   end if
+	
+	   Call wTypeKeys "<End><Right>"
+	   Sleep 1
+	   Call wTypeKeys "<Shift Right>"
+	   if fGetFieldContent() <> sFixResult(i) then
+		   Warnlog "Should get " & sFixResult(i) & " but get " & fGetFieldContent()
+	   end if
+	   Call wTypeKeys "<End><Down><Home><Left><Home>"
+	next i
+	
+	Call wTypeKeys "<Shift Right>"
+	if fGetFieldContent() = sVarResult(2) then
+	   Warnlog "Should NOT get " & sFixResult(2)
+	end if
+	
+	Call wTypeKeys "<End><Right>"
+	Call wTypeKeys "<Shift Right>"
+	if fGetFieldContent() <> sFixResult(2) then
+	   Warnlog "Should get " & sFixResult(2) & " but get " & fGetFieldContent()
+	end if
+	
+	'Recover author to default
+	ToolsOptions
+	Call hToolsOptions("STAROFFICE","USERDATA")
+	 VorName.SetText sFirstName
+	 ZuName.SetText  sLastName
+	 Kontext "ExtrasOptionenDlg"
+	ExtrasOptionenDlg.OK
+	NoTest:
+	Call hCloseDocument
 
 endcase
 
 
 testcase tDocInformationRevisionnumber
 
-  Dim sTestFile   as String
-  Dim sSaveasFile as String
-  Dim sFirstName  as String
-  Dim sLastName   as String
-  Dim sFirstName1 as String
-  Dim sLastName1  as String
-  Dim sVarResult  as String
-  Dim sFixResult  as String
+	Dim sTestFile   as String
+	Dim sOriginalFile as string
+	Dim sSaveasFile as String
+	Dim sFirstName  as String
+	Dim sLastName   as String
+	Dim sFirstName1 as String
+	Dim sLastName1  as String
+	Dim sVarResult  as String
+	Dim sFixResult  as String
+	
+	sFirstName1 = "Test1" : sLastName1 = "Test2"
+	sVarResult  = "17"    : sFixResult = "4"
 
-  sFirstName1 = "Test1" : sLastName1 = "Test2"
-  sVarResult  = "17"    : sFixResult = "4"
-  sTestFile   = Convertpath (gTesttoolpath + "writer\optional\input\fields\fields_docinfos.sxw")
-  sSaveasFile = ConvertPath (gOfficePath + "user\work\tDocInformationRevisionnumber.sxw" )
-
-  if hFileExists ( sSaveAsFile ) then app.kill ( sSaveAsFile )
-
-  printlog "Doc Information - Revision number"
- '/// <b> Doc Information - Revision number</b>
-
-  Call hNewDocument
-
-  '/// Open test file fields_docinfos.sxw
-   Call hFileOpen(sTestFile)
-   Call sMakeReadOnlyDocumentEditable
-
-  '/// Change author to author : Test2 Test1
-   ToolsOptions
-   Call hToolsOptions("STAROFFICE","USERDATA")
-     sFirstName = VorName.GetText
-     sLastName  = ZuName.GetText
-     VorName.SetText sFirstName1
-     ZuName.SetText  sLastName1
-     Kontext "ExtrasOptionenDlg"
-   ExtrasOptionenDlg.OK
-
-  '/// Save the file as another file
-   Call hFileSaveAsKill(sSaveAsFile)
-
-  '/// Press F9
-   Call wTypeKeys "<F9>"
-
-  '/// Save the file
-   FileSave
-   try
-       Kontext "Active"
-       Active.Yes
-   catch
-   endcatch
-   Sleep 3
-
-  '/// Check if the Revision number field is changed in the document
-  '/// It should be changed in Var
-  '/// It should NOT be changed in Fix
-   Call fFindWord ("Version")
-
-   Call wTypeKeys "<End><Right>"
-   Sleep 1
-
-   Call wTypeKeys "<Shift Right>"
-   if fGetFieldContent() <> sVarResult then
-       Warnlog "Should get " & sVarResult & " but get " & fGetFieldContent()
-   end if
-
-   Call wTypeKeys "<End><Right>"
-   Sleep 1
-   Call wTypeKeys "<Shift Right>"
-   if fGetFieldContent() <> sFixResult then
-       Warnlog "Should get " & sFixResult & " but get " & fGetFieldContent()
-   end if
-
-  'Recover author to default
-   ToolsOptions
-   Call hToolsOptions("STAROFFICE","USERDATA")
-     VorName.SetText sFirstName
-     ZuName.SetText  sLastName
-     Kontext "ExtrasOptionenDlg"
-   ExtrasOptionenDlg.OK
-
-   FileClose
-   Sleep 1
-   Kontext "Active"
-   if Active.Exists(2) then
-      try
-         Active.Yes
-      catch
-      endcatch
-   end if
-
-   if hFileExists ( sSaveAsFile ) then app.kill ( sSaveAsFile )
+  	sTestFile   = Convertpath (gOfficePath + "user\work\fields_docinfos.sxw")
+	sOriginalFile   = Convertpath (gTesttoolpath + "writer\optional\input\fields\fields_docinfos.sxw")
+	' document has to be copied to local file system to avoid opening a read-only file
+	' because all field data gets lost if documents write-protection is removed via 'sMakeReadOnlyDocumentEditable'
+	FileCopy (sOriginalFile, sTestFile)
+	if hFileExists ( sTestFile ) = false then
+		Warnlog "Test document couldn't be copied to local file system. Test aborted!"
+		goto endsub
+	end if
+	sSaveasFile = ConvertPath (gOfficePath + "user\work\tDocInformationRevisionnumber.sxw" )
+	
+	if hFileExists ( sSaveAsFile ) then app.kill ( sSaveAsFile )
+	
+	printlog "Doc Information - Revision number"
+	'/// <b> Doc Information - Revision number</b>
+	
+	Call hNewDocument
+	
+	'/// Open test file fields_docinfos.sxw
+	Call hFileOpen(sTestFile)
+	
+	'/// Change author to author : Test2 Test1
+	ToolsOptions
+	Call hToolsOptions("STAROFFICE","USERDATA")
+	sFirstName = VorName.GetText
+	sLastName  = ZuName.GetText
+	VorName.SetText sFirstName1
+	ZuName.SetText  sLastName1
+	Kontext "ExtrasOptionenDlg"
+	ExtrasOptionenDlg.OK
+	
+	'/// Save the file as another file
+	Call hFileSaveAsKill(sSaveAsFile)
+	
+	'/// Press F9
+	Call wTypeKeys "<F9>"
+	
+	'/// Save the file
+	FileSave
+	try
+		Kontext "Active"
+		Active.Yes
+	catch
+	endcatch
+	Sleep 3
+	
+	'/// Check if the Revision number field is changed in the document
+	'/// It should be changed in Var
+	'/// It should NOT be changed in Fix
+	Call fFindWord ("Version")
+	
+	Call wTypeKeys "<End><Right>"
+	Sleep 1
+	
+	Call wTypeKeys "<Shift Right>"
+	if fGetFieldContent() <> sVarResult then
+		Warnlog "Should get " & sVarResult & " but get " & fGetFieldContent()
+	end if
+	
+	Call wTypeKeys "<End><Right>"
+	Sleep 1
+	Call wTypeKeys "<Shift Right>"
+	if fGetFieldContent() <> sFixResult then
+		Warnlog "Should get " & sFixResult & " but get " & fGetFieldContent()
+	end if
+	
+	'Recover author to default
+	ToolsOptions
+	Call hToolsOptions("STAROFFICE","USERDATA")
+	VorName.SetText sFirstName
+	ZuName.SetText  sLastName
+	Kontext "ExtrasOptionenDlg"
+	ExtrasOptionenDlg.OK
+	
+	FileClose
+	Sleep 1
+	Kontext "Active"
+	if Active.Exists(2) then
+		try
+			Active.Yes
+		catch
+		endcatch
+	end if
+	
+	if hFileExists ( sSaveAsFile ) then app.kill ( sSaveAsFile )
 
 endcase
 
 
 testcase tDocInformationTotaleditingtime
 
-  Dim sTestFile   as String
-  Dim sSaveasFile as String
-  Dim sVarResult  as String
-  Dim sFixResult  as String
+	Dim sTestFile   as String
+	Dim sOriginalFile	as string
+	Dim sSaveasFile as String
+	Dim sVarResult  as String
+	Dim sFixResult  as String
+	
+	sFixResult  = "00:29:05"
+  	sTestFile   = Convertpath (gOfficePath + "user\work\fields_docinfos.sxw")
+	sOriginalFile   = Convertpath (gTesttoolpath + "writer\optional\input\fields\fields_docinfos.sxw")
+	' document has to be copied to local file system to avoid opening a read-only file
+	' because all field data gets lost if documents write-protection is removed via 'sMakeReadOnlyDocumentEditable'
+	FileCopy (sOriginalFile, sTestFile)
+	if hFileExists ( sTestFile ) = false then
+		Warnlog "Test document couldn't be copied to local file system. Test aborted!"
+		goto endsub
+	end if
+	sSaveasFile = ConvertPath (gOfficePath + "user\work\tDocInformationRevisionnumber.sxw" )
 
-  sFixResult  = "00:29:05"
-  sTestFile   = Convertpath (gTesttoolpath + "writer\optional\input\fields\fields_docinfos.sxw")
-  sSaveasFile = ConvertPath (gOfficePath + "user\work\tDocInformationRevisionnumber.sxw" )
-
-  if hFileExists ( sSaveAsFile ) then app.kill ( sSaveAsFile )
-
-  printlog "Doc Information - Tatal editing time"
- '/// <b> Doc Information - Tatal editing time </b>
-
-  Call hNewDocument
-
-  '/// Open test file fields_docinfos.sxw
-   Call hFileOpen(sTestFile)
-   Call sMakeReadOnlyDocumentEditable
-
-  '/// Save the file as another file
-   Call hFileSaveAsKill(sSaveAsFile)
-
-  '/// Press F9
-   Call wTypeKeys "<F9>"
-
-   Call fFindWord ("Accessed")
-   Call wTypeKeys "<End><Right>"
-   Sleep 1
-   Call wTypeKeys "<Shift Right>"
-   sVarResult = fGetFieldContent()
-   Call wTypeKeys "<MOD1 Home>" , 3
-
-  '/// Save the file
-   FileSave
-   try
-       Kontext "Active"
-       Active.Yes
-   catch
-   endcatch
-   Sleep 3
-
-  '/// Check if the tatal editing time field is changed in the document
-  '/// It should be changed in Var
-  '/// It should NOT be changed in Fix
-   Call fFindWord ("Accessed")
-
-   Call wTypeKeys "<End><Right>"
-   Sleep 1
-
-   Call wTypeKeys "<Shift Right>"
-   if fGetFieldContent() = sVarResult then
-       Warnlog "Should NOT get " & sVarResult
-   end if
-
-   Call wTypeKeys "<End><Right>"
-   Sleep 1
-   Call wTypeKeys "<Shift Right>"
-   if fGetFieldContent() <> sFixResult then
-       Warnlog "Should get " & sFixResult & " but get " & fGetFieldContent()
-   end if
-
-   FileClose
-   Sleep 1
-   Kontext "Active"
-   if Active.Exists(2) then
-      try
-         Active.Yes
-      catch
-      endcatch
-   end if
-
-   if hFileExists ( sSaveAsFile ) then app.kill ( sSaveAsFile )
+	if hFileExists ( sSaveAsFile ) then app.kill ( sSaveAsFile )
+	
+	printlog "Doc Information - Tatal editing time"
+	'/// <b> Doc Information - Tatal editing time </b>
+	
+	Call hNewDocument
+	
+	'/// Open test file fields_docinfos.sxw
+	Call hFileOpen(sTestFile)
+	
+	'/// Save the file as another file
+	Call hFileSaveAsKill(sSaveAsFile)
+	
+	'/// Press F9
+	Call wTypeKeys "<F9>"
+	
+	Call fFindWord ("Accessed")
+	Call wTypeKeys "<End><Right>"
+	Sleep 1
+	Call wTypeKeys "<Shift Right>"
+	sVarResult = fGetFieldContent()
+	Call wTypeKeys "<MOD1 Home>" , 3
+	
+	'/// Save the file
+	FileSave
+	try
+	   Kontext "Active"
+	   Active.Yes
+	catch
+	endcatch
+	Sleep 3
+	
+	'/// Check if the tatal editing time field is changed in the document
+	'/// It should be changed in Var
+	'/// It should NOT be changed in Fix
+	Call fFindWord ("Accessed")
+	
+	Call wTypeKeys "<End><Right>"
+	Sleep 1
+	
+	Call wTypeKeys "<Shift Right>"
+	if fGetFieldContent() = sVarResult then
+	   Warnlog "Should NOT get " & sVarResult
+	end if
+	
+	Call wTypeKeys "<End><Right>"
+	Sleep 1
+	Call wTypeKeys "<Shift Right>"
+	if fGetFieldContent() <> sFixResult then
+	   Warnlog "Should get " & sFixResult & " but get " & fGetFieldContent()
+	end if
+	
+	FileClose
+	Sleep 1
+	Kontext "Active"
+	if Active.Exists(2) then
+	  try
+		 Active.Yes
+	  catch
+	  endcatch
+	end if
+	
+	if hFileExists ( sSaveAsFile ) then app.kill ( sSaveAsFile )
 
 endcase
 

testautomation/writer/optional/includes/fields/w_fields6.inc

 '-----------------------------------------------------------------
 
 testcase tFunctionsCombineCharacter
-Warnlog "#i102752# - tFunctionsCombineCharacter outcommented due to bug."
-goto endsub
 
 	Dim sCombineCharacter as String
     Dim sTestFile as String

testautomation/writer/optional/includes/fields/w_fields7.inc

     end if
     
     Dim sTestFile    as String
+    Dim sOriginalFile as string
     Dim sDate()      as String
     Dim iCountry()   as Integer
     Dim i , j        as Integer
     
     if iSprache <> 01 then
         QAErrorlog "This is a English-only testcase"
+        goto endsub
     end if
     
     Call hNewDocument
     ExtrasOptionenDlg.Cancel
     Call hCloseDocument
   
-    sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\fields\Date.sxw")
+  	sTestFile   = Convertpath (gOfficepath + "user\work\Date.sxw")
+	sOriginalFile   = Convertpath (gTesttoolpath + "writer\optional\input\fields\Date.sxw")
+	' document has to be copied to local file system to avoid opening a read-only file
+	' because all field data gets lost if documents write-protection is removed via 'sMakeReadOnlyDocumentEditable'
+	FileCopy (sOriginalFile, sTestFile)
+	if hFileExists ( sTestFile ) = false then
+		Warnlog "Test document couldn't be copied to local file system. Test aborted!"
+		goto endsub
+	end if
+    
     
     sDate  = Array( _
            "Tuesday, August 3, 2004"    , _
     
     '/// Open test file Date.sxw
     Call hFileOpen(sTestFile)
-    Call sMakeReadOnlyDocumentEditable
     
     '/// Check if Date is changed after language is changed
     j = UBound(iCountry)
 testcase tL10NtestTime
     if iSprache <> 1 then
         QaErrorLog "Currently no any other language than English. Aborting."
-        exit sub
+        goto endsub
     end if
 
     Dim sTestFile as String
+    Dim sOriginalFile as string
     Dim sTime() as String
     Dim iCountry() as Integer
     Dim i as Integer
     
     if iSprache <> 01 then
         QAErrorlog "This is a English-only testcase"
+        goto endsub
     end if
     
     Call hNewDocument
     ExtrasOptionenDlg.Cancel
     Call hCloseDocument
   
-    sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\fields\Time.sxw")
+  	sTestFile   = Convertpath (gOfficepath + "user\work\Time.sxw")
+	sOriginalFile   = Convertpath (gTesttoolpath + "writer\optional\input\fields\Time.sxw")
+	' document has to be copied to local file system to avoid opening a read-only file
+	' because all field data gets lost if documents write-protection is removed via 'sMakeReadOnlyDocumentEditable'
+	FileCopy (sOriginalFile, sTestFile)
+	if hFileExists ( sTestFile ) = false then
+		Warnlog "Test document couldn't be copied to local file system. Test aborted!"
+		goto endsub
+	end if
+    
     
     sTime  = Array( _
                "04:46:08 PM"     , _
     
     '/// Open test file Time.sxw
     Call hFileOpen(sTestFile)
-    Call sMakeReadOnlyDocumentEditable
     
     '/// Check if time is changed after language is changed
     j = UBound(iCountry)

testautomation/writer/optional/includes/option/wh_o_1.inc

     Kontext "ExtrasOptionenDlg"
     ExtrasOptionenDlg.Cancel
 	
-	sleep (2)
+	sleep (4)
     
     '-------------------------------------------------------------------------------
     printlog ("'/// Function Test: Grid Resolution ///'")

testautomation/writer/optional/includes/option/wh_o_2.inc

 
     Kontext "ExtrasOptionenDlg"
     ExtrasOptionenDlg.OK
-	sleep (2)
+	sleep (4)
     Call hFileSaveAsKill(gOfficepath + "user\work\printtest.html")
     Call hCloseDocument
 

testautomation/writer/required/includes/w_002_.inc

 '---------------------------------------------------
 
 testcase tEditAutotext
-    Dim j as integer
     Dim k as integer
     Dim i as integer
     Dim CurrentEntryNr as integer
     DialogTest ( AutoText )
 
     Kontext "AutoText"
-
-    PrintLog "Click Categories"
-    Bereiche.Click
-    Sleep 1
-
     Printlog "If it exists: Delete DummyAutotext."
     if wDeleteAutotext("DummyAutotext") = true then
         qaerrorlog "DummyAutotext from previous testrun found, now deleted."
     end if
 
+    PrintLog "Click Categories"
+    Bereiche.Click
+    Sleep 1    
     Kontext "BereicheBearbeitenAutoText"
     if BereicheBearbeitenAutoText.Exists then
         DialogTest ( BereicheBearbeitenAutoText )

testautomation/writer/tools/includes/w_tool2.inc

     '/// returns true if Autotext could be deleted
     '/// Attention: Autotext-Dialog leaves open after deleting autotext
 
-    Dim j as integer, sAll as integer
+    Dim j as integer
+    Dim ik as integer
+    Dim bDeleted as boolean
+    Dim sAllGroups as integer
+    Dim sAllInGroups as integer
+    
     Kontext "Autotext"
     if Not Autotext.Exists then EditAutotext
 
         wait 500
     next j
 
-    Liste.Select 1
-    Liste.TypeKeys "+"
-    sAll = Liste.GetItemCount
-    For j = 1 to sAll
-        Liste.TypeKeys "<Down>"
-        if Liste.Gettext = vAutotextName then
-            try
-                Menue.Click
-                wait 500
-                Cal