summaryrefslogtreecommitdiff
path: root/testautomation/writer/optional/includes/fields/w_fields5.inc
blob: 2f4e3b0b9ecb73c06b15950832124b298f2f9763 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
'encoding UTF-8  Do not remove or change this line!
'**************************************************************************
' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
'
' Copyright 2000, 2010 Oracle and/or its affiliates.
'
' OpenOffice.org - a multi-platform office productivity suite
'
' This file is part of OpenOffice.org.
'
' OpenOffice.org is free software: you can redistribute it and/or modify
' it under the terms of the GNU Lesser General Public License version 3
' only, as published by the Free Software Foundation.
'
' OpenOffice.org is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
' GNU Lesser General Public License version 3 for more details
' (a copy is included in the LICENSE file that accompanied this code).
'
' You should have received a copy of the GNU Lesser General Public License
' version 3 along with OpenOffice.org.  If not, see
' <http://www.openoffice.org/license.html>
' for a copy of the LGPLv3 License.
'
'/************************************************************************
'*
'* owner : helge.delfs@sun.com
'*
'* short description : Fields - Variables
'*
'\***********************************************************************

sub w_fields5

    Call tVariablesSetValueToText
    Call tVariablesSetValueToNumber
    Call tVariablesSetFormats
    Call tVariablesShowVariable1
    Call tVariablesShowVariable2
    Call tVariablesInsertFormula
    Call tVariablesNumberRange	
    Call tVariablesInputfield
    Call tVariablesUserfield
    Call tVariablesDDEFieldManual
    Call tVariablesDDEFieldAutomatic

end sub

'-----------------------------------------------------------------

testcase tVariablesSetValueToText
    if bAsianLan = true then
        QaErrorLog "No testing with Asian language. Aborting."
        exit sub
    end if

  Dim sName()   as String
  Dim sValue    as String
  Dim sResult() as String
  Dim i         as Integer
  Dim j         as Integer

  sValue  = "This is a test!"

  sName   = Array( _
                   "myTest1" , _
                   "myTest2" , _
                   "myTest3" , _
                   "myTest4" , _
                   "myTest5" , _
                   "myTest6" , _
                  )
  sResult = Array( _
                   "This is a test!" , _
                   "1"               , _
                   "1"               , _
                   "1" & gSeperator & "00"            , _
                   "1"               , _
                   "1" & gSeperator & "00"            , _
                  )
  j = UBound(sResult)

  printlog "Set value to text"
 '/// <b> Set value to text </b>

  Call hNewDocument

  '/// Insert/Fields/Other/Variables / Select "set Variable" ,
  '/// Set Name and Value(text) , then choose Text , General ,
  '/// + -1234 , -1234.12 , -1,234 , -1,234,12 separately
   Call fInsertFieldsOther("TabVariablen")
     for i = 0 to j
         Feldtyp.Select 1
         Sleep 1
         NameText.SetText sName(i)
         Wert.SetText sValue
         Zahlenformat.Select i+1
         Einfuegen.Click
         sleep 1
         Call wTypeKeys "<Return>"
         Kontext "TabVariablen"
     next i
     Kontext "TabVariablen"
   TabVariablen.Close

  '/// Check if the insertion is correct
   Call wTypeKeys "<MOD1 Home>"

   for i = 0 to j
       Call wTypeKeys "<Shift Right>"
       if fGetFieldContent() <> sResult(i) then
           Warnlog i & "Should get " & sResult(i) & " but get " & fGetFieldContent()
       end if
       Call wTypeKeys "<Down><Home>"
   next i

  Call hCloseDocument

endcase

'-----------------------------------------------------------------

