-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNewWebClass.qfl
1081 lines (1016 loc) · 92.2 KB
/
NewWebClass.qfl
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
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Public strRepPath, objFound, intContext
strRepPath = "Z:\TMD\TMD_OR\TMD_OR.tsr"
objFound = ""
'----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Class c_WebObject
'------------------------------------------------------------------
Private Sub Class_Initialize()
Dim blnAlreadyInit
On Error Resume Next
blnAlreadyInit = IsObject(Environment("OR"))
If Err.Number <> 0 Then blnAlreadyInit = False
On Error Goto 0
If blnAlreadyInit = True Then
If Environment("OR") Is Nothing Then
blnAlreadyInit = False
End If
End If
If blnAlreadyInit = False Then
Environment("OR") = CreateObject("Mercury.ObjectRepositoryUtil")
LoadOR
End If
End Sub
'------------------------------------------------------------------
Private Sub LoadOR()
Dim strORPath
strORPath = PathFinder.Locate(strRepPath)
Environment("OR").Load(strORPath)
End Sub
'------------------------------------------------------------------
Private Function g_GetChildObjects (ByVal node, ByRef str, ByVal parent, ByVal LogicalName, ByVal strClassName)
Dim children
Dim strTemp
Dim icount
icount = 0
Set children = Environment("OR").GetChildren(node)
If children.Count <> 0 Then
For i = children.Count -1 To 0 Step -1
If Environment("OR").GetLogicalName(children.Item(i)) = LogicalName Then
If children.Item(i).GetToProperty("Class Name") = strClassName Then
str = parent & "." & children.Item(i).GetToProperty("Class Name") & "(""" & Environment("OR").GetLogicalName(children.Item(i)) & """)"
Set children = Nothing
strTemp = Right (str, Len(str) -1)
If objFound = "" Then
Execute "Set thisObj = " & strTemp
If thisObj.Exist(1) Then
Do While thisObj.GetROProperty("disabled") <> 0
Wait 1
icount = icount + 1
If icount > 30 Then
Reporter.ReportEvent micFail, "Object Disabled", "Found [" & strClassName & "] object with name [" & LogicalName & "] but it has been disabled for more than 30 seconds. Cannot continue, please check application."
ExitTest
End If
Loop
objFound = thisObj.ToString
objFound = strTemp
End If
End If
Exit Function
End If
End If
Next
For i = children.Count -1 To 0 Step -1
If objFound <> "" Then Exit Function
parentStr = parent & "." & children.Item(i).GetToProperty("Class Name") & "(""" & Environment("OR").GetLogicalName(children.Item(i)) & """)"
g_GetChildObjects children.Item(i), str, parentStr, LogicalName, strClassName
Next
End If
End Function
'------------------------------------------------------------------
Function g_GetChildObjects_Orig (ByVal node, ByRef str, ByVal parent, ByVal LogicalName)
Dim children, i, parentStr, found
Set children = Environment("OR").GetChildren(node)
If children.Count <> 0 Then
For i = children.Count -1 To 0 Step -1
If Environment("OR").GetLogicalName(children.Item(i)) = LogicalName Then
str = parent & "." & children.Item(i).GetToProperty("Class Name") & "(""" & Environment("OR").GetLogicalName(children.Item(i)) & """)"
Set children = Nothing
Exit Function
End If
Next
For i = children.Count -1 To 0 Step -1
parentStr = parent & "."& children.Item(i).GetToProperty("Class Name") & "(""" & Environment("OR").GetLogicalName(children.Item(i)) & """)"
g_GetChildObjects_Orig children.Item(i), str, parentStr, LogicalName
Next
End If
End Function
'------------------------------------------------------------------
Public Function DoesObjectExist(strObjName, strObjType, iTimeout)
Dim blnWait
Dim iCount
' Reset the global objFound variable
objFound = ""
iCount = 0
Do
strL = ""
g_GetChildObjects Null, strL, "", strObjName, strObjType
If objFound <> "" Then
DoesObjectExist = True
Exit Function
Else
Wait 1
iCount = iCount +1
End If
Loop Until iCount > iTimeout
' Return a false if we get here
DoesObjectExist = False
End Function
'------------------------------------------------------------------
Public Function ReturnObject(strObjName, strObjType)
' Reset the global objFound variable
objFound = ""
If DoesObjectExist(strObjName, strObjType, 5) = False Then
Reporter.ReportEvent micFail, "Automation Error - [Return Object]", "The object [" & strObjName & "] of object type [" & strObjType & "] could not be found, please check."
ExitTest
End If
Execute "Set thisObj = " & objFound
Set ReturnObject = thisObj.Object
End Function
'------------------------------------------------------------------
Public Function GetROProp(strObjName, strObjType, strProperty)
' Reset the global objFound variable
objFound = ""
If DoesObjectExist(strObjName, strObjType, 5) = False Then
Reporter.ReportEvent micFail, "Automation Error - [Get Object Property]", "The object [" & strObjName & "] of object type [" & strObjType & "] could not be found, please check."
ExitTest
End If
Execute "Set thisObj = " & objFound
GetROProp = thisObj.GetROProperty(strProperty)
End Function
'------------------------------------------------------------------
Public Function SetObject(strObjName, strObjType)
' Reset the global objFound variable
objFound = ""
If DoesObjectExist(strObjName, strObjType, 5) = False Then
Reporter.ReportEvent micFail, "Automation Error - [Set Object]", "The object [" & strObjName & "] of object type [" & strObjType & "] could not be found, please check."
ExitTest
Else
Execute "Set SetObject = " & objFound
End If
End Function
'------------------------------------------------------------------
Public Function ObjectWait(strObjName, strObjType, strProperty, strWaitValue, iWaittime)
' Reset the global objFound variable
objFound = ""
If DoesObjectExist(strObjName, strObjType, 5) = False Then
Reporter.ReportEvent micFail, "Automation Error - [Object Wait]", "The object [" & strObjName & "] of object type [" & strObjType & "] could not be found, please check."
ExitTest
End If
Execute "Set thisObj = " & objFound
ObjectWait = thisObj.WaitProperty(strProperty, strWaitValue, iWaittime)
End Function
'------------------------------------------------------------------
Public Sub SetTOProp(strObjName, strObjType, strProperty, strValue)
' Reset the global objFound variable
objFound = ""
GetObjectLogicalName strObjName
If objFound = "" Then
Reporter.ReportEvent micFail, "Automation Error - [Set TO Prop]", "The object [" & strObjName & "] of object type [" & strObjType & "] could not be found, please check."
ExitTest
End If
Execute "Set thisObj = " & objFound
thisObj.SetTOProperty strProperty, strValue
End Sub
'------------------------------------------------------------------
Public Sub FireEvent(strObjName, strObjType, strEvent)
' Reset the global objFound variable
objFound = ""
If DoesObjectExist(strObjName, strObjType, 5) = False Then
Reporter.ReportEvent micFail, "Automation Error - [Fire Event]", "The object [" & strObjName & "] of object type [" & strObjType & "] could not be found, please check."
ExitTest
End If
Execute "Set thisObj = " & objFound
thisObj.FireEvent strEvent
End Sub
'------------------------------------------------------------------
Public Sub HighlightObject(strObjName, strObjType)
' Reset the global objFound variable
objFound = ""
If DoesObjectExist(strObjName, strObjType, 5) = False Then
Reporter.ReportEvent micFail, "Automation Error - [HighlightObject]", "The object [" & strObjName & "] of object type [" & strObjType & "] could not be found, please check."
Exit Sub
End If
Execute "Set thisObj = " & objFound
thisObj.Highlight
Set thisObj = Nothing
End Sub
'------------------------------------------------------------------
Public Sub ObjectInit(strObjName, strObjType)
' Reset the global objFound variable
objFound = ""
If DoesObjectExist(strObjName, strObjType, 5) = False Then
Reporter.ReportEvent micFail, "Automation Error - [HighlightObject]", "The object [" & strObjName & "] of object type [" & strObjType & "] could not be found, please check."
Exit Sub
End If
Execute "Set thisObj = " & objFound
thisObj.Init
Set thisObj = Nothing
End Sub
'------------------------------------------------------------------
Public Function DPObject(strObjDesc, strObjType)
Dim objDesc, objFrameDesc, objFrames, objFrame, objCollection
Dim blnFound
Set objFrameDesc = Description.Create()
objFrameDesc("micclass").Value = "Frame"
Set objDesc = Description.Create()
Select Case strObjType
Case "WebList"
objDesc("micclass").Value = "WebList"
objDesc("html tag").Value = "SELECT"
Case "WebEdit"
objDesc("micclass").Value = "WebEdit"
objDesc("html tag").Value = "INPUT"
Case "WebButton"
objDesc("micclass").Value = "WebButton"
objDesc("html tag").Value = "BUTTON"
Case "WebCheckBox"
objDesc("micclass").Value = "WebCheckBox"
objDesc("html tag").Value = "INPUT"
Case "WebRadioGroup"
objDesc("micclass").Value = "WebRadioGroup"
objDesc("html tag").Value = "INPUT"
Case "WebLink"
objDesc("micclass").Value = "Link"
objDesc("html tag").Value = "A"
Case "WebFile"
objDesc("micclass").Value = "WebFile"
objDesc("html tag").Value = "INPUT"
Case "WebTable"
objDesc("micclass").Value = "WebTable"
objDesc("html tag").Value = "TABLE"
Case "WebElement"
objDesc("micclass").Value = "WebElement"
End Select
' Split the string by the | chars
arrSplit = Split(strObjDesc, "|")
For Each First In arrSplit
' Now Split key value pairs
arrKeys = Split(First, ":=")
' Add key/value pairs to description object
objDesc(arrKeys(0)).Value = arrKeys(1)
Next
' Get all the frames on screen
Set objFrames = Browser("creationtime:=0").Page("micclass:=Page").ChildObjects(objFrameDesc)
For i = 0 To objFrames.Count -1
Set objFrame = objFrames.Item(i)
Set objCollection = objFrame.ChildObjects(objDesc)
If objCollection.Count > 0 Then
For j = 0 To objCollection.Count -1
Set thisObj = objCollection.Item(j)
If thisObj.Exist(1) Then
Set DPObject = thisObj
Exit Function
Else
blnFound = False
End If
Next
End If
Next
If blnFound = False Then
Reporter.ReportEvent micFail, "DP Object Not Found", "The DP Object with descriptive properties of [" & strObjDesc & "] of object type [" & strObjType & "] could not be found. Please check your descriptive properties. Aborting..."
ExitTest
End If
End Function
'------------------------------------------------------------------
Private Sub Class_Terminate
Environment("OR") = Nothing
End Sub
End Class
'--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------'
'--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------'
Class clsWebList
Private m_WebObject
Private Sub Class_Initialize
Set m_WebObject = New c_WebObject
End Sub
Private Sub Class_Terminate
Set thisObj = Nothing
Set m_WebObject = Nothing
End Sub
'---------------------------------------------------------------------------
Public Sub SingleSelect(strObjName, strSelection)
Dim objfocus, thisObj
Dim blnFound
Dim rd
' See if the object name is really a DP description
If Instr(1, strObjName, ":=") Then
Set thisObj = m_WebObject.DPObject(strObjName, "WebList")
Else
If m_WebObject.DoesObjectExist(strObjName, "WebList", 15) = False Then
Reporter.ReportEvent micFail, "WebList Select", "The WebList object [" & strObjName & "] could not be found. Aborting..."
ExitTest
Else
Execute "Set thisObj = " & objFound
End If
End If
If thisObj.GetROProperty("items count") = 1 Then
thisObj.FireEvent "onclick"
Wait(1)
If thisObj.GetROProperty("items count") = 1 Then
thisObj.FireEvent "onclick"
End If
Wait(2)
End If
If Left(strSelection, 1) <> "#" Then
For i = 1 To thisObj.GetROProperty("items count")
rd = thisObj.GetItem(i)
' See if this matches our value
If Instr(1, UCase(rd), UCase(strSelection)) Then
If Len(rd) > Len(strSelection) Then
blnFound = False
Else
blnFound = True
Exit For
End If
Else
blnFound = False
End If
Next
If blnFound = True Then
Set objfocus = thisObj.object
objfocus.focus
thisObj.Select "#" & i - 1
thisObj.Init
Else
Reporter.ReportEvent micFail, "WebList Select", "WebList [" & strObjName & "] found but selection value [" & strSelection & "] not found in list. Please check input data and application. Aborting..."
ExitTest
End If
Else
On Error Resume Next
Set objfocus = thisObj.object
objfocus.focus
On Error GoTo 0
thisObj.Select strSelection
thisObj.Init
End If
End Sub
'---------------------------------------------------------------------------
Public Sub MultiSelect(strObjName, strSelection)
' Run the base class code to see if object exists
If m_WebObject.DoesObjectExist(strObjName, "WebList", 15) = False Then
Reporter.ReportEvent micFail, "WebList Select", "The WebList object [" & strObjName & "] could not be found. Aborting..."
ExitTest
End If
' Make a reference to the object found
Execute "Set thisObj = " & objFound
' See if our selection is just one item or many separated by the pipe | char
If Instr(1, strSelection, "|") Then
arrSplit = Split(strSelection, "|")
For Each Ele In arrSplit
On Error Resume Next
thisObj.ExtendSelect Ele
thisObj.Init
If Err.Number <> 0 Then
Reporter.ReportEvent micFail, "WebList Multi-Select", "The WebList object [" & strObjName & "] was found but the option [" & Ele & "] could not be found in the list. Aborting..."
ExitTest
End If
On Error GoTo 0
Next
Else
On Error Resume Next
thisObj.ExtendSelect strSelection
thisObj.Init
If Err.Number <> 0 Then
Reporter.ReportEvent micFail, "WebList Multi-Select", "The WebList object [" & strObjName & "] was found but the option [" & strSelection & "] could not be found in the list. Aborting..."
ExitTest
End If
On Error GoTo 0
End If
End Sub
'---------------------------------------------------------------------------
Public Function GetROProperty(strObjName, strProperty)
GetROProperty = m_WebObject.GetROProp(strObjName, "WebList", strProperty)
End Function
'---------------------------------------------------------------------------
Public Function GetTOProperty(strObjName, strProperty)
GetTOProperty = m_WebObject.GetTOProp(strObjName, "WebList", strProperty)
End Function
'---------------------------------------------------------------------------
Public Function SetTOProperty(strObjName, strProperty, strValue)
SetTOProperty = m_WebObject.SetTOProp(strObjName, "WebList", strProperty, strValue)
End Function
'---------------------------------------------------------------------------
Public Function Click(strObjName)
' Run the base class code to see if object exists
If m_WebObject.DoesObjectExist(strObjName, "WebList", 15) = False Then
Reporter.ReportEvent micFail, "WebList Select", "The WebList object [" & strObjName & "] could not be found. Aborting..."
ExitTest
End If
' Make a reference to the object found
Execute "Set thisObj = " & objFound
Click = thisObj.Click
thisObj.Init
End Function
'---------------------------------------------------------------------------
Public Function ReturnObject(strObjName)
ReturnObject = m_WebObject.ReturnObject(strObjName, "WebList")
End Function
'---------------------------------------------------------------------------
Public Sub SetObject(strObjName)
m_WebObject.SetObject strObjName, "WebList"
End Sub
'---------------------------------------------------------------------------
Public Sub FireEvent(strObjName, strEvent)
m_WebObject.FireEvent strObjName, "WebList", strEvent
End Sub
'---------------------------------------------------------------------------
Public Sub Highlight(strObjName)
m_WebObject.HighlightObject strObjName, "WebList"
End Sub
'---------------------------------------------------------------------------
Public Sub Init(strObjName)
m_WebObject.ObjectInit strObjName, "WebList"
End Sub
'---------------------------------------------------------------------------
Public Function WaitProperty(strObjName, strProperty, strValue, iTimeout)
WaitProperty = m_WebObject.ObjectWait(strObjName, "WebList", strProperty, strValue, iTimeout)
End Function
End Class
Public Function c_WebList()
Set c_WebList = New clsWebList
End Function
'--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------'
'--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------'
Class clsWebRadioGroup
Private m_WebObject
Private Sub Class_Initialize
Set m_WebObject = New c_WebObject
End Sub
Private Sub Class_Terminate
Set thisObj = Nothing
Set m_WebObject = Nothing
End Sub
'------------------------------------------------------------------
Public Function SelectItem(strObjName, strValue)
Dim strAll
Dim flagExist
' Reset the global objFound variable
objFound = ""
' See if we can find the object by it's name
If m_WebObject.DoesObjectExist(strObjName, "WebRadioGroup", 15) = False Then
Reporter.ReportEvent micFail, "Select Radio Button", "The radio button [" & strObjName & "] could not be found. Aborting..."
ExitTest
End If
Execute "Set thisObj = " & objFound
strAll = thisObj.GetROProperty("all items")
strSplit = Split(strAll,";")
flagExist = 0
For i=0 to UBound(strSplit )
If strSplit(i) = Cstr(strValue) Then
thisObj.Select strValue
flagExist = 1
thisObj.Init
Exit For
End If
Next
If flagExist = 0 Then
Reporter.ReportEvent micFail, "Select from "& strName & " Radio button group.", "The item "& strValue & " is not present in the Radio button group."
ExitTest
End If
End Function
'------------------------------------------------------------------
Public Function Click(strObjName)
Dim strAll
Dim flagExist
If m_WebObject.DoesObjectExist(strObjName, "WebRadioGroup", 15) = False Then
Reporter.ReportEvent micFail, "Select Radio Button", "The radio button [" & strObjName & "] could not be found."
ExitTest
End If
Execute "Set thisObj = " & objFound
thisObj.Click
thisObj.Init
End Function
'---------------------------------------------------------------------------
Public Function GetROProperty(strObjName, strProperty)
GetROProperty = m_WebObject.GetROProp(strObjName, "WebRadioGroup", strProperty)
End Function
'---------------------------------------------------------------------------
Public Function GetTOProperty(strObjName, strProperty)
GetTOProperty = m_WebObject.GetTOProp(strObjName, "WebRadioGroup", strProperty)
End Function
'---------------------------------------------------------------------------
Public Function SetTOProperty(strObjName, strProperty, strValue)
SetTOProperty = m_WebObject.SetTOProp(strObjName, "WebRadioGroup", strProperty, strValue)
End Function
'---------------------------------------------------------------------------
Public Function ReturnObject(strObjName)
ReturnObject = m_WebObject.ReturnObject(strObjName, "WebRadioGroup")
End Function
'---------------------------------------------------------------------------
Public Sub SetObject(strObjName)
m_WebObject.SetObject strObjName, "WebRadioGroup"
End Sub
'---------------------------------------------------------------------------
Public Sub FireEvent(strObjName, strEvent)
m_WebObject.FireEvent strObjName, "WebRadioGroup", strEvent
End Sub
'---------------------------------------------------------------------------
Public Sub Highlight(strObjName)
m_WebObject.HighlightObject strObjName, "WebRadioGroup"
End Sub
'---------------------------------------------------------------------------
Public Sub Init(strObjName)
m_WebObject.ObjectInit strObjName, "WebRadioGroup"
End Sub
'---------------------------------------------------------------------------
Public Function WaitProperty(strObjName, strProperty, strValue, iTimeout)
WaitProperty = m_WebObject.ObjectWait(strObjName, "WebRadioGroup", strProperty, strValue, iTimeout)
End Function
End Class
Public Function c_WebRadioGroup()
Set c_WebRadioGroup = New clsWebRadioGroup
End Function
'--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------'
'--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------'
Class clsWebButton
Private m_WebObject
Private Sub Class_Initialize
Set m_WebObject = New c_WebObject
End Sub
Private Sub Class_Terminate
Set thisObj = Nothing
Set m_WebObject = Nothing
End Sub
'---------------------------------------------------------------------------
Public Sub Click(strObjName)
Dim objfocus
If m_WebObject.DoesObjectExist(strObjName, "WebButton", 15) = False Then
Reporter.ReportEvent micFail, "Button Click", "The button [" & strObjName & "] could not be found."
ExitTest
End If
Execute "Set thisObj = " & objFound
On Error Resume Next
Set objfocus = thisObj.object
objfocus.focus
On Error GoTo 0
thisObj.Click
thisObj.Init
End Sub
'---------------------------------------------------------------------------
Public Function GetROProperty(strObjName, strProperty)
GetROProperty = m_WebObject.GetROProp(strObjName, "WebButton", strProperty)
End Function
'---------------------------------------------------------------------------
Public Function GetTOProperty(strObjName, strProperty)
GetTOProperty = m_WebObject.GetTOProp(strObjName, "WebButton", strProperty)
End Function
'---------------------------------------------------------------------------
Public Function SetTOProperty(strObjName, strProperty, strValue)
SetTOProperty = m_WebObject.SetTOProp(strObjName, "WebButton", strProperty, strValue)
End Function
'---------------------------------------------------------------------------
Public Function ReturnObject(strObjName)
ReturnObject = m_WebObject.ReturnObject(strObjName, "WebButton")
End Function
'---------------------------------------------------------------------------
Public Sub SetObject(strObjName)
m_WebObject.SetObject strObjName, "WebButton"
End Sub
'---------------------------------------------------------------------------
Public Sub FireEvent(strObjName, strEvent)
m_WebObject.FireEvent strObjName, "WebButton", strEvent
End Sub
'---------------------------------------------------------------------------
Public Sub Highlight(strObjName)
m_WebObject.HighlightObject strObjName, "WebButton"
End Sub
'---------------------------------------------------------------------------
Public Sub Init(strObjName)
m_WebObject.ObjectInit strObjName, "WebButton"
End Sub
'---------------------------------------------------------------------------
Public Function WaitProperty(strObjName, strProperty, strValue, iTimeout)
WaitProperty = m_WebObject.ObjectWait(strObjName, "WebButton", strProperty, strValue, iTimeout)
End Function
End Class
Public Function c_WebButton()
Set c_WebButton = New clsWebButton
End Function
'--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------'
'--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------'
Class clsWebEdit
Private m_WebObject
Private Sub Class_Initialize
Set m_WebObject = New c_WebObject
End Sub
Private Sub Class_Terminate
Set thisObj = Nothing
Set m_WebObject = Nothing
End Sub
'------------------------------------------------------------------
Public Sub SetText(strObjName, strTextToEnter)
Dim objfocus
' See if we can find the object by it's name
If m_WebObject.DoesObjectExist(strObjName, "WebEdit", 15) = False Then
Reporter.ReportEvent micFail, "Edit Set", "The edit field [" & strObjName & "] could not be found."
ExitTest
End If
Execute "Set thisObj = " & objFound
On Error Resume Next
Set objfocus = thisObj.object
objfocus.focus
On Error GoTo 0
thisObj.Set strTextToEnter
thisObj.Init
End Sub
'---------------------------------------------------------------------------
Public Sub Click(strObjName)
Dim objfocus
If m_WebObject.DoesObjectExist(strObjName, "WebEdit", 15) = False Then
Reporter.ReportEvent micFail, "WebEdit Click", "The WebEdit object [" & strObjName & "] could not be found."
ExitTest
End If
Execute "Set thisObj = " & objFound
On Error Resume Next
Set objfocus = thisObj.object
objfocus.focus
On Error GoTo 0
thisObj.Click
thisObj.Init
End Sub
'---------------------------------------------------------------------------
Public Function GetROProperty(strObjName, strProperty)
GetROProperty = m_WebObject.GetROProp(strObjName, "WebEdit", strProperty)
End Function
'---------------------------------------------------------------------------
Public Function GetTOProperty(strObjName, strProperty)
GetTOProperty = m_WebObject.GetTOProp(strObjName, "WebEdit", strProperty)
End Function
'---------------------------------------------------------------------------
Public Function SetTOProperty(strObjName, strProperty, strValue)
SetTOProperty = m_WebObject.SetTOProp(strObjName, "WebEdit", strProperty, strValue)
End Function
'---------------------------------------------------------------------------
Public Function ReturnObject(strObjName)
ReturnObject = m_WebObject.ReturnObject(strObjName, "WebEdit")
End Function
'---------------------------------------------------------------------------
Public Sub SetObject(strObjName)
m_WebObject.SetObject strObjName, "WebEdit"
End Sub
'---------------------------------------------------------------------------
Public Sub FireEvent(strObjName, strEvent)
m_WebObject.FireEvent strObjName, "WebEdit", strEvent
End Sub
'---------------------------------------------------------------------------
Public Sub Highlight(strObjName)
m_WebObject.HighlightObject strObjName, "WebEdit"
End Sub
'---------------------------------------------------------------------------
Public Sub Init(strObjName)
m_WebObject.ObjectInit strObjName, "WebEdit"
End Sub
'---------------------------------------------------------------------------
Public Function WaitProperty(strObjName, strProperty, strValue, iTimeout)
WaitProperty = m_WebObject.ObjectWait(strObjName, "WebEdit", strProperty, strValue, iTimeout)
End Function
End Class
Public Function c_WebEdit()
Set c_WebEdit = New clsWebEdit
End Function
'--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------'
'--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------'
Class clsWebCheckBox
Private m_WebObject
Private Sub Class_Initialize
Set m_WebObject = New c_WebObject
End Sub
Private Sub Class_Terminate
Set thisObj = Nothing
Set m_WebObject = Nothing
End Sub
'------------------------------------------------------------------
Public Sub Tick(strObjName, strFieldValue)
Dim objfocus
' See if we can find the object by it's name
If m_WebObject.DoesObjectExist(strObjName, "WebCheckBox", 15) = False Then
Reporter.ReportEvent micFail, "Check Box", "The check box field [" & strObjName & "] could not be found."
ExitTest
End If
Execute "Set thisObj = " & objFound
On Error Resume Next
Set objfocus = thisObj.object
objfocus.focus
On Error GoTo 0
If UCase(strFieldValue) = "ON" And thisObj.GetROProperty("checked") = True Then
Exit Sub
End If
If UCase(strFieldValue) = "ON" And thisObj.GetROProperty("checked") = False Then
thisObj.Set "ON"
End If
If UCase(strFieldValue) = "OFF" And thisObj.GetROProperty("checked") = False Then
Exit Sub
End If
If UCase(strFieldValue) = "OFF" And thisObj.GetROProperty("checked") = True Then
thisObj.Set "OFF"
End If
thisObj.Init
End Sub
'---------------------------------------------------------------------------
Public Function GetROProperty(strObjName, strProperty)
GetROProperty = m_WebObject.GetROProp(strObjName, "WebCheckBox", strProperty)
End Function
'---------------------------------------------------------------------------
Public Function GetTOProperty(strObjName, strProperty)
GetTOProperty = m_WebObject.GetTOProp(strObjName, "WebCheckBox", strProperty)
End Function
'---------------------------------------------------------------------------
Public Function SetTOProperty(strObjName, strProperty, strValue)
SetTOProperty = m_WebObject.SetTOProp(strObjName, "WebCheckBox", strProperty, strValue)
End Function
'---------------------------------------------------------------------------
Public Function ReturnObject(strObjName)
ReturnObject = m_WebObject.ReturnObject(strObjName, "WebCheckBox")
End Function
'---------------------------------------------------------------------------
Public Sub SetObject(strObjName)
m_WebObject.SetObject strObjName, "WebCheckBox"
End Sub
'---------------------------------------------------------------------------
Public Sub FireEvent(strObjName, strEvent)
m_WebObject.FireEvent strObjName, "WebCheckBox", strEvent
End Sub
'---------------------------------------------------------------------------
Public Sub Highlight(strObjName)
m_WebObject.HighlightObject strObjName, "WebCheckBox"
End Sub
'---------------------------------------------------------------------------
Public Sub Init(strObjName)
m_WebObject.ObjectInit strObjName, "WebCheckBox"
End Sub
'---------------------------------------------------------------------------
Public Function WaitProperty(strObjName, strProperty, strValue, iTimeout)
WaitProperty = m_WebObject.ObjectWait(strObjName, "WebCheckBox", strProperty, strValue, iTimeout)
End Function
End Class
Public Function c_WebCheckBox()
Set c_WebCheckBox = New clsWebCheckBox
End Function
'--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------'
'--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------'
Class clsLink
Private m_WebObject
Private Sub Class_Initialize
Set m_WebObject = New c_WebObject
End Sub
Private Sub Class_Terminate
Set thisObj = Nothing
Set m_WebObject = Nothing
End Sub
'------------------------------------------------------------------
Public Sub Click(strObjName)
Dim objfocus
' See if we can find the object by it's name
If m_WebObject.DoesObjectExist(strObjName, "Link", 15) = False Then
Reporter.ReportEvent micFail, "Link Click", "The link [" & strObjName & "] could not be found."
ExitTest
End If
Execute "Set thisObj = " & objFound
On Error Resume Next
Set objfocus = thisObj.object
objfocus.focus
On Error GoTo 0
thisObj.Click
thisObj.Init
End Sub
'---------------------------------------------------------------------------
Public Function GetROProperty(strObjName, strProperty)
GetROProperty = m_WebObject.GetROProp(strObjName, "Link", strProperty)
End Function
'---------------------------------------------------------------------------
Public Function GetTOProperty(strObjName, strProperty)
GetTOProperty = m_WebObject.GetTOProp(strObjName, "Link", strProperty)
End Function
'---------------------------------------------------------------------------
Public Function SetTOProperty(strObjName, strProperty, strValue)
SetTOProperty = m_WebObject.SetTOProp(strObjName, "Link", strProperty, strValue)
End Function
'---------------------------------------------------------------------------
Public Function ReturnObject(strObjName)
ReturnObject = m_WebObject.ReturnObject(strObjName, "Link")
End Function
'---------------------------------------------------------------------------
Public Sub SetObject(strObjName)
m_WebObject.SetObject strObjName, "Link"
End Sub
'---------------------------------------------------------------------------
Public Sub FireEvent(strObjName, strEvent)
m_WebObject.FireEvent strObjName, "Link", strEvent
End Sub
'---------------------------------------------------------------------------
Public Sub Highlight(strObjName)
m_WebObject.HighlightObject strObjName, "Link"
End Sub
'---------------------------------------------------------------------------
Public Sub Init(strObjName)
m_WebObject.ObjectInit strObjName, "Link"
End Sub
'---------------------------------------------------------------------------
Public Function WaitProperty(strObjName, strProperty, strValue, iTimeout)
WaitProperty = m_WebObject.ObjectWait(strObjName, "Link", strProperty, strValue, iTimeout)
End Function
End Class
Public Function c_WebLink()
Set c_WebLink = New clsLink
End Function
'--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------'
'--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------'
Class clsWebElement
Private m_WebObject
Private Sub Class_Initialize
Set m_WebObject = New c_WebObject
End Sub
Private Sub Class_Terminate
Set thisObj = Nothing
Set m_WebObject = Nothing
End Sub
'------------------------------------------------------------------
Public Sub WebElementClick(strObjName)
Dim objfocus
' See if we can find the object by it's name
If DoesObjectExist(strObjName, "WebElement", 5) = False Then
Reporter.ReportEvent micFail, "Click WebElement Object", "The object [" & strObjName & "] could not be found."
ExitTest
End If
Execute "Set thisObj = " & objFound
On Error Resume Next
Set objfocus = thisObj.object
objfocus.focus
On Error GoTo 0
thisObj.Click
thisObj.Init
End Sub
'---------------------------------------------------------------------------
Public Function GetROProperty(strObjName, strProperty)
GetROProperty = m_WebObject.GetROProp(strObjName, "WebElement", strProperty)
End Function
'---------------------------------------------------------------------------
Public Function GetTOProperty(strObjName, strProperty)
GetTOProperty = m_WebObject.GetTOProp(strObjName, "WebElement", strProperty)
End Function
'---------------------------------------------------------------------------
Public Function SetTOProperty(strObjName, strProperty, strValue)
SetTOProperty = m_WebObject.SetTOProp(strObjName, "WebElement", strProperty, strValue)
End Function
'---------------------------------------------------------------------------
Public Function ReturnObject(strObjName)
ReturnObject = m_WebObject.ReturnObject(strObjName, "WebElement")
End Function
'---------------------------------------------------------------------------
Public Sub SetObject(strObjName)
m_WebObject.SetObject strObjName, "WebElement"
End Sub
'---------------------------------------------------------------------------
Public Sub FireEvent(strObjName, strEvent)
m_WebObject.FireEvent strObjName, "WebElement", strEvent
End Sub
'---------------------------------------------------------------------------
Public Sub Highlight(strObjName)
If Instr(1, strObjName, ":=") Then
Set thisObj = m_WebObject.DPObject(strObjName, "WebElement")
thisObj.Highlight
Else
m_WebObject.HighlightObject strObjName, "WebElement"
End If
End Sub
'---------------------------------------------------------------------------
Public Sub Init(strObjName)
m_WebObject.ObjectInit strObjName, "WebElement"
End Sub
'---------------------------------------------------------------------------
Public Function WaitProperty(strObjName, strProperty, strValue, iTimeout)
WaitProperty = m_WebObject.ObjectWait(strObjName, "WebElement", strProperty, strValue, iTimeout)
End Function
End Class
Public Function c_WebElement()
Set c_WebElement = New clsWebElement
End Function
'--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------'
'--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------'
Class clsWebFile
Private m_WebObject
Private Sub Class_Initialize
Set m_WebObject = New c_WebObject
End Sub
Private Sub Class_Terminate
Set thisObj = Nothing
Set m_WebObject = Nothing
End Sub
'------------------------------------------------------------------
Public Sub EnterText(strObjName, strTextToEnter)
Dim objfocus
If m_WebObject.DoesObjectExist(strObjName, "WebFile", 15) = False Then
Reporter.ReportEvent micFail, "WebFile Set", "The WebFile field [" & strObjName & "] could not be found."
ExitTest
End If
Execute "Set thisObj = " & objFound
On Error Resume Next
Set objfocus = thisObj.object
objfocus.focus
On Error GoTo 0
thisObj.Set strTextToEnter
thisObj.Init
End Sub
'---------------------------------------------------------------------------
Public Function GetROProperty(strObjName, strProperty)
GetROProperty = m_WebObject.GetROProp(strObjName, "WebFile", strProperty)
End Function
'---------------------------------------------------------------------------
Public Function GetTOProperty(strObjName, strProperty)
GetTOProperty = m_WebObject.GetTOProp(strObjName, "WebFile", strProperty)
End Function
'---------------------------------------------------------------------------
Public Function SetTOProperty(strObjName, strProperty, strValue)
SetTOProperty = m_WebObject.SetTOProp(strObjName, "WebFile", strProperty, strValue)
End Function
'---------------------------------------------------------------------------
Public Function ReturnObject(strObjName)
ReturnObject = m_WebObject.ReturnObject(strObjName, "WebFile")
End Function
'---------------------------------------------------------------------------
Public Sub SetObject(strObjName)
m_WebObject.SetObject strObjName, "WebFile"
End Sub
'---------------------------------------------------------------------------
Public Sub FireEvent(strObjName, strEvent)
m_WebObject.FireEvent strObjName, "WebFile", strEvent
End Sub
'---------------------------------------------------------------------------
Public Sub Highlight(strObjName)
m_WebObject.HighlightObject strObjName, "WebFile"
End Sub
'---------------------------------------------------------------------------
Public Sub Init(strObjName)
m_WebObject.ObjectInit strObjName, "WebFile"
End Sub
'---------------------------------------------------------------------------
Public Function WaitProperty(strObjName, strProperty, strValue, iTimeout)
WaitProperty = m_WebObject.ObjectWait(strObjName, "WebFile", strProperty, strValue, iTimeout)