1 'encoding UTF-8 Do not remove or change this line!
2 '**************************************************************************
3 '* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 '* Copyright 2008 by Sun Microsystems, Inc.
7 '* OpenOffice.org - a multi-platform office productivity suite
9 '* $RCSfile: master.inc,v $
13 '* last change: $Author: vg $ $Date: 2008-08-19 12:49:51 $
15 '* This file is part of OpenOffice.org.
17 '* OpenOffice.org is free software: you can redistribute it and/or modify
18 '* it under the terms of the GNU Lesser General Public License version 3
19 '* only, as published by the Free Software Foundation.
21 '* OpenOffice.org is distributed in the hope that it will be useful,
22 '* but WITHOUT ANY WARRANTY; without even the implied warranty of
23 '* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 '* GNU Lesser General Public License version 3 for more details
25 '* (a copy is included in the LICENSE file that accompanied this code).
27 '* You should have received a copy of the GNU Lesser General Public License
28 '* version 3 along with OpenOffice.org. If not, see
29 '* <http://www.openoffice.org/license.html>
30 '* for a copy of the LGPLv3 License.
32 '/************************************************************************
34 '* owner : helge.delfs@sun.com
36 '* short description : very important routines to start a testscript
38 '************************************************************************
41 ' #1 GetUseFiles ' First routine which will be called automatically by starting a testscript
42 ' #1 LoadDeclaration ' Includes the whole declaration (.sid- and .win-files)
43 ' #1 LoadGlobalIncludeFiles ' Includes global .inc-files
46 ' #1 TestEnter ' Internal subroutine called at testcase-start -> start recovering
47 ' #1 TestExit ' Internal subroutine called at testcase-end
48 ' If an error in a testscript occurs the test jumps directly into this routine
49 ' #1 PleaseRecover ' Recover routine used by TestExit- and TestEnter
51 ' Office Startroutines:
52 ' #1 hStartTheOffice ' Routine to start the Office
53 ' #1 ExitRestartTheOffice ' Exit and restart the office - after 30 seconds
54 ' #1 FirstOfficeStart ' First office start with ResetApplication function
55 ' #1 sStartUpOffice ' sub routine which is being called from hStartTheOffice and ExitRestartTheOffice
56 ' #1 hExitTheOffice ' sub routine to just exit the office
58 ' Special Information:
59 ' #1 hFirstOutPut ' Creates a general information header in result files for all tests
60 ' #1 mMakeGeneralOptionsAPI ' Sets general options in the office via API, without UI
61 ' #1 hIsResultWriteable ' Is TT able to write the resultfile in the directory?
62 ' #0 hDetectStatusDatabase ' Detecting the status database server
63 ' #1 hDisableQuickstarter ' Disable the Quickstart feature on win32 systems
65 '\***********************************************************************
68 '///<i>GetUseFiles</i>: The first routine which will be called automatically by starting a testscript.
69 '/// Include all important libraries (.inc) for the startup.
70 Dim bQuickstarterStatus as boolean
72 Dim sPrivateEnvironmentLocation as string
73 Dim sEnvironmentVersion as string
74 Dim sEnvironmentDisplayVersion as string
75 Dim sEnvironmentVersionMinor as string
77 gTestcaseStart = Now() ' get start time of test preparation phase
79 use "global\system\includes\sysinfo.inc" '///+ sysinfo.inc : routines to get all system informations
80 use "global\system\includes\inivalue.inc" '///+ inivalue.inc : routines to work with ini-files
81 use "global\system\includes\iniinfo.inc" '///+ iniinfo.inc : routines to get all informations about OpenOffice.org
82 use "global\system\includes\status.inc" '///+ status.inc : all routines to put the status-info into database
84 '/// Call important system- and start-routines.
85 Call LoadGlobalIncludeFiles '///+<li><b>LoadGlobalIncludeFiles</b>: Include file with global routines (master.inc)</li>
86 Call GetToolPlatform '///+<li><b>GetToolPlatform</b>: Detect operating environment for the Testtool (sysinfo.inc)</li>
87 Call GetOfficePlatform '///+<li><b>GetOfficePlatform</b>: Detect operating environment for the office (sysinfo.inc)</li>
88 Call GetIniInformation '///+<li><b>GetIniInformation</b>: Get all information out of the <i>testtool.ini/.testtoolrc</i> and set it on global variables (iniinfo.inc)</li>
89 Call GetOfficeInformation '///+<li><b>GetOfficeInformation</b>: Set <i>sAppExe</i> for startup (iniinfo.inc)</li>
92 Call LoadDeclaration '///+<ul><li><b>LoadDeclaration</b>: Load all declaration files (master.inc)</li>
94 Call FirstOfficeStart '///+<li><b>FirstOfficeStart</b>: Try to start the office for first time (master.inc)</li>
95 Call GetLanguageInformation '///+<li><b>GetLanguageInformation</b>: Detect the language of office (iniinfo.inc)</li>
96 Call hFirstOutput '///+<li><b>hFirstOutput</b>: Make last adjustments and creat information output (master.inc)</li>
98 '/// make some default setting
99 Call mMakeGeneralOptionsAPI '///+<li><b>mMakeGeneralOptionsAPI</b></li>: Set general options <ol><li><u>system-file-dialogs off</u> on Win32</li><li>work-dir to internal ../user/work-dir</li></ol>(master.inc)</li>
100 '///+<li>Disabling the Quickstarter.
101 'This can't be done via API right now.
102 bQuickstarterStatus = hDisableQuickstarter
103 printlog "** Quickstarter disabled : " & bQuickstarterStatus
104 printlog "----------------------------------------------------------------------------------------------------"
107 if (NOT gSamePC) then
108 gTestToolPath = gRemotePath
111 '/// Load private environment dependant settings
112 '/// BaseDirectory is the setting from the TestTool application at Extra->Settings->Profile->Base directory
113 '/// This path is available in the global variable: gTestToolPath
114 '/// The private environment location directory is taken from the file BaseDirectory+errorlog/privateenvironment.txt
115 '/// The default file is taken from cvs: qa/qatesttool/errorlog/privateenvironment.txt
116 '/// The default content is:
117 '/// >[PrivateEnvironment]
118 '/// >Current=global/private/
119 '/// The path is defined relative to BaseDirectory and put into the global variable: gPrivateEnvironmentLocation
120 '/// At the resulting path of BaseDirectory + gPrivateEnvironmentLocation + 'inc/' there has to exist the file: privateenvironment.inc
121 '/// with at least the sub: getUseFilesPrivateEnvironment which will get executed
123 if (gPrivateEnvironmentLocation = "") then
124 sPrivateEnvironmentLocation = ConvertPath (gTestToolPath + "errorlog\privateenvironment.txt")
125 if fileExists(sPrivateEnvironmentLocation) then
126 gPrivateEnvironmentLocation = getIniValue(sPrivateEnvironmentLocation, "PrivateEnvironment", "Current")
127 ' TODO: remove trailing path character
129 gPrivateEnvironmentLocation = "global/private/"
131 sTemp = ConvertPath (gTestToolPath + gPrivateEnvironmentLocation + "inc/privateenvironment.inc")
132 if fileExists(sTemp) then
134 call getUseFilesPrivateEnvironment
136 'qaErrorLog "Private Environment Control File Location specified in '" + sPrivateEnvironmentLocation + "', but the file doesn't exist: '" +sTemp+ "'"
140 ' Check if environment works with this OOo version
141 '/// Control the behaviour of the environment via the file qa/qatesttool/global/version.txt:
142 '/// [EnvironmentVersion]
144 '/// DisplayName=2.4.x
145 '/// If 'Current' doesn't match the OOo version major string, the environment refuses to work, by exiting the test with a messagebox and a warning.
146 '/// The checking can be disabled, by using Current=HEAD, or removing the file version.txt
147 sPrivateEnvironmentLocation = ConvertPath (gTestToolPath + "global\version.txt")
148 if fileExists(sPrivateEnvironmentLocation) then
149 sEnvironmentVersion = getIniValue(sPrivateEnvironmentLocation, "EnvironmentVersion", "Current")
150 sEnvironmentDisplayVersion = getIniValue(sPrivateEnvironmentLocation, "EnvironmentVersion", "DisplayName")
151 sEnvironmentVersionMinor = getIniValue(sPrivateEnvironmentLocation, "EnvironmentVersion", "Minor")
153 sEnvironmentVersion = "HEAD"
154 sEnvironmentDisplayVersion = "Developer"
156 if sEnvironmentVersion <> "HEAD" then
157 if (len(gMajor) > 5) then
158 if lCase(left(gMajor,6)) <> lCase(left(sEnvironmentVersion,6)) OR (lCase(gMinor) <> lCase(sEnvironmentVersionMinor)) then
159 warnlog "This environment '" + sEnvironmentVersion + sEnvironmentVersionMinor + "' is not suitable for this OOo version '" + left(gMajor,6) + gMinor + "'!"+chr(13)+"Please get the environment suitable for this OOo version!"+chr(13)+"This Environment only works with OOo " + sEnvironmentDisplayVersion + "!"
160 if MsgBox ("This environment '" + sEnvironmentVersion + sEnvironmentVersionMinor +"' is not suitable for this OOo version '" + left(gMajor,6) + gMinor + "'! Please get the environment suitable for this OOo version! This Environment only works with OOo " + sEnvironmentDisplayVersion + "!", 16, "Error at startup") = 1 then
168 '-------------------------------------------------------------------------
169 function checkWriteable() as boolean
170 '//// Check hid.lst destination for user writeability
171 dim sTestDir as string
172 dim bReturn as boolean
176 sTestDir = "tbotest" ' nasty bug, if the path is with a path sign at the end; usually on windows root dirs :-(
177 if (right(ConvertPath(gtHidLstPath, gtPlatform), 1) <> hGetPathSigne(gtPlatform)) then
178 sTestDir = hgetPathSigne(gtPlatform) + sTestDir
180 MkDir (ConvertPath(gtHidLstPath + sTestDir, gtPlatform))
181 RmDir (ConvertPath(gtHidLstPath + sTestDir, gtPlatform))
188 checkWriteable = bReturn
190 '-------------------------------------------------------------------------
193 '/// Determine and set OOo version information
194 '/// Check if hid.lst is at default location: testautomation/global/hid
195 '/// If not, check OOo basis path for hid.lst; check if default location from above is writeable for user
196 '/// Copy hid.lst from OOo basis path to the default location
197 '/// If something fails, give warnlog
198 dim sHidOOo as string
199 dim iShellReturn as integer
203 gVersionsnummer = FindBuildID
204 ' split versionstring into its parts
205 call hSetBuildVersionInformation(False)
206 qHost = "quaste.services.openoffice.org"
207 qPath = "/index.php?option=com_quaste&task=tests_overview&download=2" + "&workspace=" + gMajor + "&milestone=" + gMinor
208 ' check for hid.lst in $HID_DIR_LOCATION!
209 if (fileExists(gtHidLstPath + "hid.lst")) then
210 printlog "Found hid.lst file; It is taken from: " + gtHidLstPath
212 ' check for hid.lst in OOo installation
213 sHidOOo = convertPath(gOfficeBasisPath + "program/" + "hid.lst")
214 if (fileExists(sHidOOo)) then
215 printlog "Found hid.lst file; It exists in OOo installation: " + sHidOOo
217 ' make compatibility hint against version.txt
219 ' check for writeable global/hid/
220 if (checkWriteable()) then
222 fileCopy(sHidOOo, gtHidLstPath + "hid.lst")
223 printlog "File hid.lst successfull copied to location in VCL TestTool settings: " + gtHidLstPath
225 ' fail: make hint for hid.lst path
226 warnlog "File hid.lst could not be copied to default location, due to missing access rights"
227 warnlog "Please open the settings in VCL TestTool and change the path for HID directory to: " + sHidOOo
228 if MsgBox ("The test won't start! Further informations are in the result file below...", 16, "Error with hid.lst file") = 1 then end
231 ' Disabled, because Joomla! can not provide plain text webpage
232 'if (checkWriteable()) then
233 'try to get from Quaste via http
234 'httpSetProxy(Host, Port)
236 ' iShellReturn = httpSend(qHost, qPath, 80, gtHidLstPath + "hid.lst")
240 ' when using internal httpSend, iShellReturn contains http status numbers: 200 means: ok
241 ' if (iShellReturn <> 200) then
242 ' warnlog "Fetching file hid.lst with internal httpsend command failed with error code: " + iShellReturn + chr(13) + qHost+qPath + chr(13) + gtHidLstPath + "hid.lst"
243 ' no hid.lst in OOo available and not available via http...
244 ' warnlog "No hid.lst file in OOo installation or on Quaste server found; Please read documentation at " + ConvertPath (gTestToolPath + "global\hid\readme.txt") + " or ask on mailing list: dev@qa.openoffice.org"
245 ' kill gtHidLstPath + "hid.lst"
247 ' printlog "File hid.lst successfull fetched from "+qHost+qPath+" and saved to location in VCL TestTool settings: " + gtHidLstPath
250 ' warnlog "File hid.lst could not be saved to default location, due to missing access rights"
251 ' warnlog "Please download hid.lst file from: "+qHost+qPath+" and open the settings in VCL TestTool and change the path for HID directory to your download location."
252 warnlog "Please download hid.lst file from: "+ chr(13) +"http://"+qHost+qPath+ chr(13) + "and save it to: "+ chr(13) + gtHidLstPath+"hid.lst"
253 if MsgBox ("The test won't start! Further informations are in the result file below...", 16, "Error with hid.lst file") = 1 then end
258 '-------------------------------------------------------------------------
261 '/// Include all .sid-declarations (all menu-items as SlotIDs)
262 '///+<German names> (<u><b>DEPRECATED</u>, only fixes allowed!</b>)
263 use "global\sid\all.sid" '///+<ul><li>all.sid: All menuitems (German)</li>
264 use "global\sid\bars.sid" '///+<li>leisten.sid: All toolbars and toolboxes (German)</li>
265 use "global\sid\context.sid" '///+<li>kontext.sid: All context menus</li>
266 use "global\sid\others.sid" '///+<li>allgem.sid: other slots (German)</li></ul>
267 '///<English names>
268 use "global\sid\e_all.sid" '///+<ul><li>e_all.sid : all menuitems</li></ul>
270 '/// Include all .win-declarations (all dialogs as HelpIDs)
271 '///+<German names> (<u><b>OBSOLETE</u>, only fixes allowed!</b>)
272 use "global\win\tab_a_d.win" '///+<ul><li>All tabpages A...Z</li>
273 use "global\win\tab_e_g.win"
274 use "global\win\tab_h_o.win"
275 use "global\win\tab_p_s.win"
276 use "global\win\tab_t_z.win"
278 use "global\win\dial_a_c.win" '///+<li>All dialogs A...Z</li>
279 use "global\win\dial_d_h.win"
280 use "global\win\dial_i_o.win"
281 use "global\win\dial_p_s.win"
282 use "global\win\dial_t_z.win"
284 use "global\win\sys_dial.win" '///+<li>sys_dial.win: Systemdialogs</li>
285 use "global\win\dokument.win" '///+<li>dokument.win: All document-types</li>
286 use "global\win\mathop.win" '///+<li>mathop.win: Windows with all math operators</li>
288 use "global\win\piloten.win" '///+<li>piloten.win: Database-, Impress-, Microsoft(R) import-autopilots</li>
289 use "global\win\w_autop.win" '///+<li>w_autop.win: All Writer autopilots</li>
291 '///<English names>
292 use "global\win\edia_a_c.win" '///+<ul><li>All dialogs A...Z</li>
293 use "global\win\edia_d_h.win"
294 use "global\win\edia_i_o.win"
295 use "global\win\edia_p_s.win"
296 use "global\win\edia_t_z.win"
298 use "global\win\etab_a_d.win" '///+<li>All tabpages A...Z</li>
299 use "global\win\etab_e_g.win"
300 use "global\win\etab_h_o.win"
301 use "global\win\etab_p_s.win"
302 use "global\win\etab_t_z.win"
304 use "global\win\e_mathop.win" '///+<li>e_mathop.win: Mathoperators</li>
306 use "global\win\bars.win" '///+<li>bars.win: All bars as windows</li>
307 use "global\win\etoolbox.win" '///+<li>etoolsbox.win: Toolboxes</li>
309 use "global\win\spadmin.win" '///+<li>spadmin.win: SPAdmin</li>
311 use "global\win\reportdesigner.win" '///+<li>reportdesigner.win: ReportDesigner</li></ul>
314 '-------------------------------------------------------------------------
316 sub LoadGlobalIncludeFiles
317 '///Load all important global files.
318 use "global\tools\includes\required\t_dir.inc" '///+<li><b>t_dir</b>: Routines to parse directories (methods execute on the office side)</li>
319 use "global\tools\includes\required\t_dirloc.inc" '///+<li><b>t_dirloc</b>: Routines to parse directories (execute on the testtool side)</li>
320 use "global\tools\includes\required\t_doc1.inc" '///+<li><b>t_doc1</b>: Global routines to work on office documents (I)</li>
321 use "global\tools\includes\required\t_doc2.inc" '///+<li><b>t_doc2</b>: Global routines to work on office documents (II)</li>
322 use "global\tools\includes\required\t_files.inc" '///+<ul><li><b>t_files</b>: Routines to open/save/print files</li>
323 use "global\tools\includes\required\t_filters.inc" '///+<li><b>t_filters</b>: Get information about filters</li></ul>
324 use "global\tools\includes\required\t_lists.inc" '///+<li><b>t_lists</b>: Work with array/lists in basic scripts</li>
325 use "global\tools\includes\required\t_menu.inc" '///+<li><b>t_menu</b>: Routines to work with menus in the office</li>
326 use "global\tools\includes\required\t_option.inc" '///+<li><b>t_option</b>: Routine to navigate in the options-dialoge of office (I)</li>
327 use "global\tools\includes\required\t_option2.inc" '///+<li><b>t_option2</b>: Routine to navigate in the options-dialoge of office (II)</li>
328 use "global\tools\includes\required\t_tools1.inc" '///+<li><b>t_tools1</b> : Global routines (I)</li>
329 use "global\tools\includes\required\t_tools2.inc" '///+<li><b>t_tools2</b>: Global routines (II)</li>
330 use "global\tools\includes\required\t_tools3.inc" '///+<li><b>t_tools3</b>: Global routines (III)</li>
333 '-------------------------------------------------------------------------
336 '/// First start-routine.
338 caselog "" '///+<ul><li>Stop the first default-output into the resultfile</li>
339 Call hStartTheOffice '///+<li>Start the office</li>
340 ResetApplication '///+<li>Make the first recovering without an error output.</li></ul>
341 'Disabling crash handling by TestTool. The crash reporter is used instead.
342 'Needs to get executed everytime after a 'ResetApplication' command
344 ' Recover to backingwindow, until resetApplication can handle this
345 for i = 1 to getDocumentCount
350 '-------------------------------------------------------------------------
352 sub hStartTheOffice (optional sProfPath as String, optional sProfParameter as String)
353 Dim tVersionsnummer as string
354 Dim tLastVersion as string
355 Dim tlVersion() as string
356 Dim tilVersion as integer
357 Dim tiPosA as integer
358 Dim tiPosB as integer
359 Dim sErrorInformation as string
361 Dim sPlatformProgramPath as string
363 sErrorInformation = "global::systen::inc::master.inc:hStartTheOffice: "
365 if gPlatform = lcase("osx") then
366 sPlatformProgramPath = "MacOS"
368 sPlatformProgramPath = "program"
371 '/// <u>input</u>: <b>optional</b> <i>sProfPath</i> as String [path for profiling data]
372 '/// <u>input</u>: <b>optional</b> <i>sProfParameter</i> as String [filename for profiling data]
374 '///+<ol><li>Be sure the path to the result file exists and is writeable
375 '///+<ul><li>If it doesn't exist, try to create it</li>
376 '///+<li>If it isn't writeable a messagebox will be thrown</li>
377 '///+<li>The test will be stopped because without this path the testtool cannot write the resultfile to disk</li></ul></li>
378 if (hIsResultWriteable() <> TRUE) then
379 if MsgBox (sErrorInformation + "The test won't start! Please correct the error of the not createable RESULT file!", 16, "Error at startup") = 1 then
384 if gSamePC = TRUE then
385 tVersionsnummer = FindBuildID
386 ' split versionstring into its parts
387 tlVersion() = Split(tVersionsnummer, ",")
388 tilVersion = uBound(tlVersion()) ' array counts from 0 on!
389 tLastVersion = tlVersion(tilVersion)
390 ' major is from start to 'm'
391 tiPosA = instr(tLastVersion, ":") + 1
392 tiPosB = instr(tLastVersion, ")")
393 gBuild = cInt(Mid(tLastVersion, tiPosA, tiPosB-tiPosA))
396 'Startroutine for soffice.exe
397 if sGetCrashreporterValues() <> TRUE then
398 sTemp = "Please correct the entries in your testtool.ini/.testtoolrc." & Chr(13) & _
399 "Here are the current entries:" & Chr(13) & Chr(13) & _
400 "[Crashreporter]" & Chr(13) & _
401 "UseProxy=" & gUseProxy & " (Has to be set to (true/false)" & Chr(13) & _
402 "ProxyServer=" & gProxyServer & Chr(13) & _
403 "ProxyPort=" & gProxyPort & Chr(13) & _
404 "AllowContact=" & gAllowContact & " (Has to be set to (true/false)" & Chr(13) & _
405 "ReturnAddress=" & gReturnAddress
407 if MsgBox (sTemp, 16, "Error in TestTool control file!") = 1 then
408 'TODO: Function to write the missing information to TT control file.
409 'The test execution will be stopped here.
413 '///+<li>The normal start routine.
414 '///+<ul><li>If you want to create a logfile for timestamps, the parameter <i>-env:RTL_LOGFILE=[Path]</i> is appended. (<u>Note</u>: On Win32 the path must have two backslashes)</li>
415 '///+<li>To ignore the crash- and recover- process for OpenOffice.org-documents the parameter <i>-norestore -nocrashreport</i> is also appended</li>
416 '///+<li>To disable the configuration lock dialog <i>-nolockcheck</i> is also appended</li>
417 '///+<li>To enable the automated testing <i>-enableautomation</i> has been added</li>
418 '///+<li>If you make a remote-test, the office process can't be started by the testtool; you would get an error message</li>
420 if IsMissing (sProfPath) then
423 if IsMissing (sProfParameter) then
424 QAErrorLog sErrorInformation & " Parameter 'sProfParameter' is NOT OPTIONAL if sProfPath has been set!"
425 'The test execution will be stopped here.
428 sStartUpOffice (sProfPath, sProfParameter)
432 if gSamePC = FALSE then
434 if MsgBox (sErrorInformation + "It is not possible to start the office application on a remote system." _
435 & Chr(10) & "Please start the office application.", 1, "Starting the office application") = 2 then
438 warnlog sErrorInformation + "The test has a problem to start the office application. It needs a second chance!"
439 '///+<li>Sometimes the first start instruction does not work correctly, so here it gets a second chance to start.</li></ul>
440 if IsMissing (sProfPath) then
443 if IsMissing (sProfParameter) then
444 QAErrorLog sErrorInformation & " Parameter 'sProfParameter' is NOT OPTIONAL if sProfPath has been set!"
445 'The test execution will be stopped here.
448 sStartUpOffice (sProfPath, sProfParameter)
454 '///+<li>Set the debug output in an non-product version to the Testtool
456 'Only in a debug version of the office: Setting the assertion output to TestTool.
457 CaptureAssertions TRUE
460 Kontext "WelcomeDialog"
461 if WelcomeDialog.Exists(2) then
462 '///+<li>Clicking on Next button</li>
464 Kontext "TabFirstStartLicense"
465 if TabFirstStartLicense.Exists(1) then
466 '///+<li>If the next tabpage will be visible pressing <CTRL+a> to get the 'Next'-button available.</li>
467 LicenseText.TypeKeys "<MOD1 a>" , TRUE
468 Kontext "WelcomeDialog"
469 '///+<li>Clicking on Next button </li>
473 qaErrorLog "#i86137# STRG-A failed on license text, using workaround."
474 Kontext "TabFirstStartLicense"
475 while scrolldown.isEnabled
481 ' Now trying again to go on...
482 Kontext "WelcomeDialog"
487 warnlog sErrorInformation & "The second page (license) of the 'Welcome to $PRODUCTNAME'-wizard is not visible!"
490 Kontext "TabPersonalDataMigration"
491 '///+<li>If an OpenOffice 1.1.x exists the migration page will be visible.</li>
492 if TabPersonalDataMigration.Exists(1) then
493 '///+<li>Uncheck the checkbox for tranferring personal data to get a clean configuration.</li>
494 TransferPersonalData.uncheck
495 Kontext "WelcomeDialog"
496 '///+<li>Clicking on Next button </li>
498 'TODO: Add exception handling.
500 Kontext "TabFirstStartUser"
501 if TabFirstStartUser.Exists(1) then
502 Kontext "WelcomeDialog"
503 '///+<li>If the next tabpage will be visible clicking on 'Next'-button.</li>
505 'TODO: Add exception handling.
507 Kontext "TabFirstStartOnlineUpdate"
508 if TabFirstStartOnlineUpdate.Exists(1) then
510 checkForUpdates.uncheck
513 Kontext "WelcomeDialog"
514 '///+<li>If the next tabpage will be visible clicking on 'Next'-button.</li>
516 'TODO: Add exception handling.
518 Kontext "TabFirstStartRegistration"
519 if TabFirstStartRegistration.Exists(1) then
520 '///+<li>If the next tabpage will be visible checking 'do not want to register'-radio button.</li>
521 doNotWantRegister.Check
522 Kontext "WelcomeDialog"
523 '///+<li>Clicking on 'Next'-button.</li></ul>
526 warnlog sErrorInformation & "The fourth page (register) of the 'Welcome to $PRODUCTNAME'-wizard is not visible!"
530 'Disable Quickstarter internaly
531 hDisableQuickstarterAPI
534 '-------------------------------------------------------------------------
536 sub ExitRestartTheOffice (optional sProfPath as String, optional sProfParameter as String)
537 '/// input: optional sProfPath as String [path for profiling data]
538 '/// input: optional sProfParameter as String [filename for profiling data]
539 '/// If a messagebox comes up (yes, no) it will be closed (only one messagbox)
541 Dim sErrorInformation as string
543 sErrorInformation = "global::systen::inc::master.inc:ExitRestartTheOffice: "
547 if IsMissing (sProfPath) then
550 if IsMissing (sProfParameter) then
551 QAErrorLog sErrorInformation & " Parameter 'sProfParameter' is NOT OPTIONAL if sProfPath has been set!"
552 'The test execution will be stopped here.
555 sStartUpOffice (sProfPath, sProfParameter)
558 'Disabling crash handling by TestTool. The crash reporter is used instead.
563 'Disable Quickstarter internaly
564 hDisableQuickstarterAPI
565 ' Recover to backingwindow, until resetApplication can handle this
566 for i = 1 to getDocumentCount
571 '-------------------------------------------------------------------------
574 '/// Just shut down OOo
575 '/// If a messagebox comes up (yes, no) it will be closed (only one messagbox)
576 'Disable Quickstarter internaly, last chance to join processes - important if testtool restarted OOo after a crash!
577 hDisableQuickstarterAPI
579 FileExit "SynchronMode", TRUE
584 if Active.Exists(2) then
589 ' This is only >0 if defined in TestTool configuration file
590 ' It is needed for a gcov enabled OOo build (Code coverage)
591 ' and for valgrind (Memory leaks) tests
592 ' valgrind: 90;1,5min, gcov 290;4,5min
593 sleep(30+gOOoShutdownTimeOut)
596 '-------------------------------------------------------------------------
599 '/// Automatically called, when a testcase-routine starts
600 Call PleaseRecover ("TestEnter")
601 'Needed for status.inc
602 gTestcaseStart = Now()
603 Call writeCrashRepFile()
606 '-------------------------------------------------------------------------
609 '/// Automatically called at the end of a testcase or directly called when an error occured
610 '///+<li>Write the data for status page in a list in status.inc</li></ul>
611 Call PleaseRecover ("TestExit")
612 if ((gTestName <> "") AND isStatusEnabled()) then
613 'gTestName set in hStatusIn
614 call hStatusAddTestcase()
618 '-------------------------------------------------------------------------
620 sub PleaseRecover (sWhat as String)
622 Dim sInterrupt as Boolean
623 Dim sOtherError as Boolean
630 '/// Close the translation window.
632 if gDasNicht = 0 then
633 Kontext "TranslationWindow"
634 if TranslationWindow.Exists then
635 TranslationWindow.Close
641 '/// Use <i>ResetApplication</i> method
643 call hCloseAllToolbars
644 'All error-strings are in sError
645 gStartTheOffice = FALSE
646 'This is the trigger for a restart after application crashed:
647 sError = ResetApplication
648 'If sError = empty then no error occured.
650 printlog " ** Error in " + sWhat + " -Routine **"
654 if NOT gStartTheOffice then
655 printlog "global::system::inc::PleaseRecover: No office running while trying to recover: " + sError + " " + sWhat
663 'Kill all commands after the reset
668 '/// If the office crashes interrupt = TRUE and the office should be started again.
669 if sInterrupt = TRUE then
675 QAErrorLog "killapp: "+gTestName+"--"+getTestcaseName
683 'kill all commands after the reset
690 'Only in a debug version of the office: Setting the assertion output to TestTool
691 CaptureAssertions TRUE
694 'Disabling crash handling by TestTool. The crash reporter is used instead.
701 ' Recover to backingwindow, until resetApplication can handle this
704 qaErrorLog "Needed to close window: (" + i + "/"+a+") on " + sWhat
709 warnlog "Failed to close window; There are still open: " + a
713 '-------------------------------------------------------------------------
716 '/// Create a general header in result files for all tests.
720 Dim sHidVersion as String
722 sHidVersion = getBuildNumHidLst
723 if lCase(trim(sHidVersion)) <> lCase(gMajor + "." + gMinor) then
724 qaErrorLog "Version of file hid.lst differs from OOo version"
726 if gSamePC = TRUE then
727 if (len(gMajor)>3) then
728 sMajor = left(gMajor,3)
730 'Detecting child workspaces (CWS) and status database server
731 if InStr(gVersionsnummer , "[CWS:") <> 0 then
736 if hDetectStatusDatabase = TRUE then
737 gStatusDatabase = TRUE
739 gStatusDatabase = FALSE
742 gVersionsnummer = "REMOTE"
744 iSystemSprache = hGetSystemLanguage
745 bDebugVersion = NOT isProduct
746 printlog "----------------------------------------------------------------------------------------------------"
747 printlog " I n f o r m a t i o n A b o u t T h e T e s t E n v i r o n m e n t"
748 printlog "----------------------------------------------------------------------------------------------------"
749 printlog "** Application build ID : " & sMajor & gVersionsnummer
750 if bDebugVersion = TRUE then
751 printlog "** DEBUG version : " & bDebugVersion
754 printlog "** Build type : MASTER"
756 printlog "** Build type : CWS"
758 if isStatusEnabled() then
759 'http://wiki.services.openoffice.org/wiki/QUASTe
760 printlog "** Status feature (QUASTe) : Enabled " + gLocalStatusDatabase
762 printlog "** HID.LST based on milestone : " + sHidVersion
763 printlog "----------------------------------------------------------------------------------------------------"
764 printlog "** Application installation path : " + gNetzOfficePath
765 printlog "** User configuration path : " + gOfficePath
766 printlog "** Started application : " + sAppExe
767 printlog "----------------------------------------------------------------------------------------------------"
768 printlog "** Application language : " + iSprache + " (" + gLanguage + " / " + gISOLang + ")"
769 printlog "** System language : " + iSystemSprache + " (" + GetLanguageText (iSystemSprache) + ")"
770 if gSamePC = FALSE then
771 printlog "** Platform VCL TestTool : " + gtSYSName
772 printlog "** Platform application : " + gSYSName + " (" + gHost + ") "
773 printlog "** Path to remote base path : " + gRemotePath
775 printlog "** Testing platform : " + gtSYSName
777 printlog "----------------------------------------------------------------------------------------------------"
778 sDir1 = ConvertPath (gOfficePath + "user\work\"
779 sDir = App.Dir (sDir1, 16)
782 printlog "** Work path has been created : " + sDir1
784 'Disabling embedded translation tooling
786 'Disabling embedded screenshot tooling depending on value in .testtoolrc/ini
787 gbSnapShot = sGetScreenshotValue
790 '-------------------------------------------------------------------------
792 sub mMakeGeneralOptionsAPI
793 '/// At the beginning of each testrun set some defaults with the API
794 '///+ and write them down into the result file (.res).
796 Dim bHelpTip as Boolean
797 Dim sTempPath as string
798 Dim sWorkPath as string
799 Dim oUnoOfficeConnection as object
800 Dim oUnoConfigurationAccess as object
801 Dim aPropertyValue(1) As new com.sun.star.beans.PropertyValue ' Array of pairs: Property with Value
804 Dim bError as boolean
806 const sFileFunction = "global::system::inc::master.inc::hMakeGeneralOptionsAPI:: "
808 ' Open OOo UNO-Port for communication
809 oUnoOfficeConnection=hGetUnoService(TRUE)
810 if (isNull(oUnoOfficeConnection)) then
811 warnlog (sFileFunction+"Couldn't create Uno access")
816 ' Open Configuration access
817 oUnoConfigurationAccess=oUnoOfficeConnection.createInstance("com.sun.star.configuration.ConfigurationProvider")
818 if (isNull(oUnoConfigurationAccess)) then
819 warnlog (sFileFunction+"Couldn't create Configuration access")
822 ' These Value pairs don't change inside this function, so they are only set once here.
823 ' Specifies the location of the view root in the configuration:
824 ' The value is the Path name of teh configuration item to change.
825 aPropertyValue(0).Name="nodepath"
826 ' Controls how updates are handled in the cache: If false , the cache
827 ' must operate in write-through mode, where updates are written to
828 ' persistent storage at once - that is before ::commitChanges() returns.
829 aPropertyValue(1).Name="lazywrite"
830 aPropertyValue(1).Value=False
832 '///+<li>Tools / Language Settings / Languages
833 '///+ Check if Asian language support is enabled and set <i>gAsianSup</i> variable TRUE or FALSE.
834 aPropertyValue(0).Value="/org.openoffice.Office.Common/I18N/CJK"
835 xViewRoot=oUnoConfigurationAccess.createInstanceWithArguments("com.sun.star.configuration.ConfigurationUpdateAccess",aPropertyValue())
836 gAsianSup = xViewRoot.getByName("AsianTypography")
837 ' I don't use something more on the path: "/org.openoffice.Office.Common/I18N/CJK"
838 ' Destroy, discard, dump, get rid of, put away, throw away, trash, the object:
840 '///+ Check if CTL (=complex text layout) is enabled amd set <i>gCTLSup</i> variable TRUE or FALSE.
841 aPropertyValue(0).Value="/org.openoffice.Office.Common/I18N/CTL"
842 xViewRoot=oUnoConfigurationAccess.createInstanceWithArguments("com.sun.star.configuration.ConfigurationUpdateAccess",aPropertyValue())
843 gCTLSup = xViewRoot.getByName("CTLFont")
846 if gAsianSup = TRUE then
847 printlog "** Asian language support : " & gAsianSup
849 if gCTLSup = TRUE then
850 printlog "** Complex text layout support : " & gCTLSup
852 '///+<li>Set <i>gAccessibility</i> from Options API</li>
853 aPropertyValue(0).Value="/org.openoffice.VCL/Settings/ConfigurableSettings['Accessibility']"
854 xViewRoot=oUnoConfigurationAccess.createInstanceWithArguments("com.sun.star.configuration.ConfigurationUpdateAccess",aPropertyValue())
855 gAccessibility = xViewRoot.getByName("EnableATToolSupport")
857 if gAccessibility then
858 printlog "** Accessibility support : " & gAccessibility
861 '///+ <li>Switch the <i>system</i> file dialogs to "internal" file dialogs.
862 aPropertyValue(0).Value="/org.openoffice.Office.Common/Misc"
863 xViewRoot=oUnoConfigurationAccess.createInstanceWithArguments("com.sun.star.configuration.ConfigurationUpdateAccess",aPropertyValue())
864 xViewRoot.setPropertyValue("UseSystemFileDialog", false)
865 xViewRoot.commitChanges()
866 ' Since we use lazywrite=false, the call to '.commitChanges()' returns if all data is written.
867 ' This call to ask for pending changes is just to convince me;
868 if xViewRoot.hasPendingChanges() then
869 qaErrorLog(sFileFunction+"Changes still pending...: UseSystemFileDialog")
870 ' At this point there is no needed to think about what to do, if it doesn't work.
874 'printlog "** Using system file dialogs : " & gUseSysDlg
876 if (lcase(gPlatform) = "osx") then
877 '///+ <li>Switch the <i>system</i> print dialogs to "internal" print dialogs.
878 aPropertyValue(0).Value="/org.openoffice.Office.Common/Misc"
879 xViewRoot=oUnoConfigurationAccess.createInstanceWithArguments("com.sun.star.configuration.ConfigurationUpdateAccess",aPropertyValue())
881 xViewRoot.setPropertyValue("UseSystemPrintDialog", false)
882 xViewRoot.commitChanges()
888 '///+<li>Disabling the <i>bubble help</i>.
889 aPropertyValue(0).Value="/org.openoffice.Office.Common/Help"
890 xViewRoot=oUnoConfigurationAccess.createInstanceWithArguments("com.sun.star.configuration.ConfigurationUpdateAccess",aPropertyValue())
891 bHelpTip = xViewRoot.getByName("Tip")
894 xViewRoot.setPropertyValue("Tip", false)
895 xViewRoot.commitChanges()
897 if xViewRoot.hasPendingChanges() then
898 qaErrorLog(sFileFunction+"Changes still pending...: HelpTip")
900 'printlog "** Help/Tips : " & bHelpTip
904 '///+ <li>Disable automatic check for updates
905 ' Encapsulating this in a try...catch block because external (non-Sun) builds
906 ' do usually not support online update so the API is not available and we get an
907 ' exception. In case of failure we print a QAErrorLog.
909 aPropertyValue(0).Value="/org.openoffice.Office.Jobs/Jobs/Job['UpdateCheck']/Arguments"
910 xViewRoot=oUnoConfigurationAccess.createInstanceWithArguments("com.sun.star.configuration.ConfigurationUpdateAccess",aPropertyValue())
911 xViewRoot.replaceByName("AutoCheckEnabled", false)
912 xViewRoot.commitChanges()
913 ' Since we use lazywrite=false, the call to '.commitChanges()' returns if all data is written.
914 ' This call to ask for pending changes is just to convince me;
915 if xViewRoot.hasPendingChanges() then
916 qaErrorLog(sFileFunction+"Changes still pending...: AutoCheckEnabled")
917 ' At this point there is no needed to think about what to do, if it doesn't work.
921 qaErrorLog( sFileFunction & "This build does not support online update." )
924 '///+ OOo Improvement - only if BUILD_SPECIAL is set we have this file created.
925 sTempPath = gOfficeBasisPath & "share/registry/modules/org/openoffice/Office/Jobs/Jobs-oooimprovement.xcu"
926 sTempPath = ConvertPath( sTempPath )
928 if ( FileExists( sTempPath ) ) then
929 gOOoImprovementIsEnabled = TRUE
931 gOOoImprovementIsEnabled = FALSE
934 '///+<li>Setting the <i>work</i> directory in Tools / Options,
935 sTempPath = ConvertPath (gOfficePath + "user\work")
936 '///+<li>If the temp-path does not exist it will be created.
937 if (app.dir(sTempPath, 16) <> "work") then
939 app.mkdir (sTempPath)
942 QAErrorLog sFileFunction + "Couldn't create temp-directory: '" + sTempPath + "'"
949 oUnoConfigurationAccess=oUnoOfficeConnection.createInstance("com.sun.star.util.PathSettings")
950 oUnoConfigurationAccess.Work = convertToURL(ConvertPath (gOfficePath + "user\work"))
951 sWorkPath = convertFromURL(oUnoConfigurationAccess.Work)
952 printlog "** 'My Documents'-path is now : " & sWorkPath
955 '///+<li>Setting the directory for temporary files (=temp-path).
956 sTempPath = ConvertPath (gOfficePath + "user\temp")
957 '///+<li>If the temp-path does not exist it will be created.
958 if (app.dir(sTempPath, 16) <> "temp") then
960 app.mkdir (sTempPath)
963 QAErrorLog sFileFunction + "Couldn't create temp-directory: '" + sTempPath + "'"
970 ' recycle from above: oUnoConfigurationAccess=oUnoOfficeConnection.createInstance("com.sun.star.util.PathSettings")
971 oUnoConfigurationAccess.Temp = convertToURL(ConvertPath (gOfficePath + "user\temp"))
972 sTempPath = convertFromURL(oUnoConfigurationAccess.Temp)
973 printlog "** 'Temporary files'-path : " & sTempPath
975 '///Check which 'Macro Security Level' is set and put it into <i>gMacroSecurityLevel</i> variable.
976 gMacroSecurityLevel = hSetMacroSecurityAPI( 2 )
981 MsgBox (sFileFunction + "The test did not start correctly or the application crashed." & Chr(13) & _
982 "Please correct the problem to make the general settings otherwise the test won't start!", 16, "Error at startup")
983 'The test stops here if mMakeGeneralOptionsAPI has been run into problems (GPF, failure, ..)
989 '-------------------------------------------------------------------------
991 function hIsResultWriteable() as boolean
992 '///Running a test without being able to write the RESULT file to disk is worthless.
993 '///+This functions checks if the directory exists, tries to create it and checks if it is writeable.
994 '///+If this fails, the test won't start and presents a messagebox.
995 Dim sResultFilePath as string
996 Dim sTestDir as string
998 'Get the path to the RESULT directory
999 sResultFilePath = GetIniValue (gTesttoolIni, gTTProfileName , "LogBaseDir")
1000 if (dir(sResultFilePath, 16) = "") then ' doesn't exist
1002 MkDir (ConvertPath(sResultFilePath, gtPlatform))
1003 ' WorkAround for bug in dir() #104037#
1004 MkDir (ConvertPath(sResultFilePath+ gPathSigne+"ID104037", gtPlatform))
1005 if (dir(sResultFilePath, 16) <> "") then
1007 hIsResultWriteable = TRUE
1008 printlog "global::system::inc::master.inc::hIsResultWriteable: created RESULT directory: '" + sResultFilePath + "'"
1009 ' WorkAround for bug in dir()
1010 RmDir (ConvertPath(sResultFilePath + gPathsigne + "ID104037", gtPlatform))
1012 warnlog "global::system::inc::master.inc::hIsResultWriteable: Make the directory '" + sResultFilePath + "' writeable; RESULT file can not be saved;"
1013 hIsResultWriteable = FALSE
1016 warnlog "global::system::inc::master.inc::hIsResultWriteable: Create the directory '" + sResultFilePath + "'; RESULT file can not be saved; (no right to create the directory)"
1017 hIsResultWriteable = FALSE
1020 ' Check if it is writeable
1022 sTestDir = "tbotest" ' nasty bug, if the path is with a path sign at the end; usually on on windows root dirs :-(
1023 if (right(ConvertPath(sResultFilePath, gtPlatform), 1) <> hGetPathSigne(gtPlatform)) then
1024 sTestDir = hgetPathSigne(gtPlatform) + sTestDir
1026 MkDir (ConvertPath(sResultFilePath + sTestDir, gtPlatform))
1027 RmDir (ConvertPath(sResultFilePath + sTestDir, gtPlatform))
1028 hIsResultWriteable = TRUE
1030 warnlog "global::system::inc::master.inc::hIsResultWriteable: Make the directory '" + convertPath(sResultFilePath, gtPlatform) + "' writeable; RESULT file can not be saved;"
1031 hIsResultWriteable = FALSE
1036 '-------------------------------------------------------------------------
1038 sub hDetectStatusDatabase as Boolean
1039 '/// Detecting the status database server.
1040 dim sOOoLocalStatusDatabase as string
1041 dim sPrivateEnvironmentLocation as string
1044 sTemp = GetIniValue ( gTesttoolIni, "StatusFeatureLevel" , "Current" )
1046 sPrivateEnvironmentLocation = ConvertPath (gTestToolPath + "errorlog\privateenvironment.txt")
1047 if fileExists(sPrivateEnvironmentLocation) then
1048 gStatusFeatureLevel = getIniValue(sPrivateEnvironmentLocation, "StatusFeatureLevel", "Current")
1050 ' manual submitting status from errorlog directory
1051 gStatusFeatureLevel = 2
1054 gStatusFeatureLevel = sTemp
1056 if gStatusFeatureLevel = 0 then
1057 ' automatical submitting status; filespace location defined in privateenvironment.inc
1058 hDetectStatusDatabase = TRUE
1059 gLocalStatusDatabase = ""
1061 if gStatusFeatureLevel = 1 then
1062 ' automatical submitting status; filespace location defined in testtoolrc
1063 hDetectStatusDatabase = TRUE
1064 sOOoLocalStatusDatabase = GetIniValue ( gTesttoolIni, "OOoLocalStatusDatabase" , "Current" )
1065 if sOOoLocalStatusDatabase <> "" then
1066 if dir(sOOoLocalStatusDatabase,16) <> "" then
1067 gLocalStatusDatabase = sOOoLocalStatusDatabase
1068 'printlog "** OOo Local Status Database Path: '" + sOOoLocalStatusDatabase + "'"
1070 qaErrorLog "** OOo Local Status Database Path: '" + sOOoLocalStatusDatabase + "' doesn't exist or is not a directory."
1071 gLocalStatusDatabase = ""
1074 qaErrorLog "You are using status mode 1; you have to define the public filespace location in your testtoolrc:"+chr(13)+"[OOoLocalStatusDatabase]"+chr(13)+"Type=Path"+chr(13)+"Current=."
1075 gLocalStatusDatabase = ""
1077 sTemp = GetIniValue ( gTesttoolIni, "StatusDatabaseServerIP" , "Current" )
1079 qaErrorLog "You are using status mode 1; you have to define the database server adress in your testtoolrc:"+chr(13)+"[StatusDatabaseServerIP]"+chr(13)+"Type=Path"+chr(13)+"Current=."
1081 privateDatabaseServerIP = sTemp
1083 sTemp = GetIniValue ( gTesttoolIni, "StatusDatabaseServerPath" , "Current" )
1085 qaErrorLog "You are using status mode 1; you have to define the database server path in your testtoolrc:"+chr(13)+"[StatusDatabaseServerPath]"+chr(13)+"Type=Path"+chr(13)+"Current=."
1087 privateDatabaseServerPath = sTemp
1090 if gStatusFeatureLevel = 2 then
1091 hDetectStatusDatabase = TRUE
1092 gLocalStatusDatabase = "errorlog directory"
1094 hDetectStatusDatabase = FALSE
1095 gLocalStatusDatabase = ""
1101 '-------------------------------------------------------------------------
1103 function hDisableQuickstarter as boolean
1104 '/// On all systems, disable the Quickstart feature which is enabled by default.
1105 '///+ Returns: Answer to the question 'Was action taken, to disable it?'
1106 Dim bTemp as boolean
1107 Dim bResult as boolean
1108 Dim bVeto as boolean
1112 bVeto = FALSE ' True if Tools-Options-Memory needs to get triggert
1114 'This needs/can not be done on the following platforms:
1116 '- Linux/Unix builds of StarOffice/Suite
1117 '- Win32 if already disabled, or not available.
1118 if gPlatGroup <> "unx" then
1119 ' if quickstart.exe exists, it might run, else no need to open options UI
1120 bVeto = fileExists(gNetzOfficePath + "program\quickstart.exe")
1122 if (lcase(gPlatform) = "osx") then
1125 ' Not needed if StarOffice/Suite
1130 'First, disabling the Quickstarter via UI
1132 call hToolsOptions ("STAROFFICE", "MEMORY")
1134 bTemp = LoadQuickstarter.isChecked
1136 LoadQuickstarter.uncheck
1141 Kontext "ExtrasOptionenDlg"
1142 ExtrasOptionenDlg.OK
1147 'Second, closing the Quickstarter process that a restart of the office
1148 hDisableQuickstarterAPI()
1149 hDisableQuickstarter = bResult
1152 '-------------------------------------------------------------------------
1154 sub sStartUpOffice (optional sProfPath as String, optional sProfParameter as String)
1155 Dim sParameter as String
1156 Dim sErrorInformation as string
1157 Dim sUnoPort as string
1158 Dim sPlatformProgramPath as string
1159 Dim sPlatformBinExt as string
1161 sErrorInformation = "global::systen::inc::master.inc:sStartUpOffice: "
1163 '/// The environment for the non-GUI Crashreporter function will be set.
1164 setChildEnv("ERRORREPORT_HTTPPROXYSERVER",gProxyServer)
1165 setChildEnv("ERRORREPORT_HTTPPROXYPORT",gProxyPort)
1166 setChildEnv("ERRORREPORT_HTTPCONNECTIONTYPE",gConnectionType)
1167 setChildEnv("ERRORREPORT_RETURNADDRESS",gReturnAddress)
1168 setChildEnv("ERRORREPORT_SUBJECT","Error_Report_from_TestTool")
1169 setChildEnv("ERRORREPORT_BODYFILE",ConvertPath (gOfficePath & "user\work\crashrep.txt"))
1171 ' Set a valid URE_BOOTSTRAP path for soffice, else the invalid one from this testtool instance
1172 ' will get used i86718 - would result in a message about vcl stuff and a not starting soffice
1173 if gPlatform = lcase("osx") then
1174 sPlatformProgramPath = "MacOS"
1175 sPlatformBinExt = "rc"
1177 sPlatformProgramPath = "program"
1178 if gPlatGroup <> "unx" then
1179 sPlatformBinExt = ".ini"
1181 sPlatformBinExt = "rc"
1184 setChildEnv("URE_BOOTSTRAP",convertToURL(convertPath(gNetzOfficePath + sPlatformProgramPath + "/fundamental" + sPlatformBinExt)))
1187 hGetUNOService(true, sUnoPort)
1188 if sUnoPort <> "" then
1189 sUnoPort = "-accept=socket,host=localhost,port=" + sUnoPort + ";urp "
1192 warnlog "UNO port is not defined: Set it in the TestTool application: Extra -> Settings -> Misc -> Remote UNO Port"
1195 '/// To start the application some parameter need to be set:
1196 '///+ <ol><li><i>-enableautomation</i> to enable the TCP/IP connection between office application and TestTool</li>
1197 '///+ <li><i>-norestore</i> to eliminate the the document recovery functionylity after a crash</li>
1198 '///+ <li><i>-nolockcheck</i> to elimante the 'parallel running instances'-check and always start the application</li>
1199 '///+ <li><i>-autocrashreport</i> to enable the non-GUI crash report functionality</li>
1200 '///+ <li><i>-accept=socket,host=localhost,port=12345;urp</i> to enable UNO connection</li>
1201 '///+ <li><i>OPTIONAL application parameters</i> for profiling tests</li>
1202 sParameter = "-enableautomation -norestore -nolockcheck -autocrashreport -nofirststartwizard " & sUnoPort & sAppParameter & " "
1203 if IsMissing (sProfPath) then
1204 '///+ <li><i>Factory</i>-parameter which depends on the value of <b>gApplication</b> (WRITER, CALC, ...)</li></ol>
1205 sParameter = sParameter & sFactory
1206 ' try/catch is needed for special tasks, to workaround time outs
1208 Start sAppExe, sParameter
1212 ' This is only >0 if defined in TestTool configuration file
1213 ' It is needed for valgrind (Memory leaks) tests
1214 ' Valgrind: 420;8min
1215 sleep(gOOoStartupTimeOut)
1219 if IsMissing (sProfParameter) then
1220 '/// If OPTIONAL profiling path parameters have been set the profiling filename will be checked
1221 '///+ because then this parameter is not optional.
1222 QAErrorLog sErrorInformation & " Parameter 'sProfParameter' is NOT OPTIONAL if sProfPath has been set!"
1223 'The test execution will be stopped here.
1226 '/// If both OPTIONAL parameters (path, filename) have been set, the office application
1227 '///+ will be started with an additional parameter:
1228 '///+ <ul><li><i>-env:RTL_LOGFILE=pathname/filename</i> to write the profiling log.</li>
1229 sParameter = sParameter & "-env:RTL_LOGFILE=" & sProfPath & sProfParameter
1231 '///+ <li><i>Factory</i>-parameter which depends on the value of <b>gApplication</b> (WRITER, CALC, ...)</li></ul>
1232 Start sAppExe, sParameter & " " & sFactory
1237 '/// this routine is not intended to be called from within a testscript.
1238 '/// this routine will get called by the VCL TestTool application, in case it recognizes there is no soffice.bin running anymore or not responding anymore
1239 '/// this happens usually after OpenOffice.org crashed
1240 'keep it as short as possible!
1241 warnlog "OpenOffice.org application crashed or can not be started. Double click the above error message if exists for the culprint."
1247 hDisableQuickstarterAPI()
1248 ' set global variable for backwards compatibility
1249 gStartTheOffice = TRUE