testcase tVariablesSetValueToNumber
    if bAsianLan = true then
        QaErrorLog "No testing with Asian language. Aborting."
        exit sub
    end if

  Dim sName()   as String
  Dim sValue    as String
  Dim sResult() as String
  Dim i         as Integer
  Dim j         as Integer

  sValue  = "1234,567"

  sName   = Array( _
                   "myTest1" , _
                   "myTest2" , _
                   "myTest3" , _
                   "myTest4" , _
                   "myTest5" , _
                   "myTest6" , _
                  )
  sResult = Array( _
                   "1234,567" , _
                   "1234,57"  , _
                   "1235"     , _
                   "1234,57"  , _
                   "1.235"    , _
                   "1.234,57" , _
                  )
  j = UBound(sResult)

  printlog "Set value to number"
 '/// <b> Set value to number </b>

  Call hNewDocument

  '/// Insert/Fields/Other/Variables / Select "set Variable" ,
  '/// Set Name and Value(number) , then choose Text , General ,
  '/// + -1234 , -1234.12 , -1,234 , -1,234,12 separately
   Call fInsertFieldsOther("TabVariablen")
     for i = 0 to j
         Feldtyp.Select 1
         Sleep 1
         NameText.SetText sName(i)
         Wert.SetText sValue
         Zahlenformat.Select i+1
         Einfuegen.Click
         sleep 1
         Call wTypeKeys "<Return>"
         Kontext "TabVariablen"
     next i
     Kontext "TabVariablen"
   TabVariablen.Close

  '/// Check if the insertion is correct
   Call wTypeKeys "<MOD1 Home>"

   for i = 0 to j
       Call wTypeKeys "<Shift Right>"
       if fGetFieldContent() <> sResult(i) then
           QaErrorLog i & "#i94596# - Should get " & sResult(i) & " but get " & fGetFieldContent()
       end if
       Call wTypeKeys "<Down><Home>"
   next i

  Call hCloseDocument

endcase

'-----------------------------------------------------------------

testcase tVariablesSetFormats
    qaerrorlog "#i94596# - tVariablesSetFormats outcommented due to bug."
    goto endsub

  Dim sName     as String
  Dim sValue    as String
  Dim iFormat() as Integer
  Dim sResult() as String
  Dim i         as Integer
  Dim j         as Integer
  Dim mUnit     as String

  sName   = "myTest"
  sValue  = "1234.567"
  
  iFormat = Array( 8,         10          , 52         , 55       , 56)
  sResult = Array( _
                   "123456.70%"  , _
                   "$1,234.57"   , _
                   "1.23E+003"   , _
                   "1234 55/97"  , _
                   "TRUE"        , _
                  )
  j = UBound(sResult)

  printlog "Set format as 'Additional formats...'"
 '/// <b> Set format as 'Additional formats...' </b>

  Call hNewDocument
  CALL GetLanguageText (01)
  mUnit = fSetMeasurementToCM()                 ' Set measurement unit to cm
  
  '/// Insert/Fields/Other/Variables / Select "set Variable" ,
  '/// Set Name and Value(number) , then choose format as 'Additional formats...'
  '/// In the number format dialog , select 'All' in Category
  '/// + Select some different formats ...
   Call fInsertFieldsOther("TabVariablen")
     Feldtyp.Select 1
     Sleep 1
     NameText.SetText sName
     Wert.SetText sValue

     for i = 0 to j
         Zahlenformat.Select Zahlenformat.GetItemCount
         Sleep 3
         Kontext "Zahlenformat"
           Sprache.Select fGetLanguageName(01)
           Sleep 2
           Kategorie.Select 1
           Sleep 1
           KategorieFormat.Select iFormat(i)
           Sleep 1
         Zahlenformat.OK

         Kontext "TabVariablen"
           Einfuegen.Click
           Call wTypeKeys "<Shift Left>"
           sleep 1
           if fGetFieldContent() <> sResult(i) then
	           Warnlog i & ": Should get " & sResult(i) & " but get " & fGetFieldContent()
           end if
         Kontext "TabVariablen"
     next i
   TabVariablen.Close

  Call hCloseDocument

endcase

'-----------------------------------------------------------------

