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
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
|
'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 : marc.neumann@oracle.com
'*
'* short description : Control Wizards Test
'*
'\***********************************************************************
global sDSName as String
global sFileName as String
sub ctrl_Wizards
printlog "---------------- Control Wizards -------------------"
sDSName = "TT"
app.FileCopy gTesttoolPath + ConvertPath("dbaccess/optional/input/hsql_datasource/TT_hsqldb.odb"),gOfficePath + ConvertPath("user/work/TT_hsqldb.odb")
call fRegisterDatabaseFile(gOfficePath + ConvertPath("user/work/TT_hsqldb.odb"),"TT")
call fSwitchAutopilotOff(false) ' has to run first to switch on the autopilot
call tGroupBoxWithDatasource
call tGroupBoxWithoutDatasource
call tListBox
call tComboBox
call tTableControl
call fDeRegisterDatabaseFile(sDSName)
end sub
'--------------------------------------------------------------------
testcase tGroupBoxWithDatasource
'/// open a new text document
printlog "open a new text document"
call hNewDocument
sleep(1)
'/// create a new form via the form navigator
printlog "create a new form via the form navigator"
call hToolbarSelect("FORMDESIGN",true)
Kontext "FormDesignTools"
ShowFmExplorer.Click
sleep(2)
Kontext "FormularNavigator"
Liste.TypeKeys "<SPACE>"
sleep(3)
Liste.OpenContextmenu
sleep(2)
hMenuSelectNr (1)
sleep(2)
hMenuSelectNr (1)
sleep(3)
Liste.TypeKeys "<RETURN>",true
sleep(3)
Liste.OpenContextmenu
sleep(2)
hMenuSelectNr (6)
sleep(4)
Kontext "ControlPropertiesTabControl"
ControlPropertiesTabControl.SetPage TabDataControl
Kontext "TabDataForm"
'/// set the datasource TT
printlog "set the datasource TT"
DataSource.setText(sDSName)
DataSource.TypeKeys "<RETURN>" , true
sleep(1)
'/// insert password 'testtool' into login dialog
printlog "insert password 'testtool' into login dialog"
Kontext "LoginDialog"
if LoginDialog.Exists then
LoginPassword.setText "testtool"
LoginDialog.OK
sleep(1)
else
printlog "Login dialog doesn't exists. Why?"
endif
Kontext "LoginDialog"
if LoginDialog.Exists then
LoginPassword.setText "testtool"
LoginDialog.OK
sleep(1)
else
printlog "Login dialog doesn't exists. Why?"
endif
Kontext "TabDataForm"
'/// set the table TT_Control
printlog "set the table TT_Control"
Content.setText("TT_Control")
Content.TypeKeys "<RETURN>" , true
sleep(1)
Kontext "ControlPropertiesDialog"
ControlPropertiesDialog.Close
sleep(3)
Kontext "FormularNavigator"
FormularNavigator.Close
sleep(4)
call hToolbarSelect("MoreControls",true)
Kontext "MoreControls"
'/// insert a groupbox (the wizard appears)
printlog "insert a groupbox (the wizard appears)"
Groupbox.Click
call hDrawingWithSelection ( 50, 20, 60, 30 )
sleep(10)
Dim i as integer
Kontext "AutopilotGroupElement"
AutopilotGroupElement.MouseDown (10,10)
AutopilotGroupElement.MouseUp (10,10)
'/// insert three fields with the names: red, green, blue & next
printlog "insert three fields with the names: red, green, blue & next"
Kontext "TabGroupBoxData"
Names.setText "red"
AddTo.Click
sleep(1)
Names.setText "green"
AddTo.Click
sleep(1)
Names.setText "blue"
AddTo.Click
sleep(1)
Kontext "AutopilotGroupElement"
if NextButton.IsEnabled then
NextButton.Click
else
warnlog "In first window the 'Next'-button is disabled!"
AutopilotGroupElement.Cancel
goto endsub
end if
printlog " - Autopilot group box: Page 2/5"
Kontext "TabDefaultFieldSelection"
'/// choose no default and click two times next
printlog "choose no default and click two times next"
NoSelected.check
Kontext "AutopilotGroupElement"
if NextButton.IsEnabled then
NextButton.Click
else
warnlog "In second window the 'Next'-button is disabled!!"
AutopilotGroupElement.Cancel
goto endsub
end if
sleep(1)
printlog " - Autopilot group box: Page 3/5"
Kontext "TabDatabaseValues"
' nothing
Kontext "AutopilotGroupElement"
if NextButton.IsEnabled then
NextButton.Click
else
warnlog "In third window the 'Next'-button is disabled!"
AutopilotGroupElement.Cancel
end if
sleep(3)
printlog " - Autopilot group box: Page 4/5"
'/// choose the database field Colors
printlog "choose the database field Colors"
'Kontext "TabDatabaseValues"
Kontext "TabDatabaseField" ' dbp:TabPage:RID_PAGE_OPTION_DBFIELD
YesSaveIt.check
Fieldbox.select 2
Kontext "AutopilotGroupElement"
if NextButton.IsEnabled then
NextButton.Click
else
warnlog "In fourth window the 'Next'-button is disabled!"
AutopilotGroupElement.Cancel
goto endsub
end if
sleep(1)
printlog " - Autopilot group box: Page 5/5"
Kontext "TabCreateOptionGroup"
' nothing
Kontext "AutopilotGroupElement"
if CreateButton.IsEnabled then
CreateButton.Click
else
warnlog "In fifth window the 'Create'-button is disabled!"
AutopilotGroupElement.Cancel
goto endsub
end if
sleep(1)
call hToolbarSelect("FORMDESIGN",true)
Kontext "FormDesignTools"
ShowFmExplorer.Click
sleep(3)
Kontext "FormularNavigator"
sleep(1)
'Liste.TypeKeys "<DOWN>" , true
sleep(1)
Liste.TypeKeys "<HOME>" , true
sleep(1)
Liste.TypeKeys "<DOWN>" , true
sleep(1)
Liste.TypeKeys "<DOWN>" , true
sleep(1)
Liste.TypeKeys "<DOWN>" , true
sleep(1)
Liste.OpenContextmenu
sleep(2)
hMenuSelectNr (5)
sleep(5)
Kontext "ControlPropertiesTabControl"
ControlPropertiesTabControl.setPage TabGeneralControl
Kontext "TabGeneralControl"
TabGeneralControl.TypeKeys "<TAB>" , true 'this tab is importent, I don't not why but it is.
sleep(1)
HelpURL.setText "HID:123456"
HelpURL.TypeKeys "<RETURN>",true
sleep(1)
Kontext "ControlPropertiesDialog"
ControlPropertiesDialog.close
'open and close the formnavigator to get the focus
call hToolbarSelect("FORMDESIGN",true)
Kontext "FormDesignTools"
ShowFmExplorer.Click
sleep(2)
Kontext "FormDesignTools"
ShowFmExplorer.Click
sleep(2)
Kontext "FormularNavigator"
'Liste.TypeKeys "<DOWN>" , true ' this is needed , I don't know why
sleep(1)
Liste.TypeKeys "<HOME>" , true
sleep(1)
Liste.TypeKeys "<DOWN>" , true
sleep(1)
Liste.TypeKeys "<DOWN>" , true
sleep(1)
Liste.TypeKeys "<DOWN>" , true
sleep(1)
Liste.TypeKeys "<DOWN>" , true
sleep(1)
Liste.OpenContextmenu
sleep(2)
hMenuSelectNr (5)
sleep(5)
Kontext "TabGeneralControl"
TabGeneralControl.TypeKeys "<TAB>" , true 'this tab is importent, I don't not why but it is.
sleep(1)
HelpURL.setText "HID:1234567"
HelpURL.TypeKeys "<RETURN>", true
sleep(1)
Kontext "ControlPropertiesDialog"
ControlPropertiesDialog.close
'open and close the frmnavigator to get the focus
call hToolbarSelect("FORMDESIGN",true)
Kontext "FormDesignTools"
ShowFmExplorer.Click
sleep(2)
Kontext "FormDesignTools"
ShowFmExplorer.Click
sleep(2)
Kontext "FormularNavigator"
'Liste.TypeKeys "<DOWN>" , true ' this is needed , I don't know why
sleep(1)
Liste.TypeKeys "<HOME>" , true
sleep(1)
Liste.TypeKeys "<DOWN>" , true
sleep(1)
Liste.TypeKeys "<DOWN>" , true
sleep(1)
Liste.TypeKeys "<DOWN>" , true
sleep(1)
Liste.TypeKeys "<DOWN>" , true
sleep(1)
Liste.TypeKeys "<DOWN>" , true
sleep(1)
Liste.OpenContextmenu
sleep(2)
hMenuSelectNr (5)
sleep(5)
Kontext "TabGeneralControl"
TabGeneralControl.TypeKeys "<TAB>" , true ' this tab is importent, I don't not why but it is.
HelpURL.setText "HID:12345678"
HelpURL.TypeKeys "<RETURN>", true
sleep(1)
Kontext "ControlPropertiesDialog"
ControlPropertiesDialog.close
'/// save the document
printlog "save the document"
hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_AP_GroupBox.odt"))
hCloseDocument
sleep(1)
'/// reload the document
printlog "reload the document"
hFileOpen ( gOfficePath + ConvertPath("user/work/TT_AP_GroupBox.odt"))
'/// check if the options buttons work right
printlog "check if the options buttons work right"
dim a as boolean
dim b as boolean
dim c as boolean
Kontext "MSC_Special_Dialog"
a = MSC_Special_Dialog.ischecked
Kontext "MSC_Special_Dialog2"
b = MSC_Special_Dialog2.ischecked
Kontext "MSC_Special_Dialog3"
c = MSC_Special_Dialog3.ischecked
if not a AND not b AND c then
printlog "ok"
else
warnlog "the third option isn't checked"
endif
printlog "next record"
FM_Next_Record
sleep(1)
Kontext "MSC_Special_Dialog"
a = MSC_Special_Dialog.ischecked
Kontext "MSC_Special_Dialog2"
b = MSC_Special_Dialog2.ischecked
Kontext "MSC_Special_Dialog3"
c = MSC_Special_Dialog3.ischecked
if not a AND b AND not c then
'nothing
else
warnlog "the second option isn't checked"
endif
printlog "next record"
FM_Next_Record
sleep(1)
Kontext "MSC_Special_Dialog"
a = MSC_Special_Dialog.ischecked
Kontext "MSC_Special_Dialog2"
b = MSC_Special_Dialog2.ischecked
Kontext "MSC_Special_Dialog3"
c = MSC_Special_Dialog3.ischecked
if a AND not b AND not c then
'nothing
else
warnlog "the first option isn't checked"
endif
sleep(1)
call hCloseDocument
endcase
'--------------------------------------------------------------------
testcase tGroupBoxWithoutDatasource
'/// open a textdocument
printlog "open a textdocument"
call hNewDocument
sleep(1)
call hToolbarSelect("MoreControls",true)
Kontext "MoreControls"
'/// insert a groupbox (the wizard appears)
printlog "insert a groupbox (the wizard appears)"
Groupbox.Click
call hDrawingWithSelection ( 50, 20, 60, 30 )
sleep(2)
Dim i as integer
Kontext "AutopilotGroupElement"
AutopilotGroupElement.MouseDown (10,10)
AutopilotGroupElement.MouseUp (10,10)
sleep (1)
if AutopilotGroupElement.Exists(3) then
printlog " - Autopilot group element: Page 1/4"
'/// insert 6 diffent options
printlog "insert 6 diffent options"
Kontext "TabGroupBoxData"
for i = 1 to 6
Names.Settext "Option field " + i
if AddTo.IsEnabled then
AddTo.Click
else
warnlog "Entry couldn't be overtaken in first window of the group box autopilot!"
AutopilotGroupElement.Cancel
end if
next
Kontext "AutopilotGroupElement"
if NextButton.IsEnabled then
NextButton.Click
else
warnlog "In first window the 'Next'-button is disabled!"
AutopilotGroupElement.Cancel
end if
sleep(3)
printlog " - Autopilot group box: Page 2/4"
Kontext "TabDefaultFieldSelection"
sleep (1)
'/// set Option Field 3 as default selection
printlog "set Option Field 3 as default selection"
YesFollowing.Check
Selection.Select "Option field 3"
Kontext "AutopilotGroupElement"
if NextButton.IsEnabled then
NextButton.Click
else
warnlog "In second window the 'Next'-button is disabled!!"
AutopilotGroupElement.Cancel
end if
sleep(3)
printlog " - Autopilot group box: Page 3/4"
Kontext "TabDatabaseValues"
dim iCountOptionFields
iCountOptionFields = OptionFields.getitemCount
if iCountOptionFields <> 6 then
warnlog "there are not 6 options."
AutopilotGroupElement.Cancel
goto endsub
end if
'/// set some new reference for the options fields
printlog "set some new reference for the options fields"
OptionFields.select 1
WhichValue.setText "a"
OptionFields.select 2
WhichValue.setText "b"
OptionFields.select 3
WhichValue.setText "c"
OptionFields.select 4
WhichValue.setText "d"
OptionFields.select 5
WhichValue.setText "e"
OptionFields.select 6
WhichValue.setText "f"
Kontext "AutopilotGroupElement"
if NextButton.IsEnabled then
NextButton.Click
else
warnlog "In third window the 'Next'-button is disabled!"
AutopilotGroupElement.Cancel
end if
sleep(3)
printlog " - Autopilot group box: Page 4/4"
'/// change the goup name to Group 123
printlog "change the goup name to Group 123"
Kontext "TabCreateOptionGroup"
GroupCaption.setText "Group 123"
Kontext "AutopilotGroupElement"
if CreateButton.IsEnabled then
CreateButton.Click
else
warnlog "In fourth window the 'Create'-button is disabled!"
AutopilotGroupElement.Cancel
end if
else
warnlog "- Autopilot for Group Box didn't appear!"
end if
sleep(2)
'/// save the document
hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_AP_GroupBox2.odt"))
hCloseDocument
sleep(1)
'/// reload the document
printlog "reload the document"
hFileOpen ( gOfficePath + ConvertPath("user/work/TT_AP_GroupBox2.odt"))
call hToolbarSelect("FormControls",true)
sleep(1)
Kontext "FormControls"
SwitchControlDesignMode.Click
sleep(1)
call hToolbarSelect("FormDesignTools",true)
Kontext "FormDesignTools"
ShowFmExplorer.Click
sleep(1)
Kontext "FormularNavigator"
Liste.TypeKeys "<HOME>"
Liste.TypeKeys "<DOWN>"
Liste.TypeKeys "<DOWN>"
sleep (2)
Liste.OpenContextmenu
sleep(1)
try
hMenuSelectNr (5)
catch
printlog "Control property browser already open."
endcatch
sleep (2)
Kontext "ControlPropertiesTabControl"
ControlPropertiesTabControl.SetPage TabGeneralControl
sleep (2)
Kontext "TabGeneralControl"
if Label.getText() <> "Group 123" then
warnlog "The label of the groupbox is not right." + getClipboard
end if
sleep (2)
Kontext "FormularNavigator"
Liste.TypeKeys "<DOWN>"
sleep (2)
if fgetControlproperty("RadioButton","DefaultState") <> "1" then
warnlog "The default state is set to not selected"
end if
sleep 1
Kontext "FormularNavigator"
Liste.TypeKeys "<DOWN>"
Liste.TypeKeys "<DOWN>"
sleep (2)
if fgetControlproperty("RadioButton","DefaultState") <> "2" then
warnlog "The default state is set to not selected"
end if
if fgetControlproperty("RadioButton","ReferenceValue") <> "c" then
warnlog "The reference value is not right, it have to be c but it is " + ReferenceValue.getText
end if
sleep(2)
call hCloseDocument
endcase
'--------------------------------------------------------------------
testcase tListBox
Dim j as integer
Dim k as integer
dim i as integer
printlog "- Formular toolbox: List box element (" & gApplication & ")"
'/// open a text, insert a listbox (the wizard appears)
call hNewDocument
sleep(1)
call hToolbarSelect("FormControls",true)
Kontext "FormControls"
Listbox.Click
call hDrawingWithSelection ( 50, 20, 60, 25 )
sleep(3)
Kontext "AutoPilotListComboBox"
AutoPilotListComboBox.MouseDown(10,10)
AutoPilotListComboBox.MouseUp(10,10)
if AutoPilotListComboBox.Exists(1) then
printlog " - Autopilot List/Combo Box: Page 1/4"
Kontext "TabListBoxData"
'/// choose database TT & click next
DataSource.Select(sDSName)
Kontext "LoginDialog"
if LoginDialog.Exists(3) then
printlog "login dialog"
LoginPassword.SetText "testtool"
LoginDialog.OK
sleep 1
end if
'/// choose table TPCoA-1 & click next
Kontext "TabListBoxData"
Table.Select("TT_Control")
sleep(1)
Kontext "AutopilotListComboBox"
if NextButton.IsEnabled then
NextButton.Click
else
warnlog "In first window the 'Next'-button is disabled!"
AutopilotListComboBox.Cancel
end if
sleep(1)
printlog " - Autopilot List/Combo Box: Page 2/4"
Kontext "TabTableSelection"
TableSelection.Select("TT_Control")
sleep(1)
Kontext "AutopilotListComboBox"
if NextButton.IsEnabled then
NextButton.Click
else
warnlog "In second window the 'Next'-button is disabled!!"
AutopilotListComboBox.Cancel
goto endsub
end if
sleep(1)
printlog " - Autopilot List/Combo Box: Page 3/4"
Kontext "TabFieldSelection"
'/// choose InfoColor as displayed field & click next
ExistingFields.Select("InfoColor")
sleep(3)
Kontext "AutopilotListComboBox"
if NextButton.IsEnabled then
NextButton.Click
else
warnlog "In third window the 'Next'-button is disabled!"
AutopilotListComboBox.Cancel
end if
sleep(1)
printlog " - Autopilot List/Combo Box: Page 4/4"
Kontext "TabFieldLink"
'/// take Colors as value field, ID as list field & click create
ValueTable.Select("Colors")
sleep(1)
ListTable.Select("ID")
sleep(1)
Kontext "AutopilotListComboBox"
if CreateButton.IsEnabled then
CreateButton.Click
else
warnlog "In fourth window the 'Create'-button is disabled!"
AutopilotListComboBox.Cancel
end if
else
warnlog "The Autopilot doesn't start!"
end if
sleep(1)
Kontext "FormControls"
ControlProperties.Click
sleep(1)
'/// check if the list box is in dropdown style
if fGetControlProperty("ListBox","DropDown") <> "2" then
warnlog "The dropdown style is not active."
endif
sleep(1)
fSetControlProperty("ListBox","HelpURL","HID:123456")
sleep(1)
'/// save the document
printlog "save the document"
hFileSaveAsKill ( gOfficePath + ConvertPath("user/work/TT_AP_ListBox.odt"))
hCloseDocument
sleep(1)
'/// reload the document
printlog "reload the document"
hFileOpen ( gOfficePath + ConvertPath("user/work/TT_AP_ListBox.odt"))
'/// open the listbox, and ccheck the list entries
Kontext "MSC_Special_Dialog"
dim ii as integer
ii = MSC_Special_Dialog.GetItemCount
dim stext as string
for i = 1 to ii
MSC_Special_Dialog.Select (i)
wait 500
sText = MSC_Special_Dialog.GetSelText
select case i
case 1
if sText <> "" then
warnlog "The 1. entry is not empty"
endif
case 2
if sText <> "red = 1" then
warnlog "The 2. entry is not red = 1"
endif
case 3
if sText <> "green = 2" then
warnlog "The 3. entry is not green = 2"
endif
case 4
if sText <> "blue = 3" then
warnlog "The 4. entry is not blue = 3"
endif
end select
next
sleep 1
hCloseDocument
endcase
'--------------------------------------------------------------------
testcase tComboBox
Dim k as integer
printlog "- Formular toolbox: List box element (" & gApplication & ")"
'/// open new text document
call hNewDocument
sleep(1)
call hToolbarSelect("FormControls",true)
'/// insert a new combo box
Kontext "FormControls"
Combobox.Click
call hDrawingWithSelection ( 50, 20, 60, 30 )
sleep(10)
Kontext "AutoPilotListComboBox"
AutoPilotListComboBox.MouseDown (10,10)
AutoPilotListComboBox.MouseUp (10,10)
if AutoPilotListComboBox.Exists(3) then
printlog " - Autopilot List/Combo Box: Page 1/4"
Kontext "TabListBoxData"
DataSource.Select(sDSName)
Table.Select("TT_Control")
Kontext "AutopilotListComboBox"
if NextButton.IsEnabled then
NextButton.Click
else
warnlog "In first window the 'Next'-button is disabled!"
AutopilotListComboBox.Cancel
goto endsub
end if
sleep(3)
printlog " - Autopilot List/Combo Box: Page 2/4"
Kontext "TabTableSelection"
TableSelection.Select("TT_Control")
sleep(3)
Kontext "AutopilotListComboBox"
if NextButton.IsEnabled then
NextButton.Click
else
warnlog "In second window the 'Next'-button is disabled!!"
AutopilotListComboBox.Cancel
goto endsub
end if
sleep(3)
printlog " - Autopilot List/Combo Box: Page 3/4"
Kontext "TabFieldSelection"
ExistingFields.Select(1)
sleep(3)
Kontext "AutopilotListComboBox"
if NextButton.IsEnabled then
NextButton.Click
else
warnlog "In third window the 'Next'-button is disabled!"
AutopilotListComboBox.Cancel
goto endsub
end if
sleep(3)
printlog " - Autopilot List/Combo Box: Page 4/4"
Kontext "TabDatabaseField"
sleep(3)
Kontext "AutopilotListComboBox"
if CreateButton.IsEnabled then
CreateButton.Click
else
warnlog "In fourth window the 'Create'-button is disabled!"
AutopilotListComboBox.Cancel
goto endsub
end if
else
warnlog "- Autopilot for Combo Box didn't appear!"
end if
sleep(2)
call hCloseDocument
endcase
'--------------------------------------------------------------------
testcase tTableControl
printlog "- Formular toolbox: Tablecontrol element (" & gApplication & ")"
'/// open a new textdocument & insert a table control
call hNewDocument
sleep(1)
call hToolbarSelect("MoreControls",true)
Kontext "MoreControls"
Grid.Click
call hDrawingWithSelection ( 40, 20, 60, 40 )
sleep(10)
'/// take as datasource table biblio, mark it & next
'/// select some fields (in both directions) & create
'/// switch off the design view & open the database beamer (TODO)
'/// compare the header & the contents with the table control (TODO)
Dim k as integer
Kontext "AutopilotTableElement"
AutopilotTableElement.MouseDown (10,10)
AutopilotTableElement.MouseUp (10,10)
if AutopilotTableElement.Exists(3) then
printlog " - Autopilot Table Element: Page 1/2"
Kontext "TabListBoxData"
DataSource.Select(sDSName)
sleep (1)
Kontext "LoginDialog"
if LoginDialog.Exists(3) then
printlog "login dialog"
LoginPassword.SetText "testtool"
LoginDialog.OK
sleep (1)
end if
sleep (1)
Kontext "TabListBoxData"
Table.Select("TT_Control")
sleep(3)
Kontext "AutopilotTableElement"
if NextButton.IsEnabled then
NextButton.Click
else
warnlog "In first window the 'Next'-button is disabled!"
AutopilotTableElement.Cancel
end if
sleep(1)
printlog " - Autopilot Table Element: Page 2/2"
Kontext "TabTableFieldSelection"
ExistingFields.Select("ID")
AddTo.Click
ExistingFields.Select("Colors")
AddTo.Click
ExistingFields.Select("InfoColor")
AddTo.Click
sleep(1)
Kontext "AutopilotTableElement"
if CreateButton.IsEnabled then
CreateButton.Click
else
warnlog "In fourth window the 'Create'-button is disabled!"
AutopilotTableElement.Cancel
end if
else
warnlog "- Autopilot for Table Element didn't appear!"
end if
sleep(2)
hCloseDocument
endcase
'-------------------------------------------------------------------------
|