testcase tVariablesShowVariable1

  Dim sName()   as String
  Dim sResult() as String
  Dim i         as Integer
  Dim j         as Integer

  sName   = Array( _
                   "myTest1" , _
                   "myTest2" , _
                   "myTest3" , _
                  )
  sResult = Array( _
                   "1"     , _
                   "10"    , _
                   "100"   , _
                  )
  j = UBound(sResult)

  printlog "Show Variable - 1"
 '/// <b> Show Variable - 2</b>

  Call hNewDocument

  '/// Insert/Fields/Other/Variables / Select "set Variable" ,
  '/// Set Name and Value , then choose General , add 3 variables
  '/// + then select Show Variable , insert 3 variables
   Call fInsertFieldsOther("TabVariablen")
     for i = 0 to j
         Feldtyp.Select 1
         Sleep 1
         NameText.SetText sName(i)
         Wert.SetText sResult(i)
         Zahlenformat.Select 2
         Einfuegen.Click
         sleep 1
     next i
     for i = 0 to j
         Call wTypeKeys "<Return>"
         Kontext "TabVariablen"
         Feldtyp.Select 2
         Sleep 1
         Auswahl.Select i+1
         Einfuegen.Click
         sleep 1
     next i
   TabVariablen.Close

  '/// Check if the insertion is correct
   Call wTypeKeys "<MOD1 Home>"

   for i = 0 to j
       Call wTypeKeys "<Down><Home>"
       Call wTypeKeys "<Shift Right>"
       if fGetFieldContent() <> sResult(i) then
           Warnlog "Should get " & sResult(i) & " but get " & fGetFieldContent()
       end if
   next i

  '/// Delete the 1st line
   Call wTypeKeys "<MOD1 Home><Shift End><Delete>"

   Call wTypeKeys "<MOD1 Home>"

   for i = 0 to j
       Call wTypeKeys "<Down><Home>"
       Call wTypeKeys "<Shift Right>"
       if fGetFieldContent() <> "0" then
           Warnlog i & "Should get 0 but get " & fGetFieldContent()
       end if
   next i

  Call hCloseDocument

endcase

'-----------------------------------------------------------------

testcase tVariablesShowVariable2

  Dim sName     as String
  Dim sValue    as String
  Dim sResult() as String
  Dim i         as Integer
  Dim j         as Integer

  sResult = Array( _
                   "100"   , _
                   "100"   , _
                   "200"   , _
                   "200"   , _
                     )
  j = UBound(sResult)

  sName = "myTest"

  printlog "Show Variable - 2"
 '/// <b> Show Variable - 2 </b>

  Call hNewDocument

  '/// Insert/Fields/Other/Variables / Select "set Variable" ,
  '/// Set Name and Value , then choose General , insert a variable
   Call fInsertFieldsOther("TabVariablen")
     sValue = "100"
     Feldtyp.Select 1
     Sleep 1
     NameText.SetText sName
     Wert.SetText sValue
     Zahlenformat.Select 2
     Einfuegen.Click

    '/// Then select Show Variable , insert this variable
     Call wTypeKeys "<Return>"
     Kontext "TabVariablen"
     Feldtyp.Select 2
     Sleep 1
     Auswahl.Select 1
     Einfuegen.Click

    '/// Insert a same name variable again , but set to another number
     Call wTypeKeys "<Return>"
     sValue = "200"
     Kontext "TabVariablen"
     Feldtyp.Select 1
     Sleep 1
     NameText.SetText sName
     Wert.SetText sValue
     Zahlenformat.Select 2
     Einfuegen.Click

    '/// Then select Show Variable , insert this variable again
     Call wTypeKeys "<Return>"
     Kontext "TabVariablen"
     Feldtyp.Select 2
     Sleep 1
     Auswahl.Select 1
     Einfuegen.Click
   TabVariablen.Close

  '/// Check if the insertion is correct
   Call wTypeKeys "<F9><MOD1 Home>"

   for i = 0 to j
       Call wTypeKeys "<Shift Right>"
       if fGetFieldContent() <> sResult(i) then
           Warnlog i & "Should get " & sResult(i) & " but get " & fGetFieldContent()
       end if
       Call wTypeKeys "<Down><Home>"
   next i

  Call hCloseDocument

endcase

'-----------------------------------------------------------------

testcase tVariablesInsertFormula

  Dim sName()   as String
  Dim sValue()  as String
  Dim sResult   as String
  Dim i         as Integer
  Dim j         as Integer

  sName   = Array( _
                   "myTest1" , _
                   "myTest2" , _
                  )
  sValue  = Array( _
                   "10"    , _
                   "100"   , _
                  )
  sResult = "110"
  j = UBound(sName)

  printlog "Insert formula"
 '/// <b> Insert formula </b>

  Call hNewDocument

  '/// Insert/Fields/Other/Variables / Select "set Variable" , add 2 variables - A and B
   Call fInsertFieldsOther("TabVariablen")
     for i = 0 to j
         Feldtyp.Select 1
         Sleep 1
         NameText.SetText sName(i)
         Wert.SetText sValue(i)
         Zahlenformat.Select 2
         Einfuegen.Click
         sleep 1
     next i

    '/// Then select 'Insert formula' , A+B
     Call wTypeKeys "<Return>"
     Kontext "TabVariablen"
       Feldtyp.Select 4
       Wert.SetText (sName(0) & "+" & sName(1))
       Einfuegen.Click
   TabVariablen.Close

   Call wTypeKeys "<Shift Left>"
   if fGetFieldContent() <> sResult then
       Warnlog "Should get " & sResult & " but get " & fGetFieldContent()
   end if

  Call hCloseDocument

endcase

'-----------------------------------------------------------------

testcase tVariablesNumberRange

  Dim sResult() as String
  Dim i         as Integer
  Dim x         as Integer

  printlog "Number range"
 '/// <b> Number range </b>

  Call hNewDocument

   Call wTypeKeys "<Return>"

  '/// Insert/Fields/Other/Variables / Select "Number range" , insert 4 numbers for
  '/// + Table , text , drawing and illustration
   Call fInsertFieldsOther("TabVariablen")
     for i = 1 to 4
         Feldtyp.Select 6
         Sleep 1
         Auswahl.Select i
         Einfuegen.Click
         Call wTypeKeys "<Return>"
         Kontext "TabVariablen"
         sleep 1
     next i

    '/// Then insert Table , text , drawing and illustration separately
    '/// + Check if the result is correct
     Call wTypeKeys "<MOD1 Home>"
     Kontext "TabVariablen"

     for i = 1 to 4
         Feldtyp.Select 6
         Sleep 1
         Auswahl.Select i
         Einfuegen.Click
         Sleep 2
         Call wTypeKeys "<Home>"
         sResult = Array("1" , "1" , "1" , "1" , "1")
         sResult(i) = "2"
         for x = 0 to 4
             Call wTypeKeys "<Shift Right>"
             if fGetFieldContent() <> sResult(x) then
                 Warnlog "Should get " & sResult(x) & " but get " & fGetFieldContent()
             end if
             Call wTypeKeys "<Down><Home>"
         next x
         Call wTypeKeys "<MOD1 Home><Shift End><Delete>"
         sleep 1
         Kontext "TabVariablen"
     next i
   TabVariablen.Close

  Call hCloseDocument

endcase

'-----------------------------------------------------------------

testcase tVariablesInputfield

  Dim sName         as String
  Dim sValue        as String
  Dim sReference    as String
  Dim sFieldContent as String

  sName = "myTest" : sValue = "100"
  sReference    = "NewTest"
  sFieldContent = "10000"

  printlog "Input field"
 '/// <b> Input field </b>

  Call hNewDocument

  '/// Insert/Fields/Other/Variables / Select "set Variable" , add 1 variable - A
   Call fInsertFieldsOther("TabVariablen")
     Feldtyp.Select 1
     Sleep 1
     NameText.SetText sName
     Wert.SetText sValue
     Zahlenformat.Select 2
     Einfuegen.Click
     Call wTypeKeys "<Return>"
     Sleep 1

  '/// Select "Input field" , set reference , press insert ,
  '/// + a dialog should pop up , insert field content
  '/// + Table , text , drawing and illustration
     Kontext "TabVariablen"
     Feldtyp.Select 5
     Wert.SetText sReference
     Einfuegen.Click
     Kontext "Eingabefeld"
       if Titel.GetText <> sReference then
           Warnlog "Reference should be " & sReference & " but get " & Titel.GetText
       end if
       EingabeText.SetText sFieldContent
     Eingabefeld.OK

     Kontext "TabVariablen"
   TabVariablen.Close

  '/// Check if the insertion is correct
     Call wTypeKeys "<MOD1 Home>"
     Call wTypeKeys "<Shift Right>"
     if fGetFieldContent() <> sValue then
         Warnlog "Should get " & sValue & " but get " & fGetFieldContent()
     end if

     Call wTypeKeys "<Down><Home>"
     Call wTypeKeys "<Shift Right>"
     if fGetFieldContent() <> sFieldContent then
         Warnlog "Should get " & sFieldContent & " but get " & fGetFieldContent()
     end if

  '/// Delete variable A in the document , Check if the insertion is still correct
     Call wTypeKeys "<MOD1 Home>"
     Call wTypeKeys "<Shift Right><Delete>"

     Call wTypeKeys "<Down><Home>"
     Call wTypeKeys "<Shift Right>"
     if fGetFieldContent() <> sFieldContent then
         Warnlog "2-Should get " & sFieldContent & " but get " & fGetFieldContent()
     end if

  Call hCloseDocument

endcase

'-----------------------------------------------------------------

testcase tVariablesUserfield

  Dim sName()    as String
  Dim sValue()   as String
  Dim sResult1() as String
  Dim sResult2() as String
  Dim i          as Integer
  Dim j          as Integer

  sName    = Array("U1" , "UserField" , "U2")
  sValue   = Array("UserField - 10" , "100" , "UserField + 10")
  sResult1 = Array("-10" , "100" , "110")
  sResult2 = Array("90"  , "100" , "110")
  j = UBound(sResult1)

  printlog "User field"
 '/// <b> User field </b>

  Call hNewDocument

  '/// Insert/Fields/Other/Variables / Select "User Field"
   Call fInsertFieldsOther("TabVariablen")
   for i = 0 to j
       Feldtyp.Select 9
       Sleep 1
       NameText.SetText sName(i)
       Wert.SetText sValue(i)
       Zahlenformat.Select 3
       Einfuegen.Click
       Sleep 2
       Call wTypeKeys "<Shift Left>"
       if fGetFieldContent() <> sResult1(i) then
           Warnlog "Should get " & sResult1(i) & " but get " & fGetFieldContent()
       end if
       Call wTypeKeys "<End><Return>"
       sleep 1
       Kontext "TabVariablen"
   next i
   TabVariablen.Close

  '/// Check if the result is OK.
   Call wTypeKeys "<F9>"
   Call wTypeKeys "<MOD1 Home>"
   Sleep 1
   for i = 0 to j
       Call wTypeKeys "<Shift Right>"
       if fGetFieldContent() <> sResult2(i) then
           Warnlog "Should get " & sResult2(i) & " but get " & fGetFieldContent()
       end if
       Call wTypeKeys "<Down><Left>"
   next i

   Call hCloseDocument

endcase

'-----------------------------------------------------------------

testcase tVariablesDDEFieldManual
    qaerrorlog "#i93906# - tVariablesDDEFieldManual outcommented due to a problem with copying field-contents outside the office."
    goto endsub

  Dim sDDEFile        as String
  Dim sContent        as String
  Dim sName           as String
  Dim sDDEStatement   as String
  Dim sSectionName    as String

  sDDEFile = Convertpath ( gNetzOfficePath + "dde_test.oxt")
  sContent = "DDE"
  sName    = "myTest"
  sSectionName  = "Section1"
  sDDEStatement = "soffice " & sDDEFile & " " & sSectionName

  printlog "DDE field - manual"
 '/// <b> DDE field - manual </b>

  if hFileExists ( sDDEFile ) then app.kill ( sDDEFile )

  Call hNewDocument

  '/// Input something , insert a section , then save it and close the file
   Call wTypeKeys sContent
   Call wTypeKeys "<Shift Home>"
   Call fInsertSection("TabBereiche")
     Bereichsliste.Settext sSectionName
   TabBereiche.OK
   Sleep 1
   Call hFileSaveAsKill(sDDEFile)
  Call hCloseDocument

  '/// Opan a new document
   Call hNewDocument

  '/// Insert/Fields/Other/Variables / Select "DDE Field"
  '/// Set DDE name and DDE statement , select "DDE manual"
   Call fInsertFieldsOther("TabVariablen")
     Feldtyp.Select 3
     Sleep 1
     NameText.SetText sName
     Wert.SetText     sDDEStatement
     Formatliste.Select 1
     Einfuegen.Click
     Sleep 2
   TabVariablen.Close
   Sleep 2

   Call wTypeKeys "<MOD1 Home>"
   Call wTypeKeys "<Shift End>"
   if fGetFieldContent() <> sContent then
       Warnlog "Should get " & sContent & " but get " & fGetFieldContent()
   end if

  '/// Open the test file which you just closed , add something ,
  '/// Save the file
   Call hFileOpen(sDDEFile)
    Call wTypeKeys "<MOD1 Home>"
    Call wTypeKeys "XYZ"
    FileSave
   Call hCloseDocument

  '/// Check if the content is changed -- Should NOT
   Sleep 2
   Call wTypeKeys "<F9>"
   Call wTypeKeys "<MOD1 Home><Shift End>"
   if fGetFieldContent() <> sContent then
       Warnlog "Should get " & sContent & " but get " & fGetFieldContent()
   end if

  '/// Edit/Fields , press update button
   EditFields
   Kontext "VerknuepfungenBearbeiten"
     Aktualisieren.Click
   VerknuepfungenBearbeiten.Close

  '/// Check if the content is changed -- Should NOT
   Sleep 1
   Call wTypeKeys "<F9>"
   Call wTypeKeys "<MOD1 Home><Shift End>"
   if fGetFieldContent() <> ("XYZ" & sContent) then
       Warnlog "Should get XYZ" & sContent & " but get " & fGetFieldContent()
   end if

  Call hCloseDocument

  if hFileExists ( sDDEFile ) then app.kill ( sDDEFile )

endcase

'-----------------------------------------------------------------

testcase tVariablesDDEFieldAutomatic
    qaerrorlog "#i102792# - tVariablesDDEFieldAutomatic outcommented. Fields not updated."
    goto endsub

  Dim sDDEFile      as String
  Dim sContent      as String
  Dim sName         as String
  Dim sDDEStatement as String
  Dim sSectionName  as String

  sDDEFile = Convertpath ( gNetzOfficePath + "dde_test.oxt")
  sContent = "DDE"
  sName    = "myTest"
  sSectionName  = "Section1"
  sDDEStatement = "soffice " & sDDEFile & " " & sSectionName

  printlog "DDE field - automatic"
 '/// <b> DDE field - automatic </b>

  if hFileExists ( sDDEFile ) then app.kill ( sDDEFile )

  Call hNewDocument

  '/// Input something , insert a section , then save it and close the file
   Call wTypeKeys sContent
   Call wTypeKeys "<Shift Home>"
   Call fInsertSection("TabBereiche")
     Bereichsliste.Settext sSectionName
   TabBereiche.OK
   Sleep 1
   Call hFileSaveAsKill(sDDEFile)
  Call hCloseDocument

  '/// Opan a new document
   Call hNewDocument

  '/// Insert/Fields/Other/Variables / Select "DDE Field"
  '/// Set DDE name and DDE statement , select "DDE automatic"
   Call fInsertFieldsOther("TabVariablen")
     Feldtyp.Select 3
     Sleep 1
     NameText.SetText sName
     Wert.SetText     sDDEStatement
     Formatliste.Select 2
     Einfuegen.Click
     Sleep 2
   TabVariablen.Close
   Sleep 2

   Call wTypeKeys "<MOD1 Home>"
   Call wTypeKeys "<Shift End>"
   if fGetFieldContent() <> sContent then
       Warnlog "Should get " & sContent & " but get " & fGetFieldContent()
   end if

  '/// Open the test file which you just closed , add something ,
  '/// Save the file
   Call hFileOpen(sDDEFile)
    Call wTypeKeys "<MOD1 Home>"
    Call wTypeKeys "XYZ"
    FileSave
   Call hCloseDocument

  '/// Check if the content is changed -- Should
   Sleep 2
   Call wTypeKeys "<F9>"
   Call wTypeKeys "<MOD1 Home><Shift End>"
   if fGetFieldContent() <> ("XYZ" & sContent) then
       Warnlog "Should get XYZ" & sContent & " but get " & fGetFieldContent()
   end if

  Call hCloseDocument

  if hFileExists ( sDDEFile ) then app.kill ( sDDEFile )

endcase

'-----------------------------------------------------------------