-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCommonFunction.svb
More file actions
163 lines (138 loc) · 4.96 KB
/
Copy pathCommonFunction.svb
File metadata and controls
163 lines (138 loc) · 4.96 KB
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
'===============================================================================
' Function: ClickTBDropDown
'
' Description:
'
' Parameters:
' Object - objToolbar :
' String - strIdItem :
'
'===============================================================================
Sub ClickTBDropDown(objToolbar, strIdItem)
Set objPage = Aliases.browser.page
Set btnToolbarMore = HTML.LinkQAD.FindLink_Proximity1(objToolbar, "qMoreToolbarButton")
Call HTML.ButtonQAD.ClickBtn(btnToolbarMore)
' Find the floating window
arrProperties = Array("innerHTML")
arrValues = Array("*id=" & chr(34) & strIdItem & chr(34) & "*")
Set objParent = HTML.FindChildMethods.FromParent_Proximity1(objPage, arrProperties, arrValues, 30) 'Floating window, it has no idStr !!!
' Find the child link and click on it
Set lnkToolBarItem = HTML.LinkQAD.FindLink_Proximity1(objParent, strIdItem)
Call HTML.LinkQAD.ClickLink(lnkToolBarItem)
End sub
'===============================================================================
' Function: ComboboxSelectItemKeys
'
' Description:
'
' Parameters:
' Object - cmbComboBox :
' String - strItem :
'
'===============================================================================
Sub ComboboxSelectItemKeys(cmbComboBox, strItem)
Log.AppendFolder("Select item in 'Create for'")
cmbComboBox.Click
intCmbLenght = cmbComboBox.Select(0).wItemCount
strCmbItem = cmbComboBox.TextNode(0).innerText
For i = 0 To intCmbLenght - 1
Log.Message(strCmbItem)
If strCmbItem = strItem Then
cmbComboBox.Keys("[Enter]")
Exit for
Else
If i = intCmbLenght - 1 Then
Log.Error("The name of item is not correct")
Else
cmbComboBox.Keys("[Down]")
strCmbItem = cmbComboBox.TextNode(0).innerText
End if
End if
Next
Log.PopLogFolder
End sub
'===============================================================================
' Function: GetTextBoxObj
'
' Description:
'
' Parameters:
' Array - arrTextBoxes :
' String - strName :
'
'===============================================================================
Function GetTextBoxObj(arrTextBoxes, strName)
For i = 0 To UBound(arrTextBoxes)
If LCase(arrTextBoxes(i).ObjectIdentifier) = LCase(strName) Then
Set GetTextBoxObj = arrTextBoxes(i)
Exit For
Else
If i = UBound(arrTextBoxes) Then
GetTextBoxObj = false
End if
End if
Next
End Function
'===============================================================================
' Sub: ChekTextBoxOnDisable
'
' Description:
'
' Parameters:
' Object - txtInput :
' Boolean - bolInvert :
'
'===============================================================================
Sub ChekTextBoxOnDisable(txtInput, bolInvert)
If NOT (aqObject.GetPropertyValue(txtInput, "readonly") AND bolInvert) Then
Log.Message("Layput """ & txtInput.ObjectIdentifier &""" is available for editing")
Else
Log.Message("Layput """ & txtInput.ObjectIdentifier &""" is disable for editing")
End if
End Sub
'===============================================================================
' Function: GetStyle
'
' Description: Retrieving CSS property
'
' Parameters:
' Object - objElement : His style need to get
' String - strStyleProp : Style property that we need to get
'
' Returns:
' String - Value of CSS property
'
'===============================================================================
Function GetStyle(objElement, strStyleProp)
Dim document, style
Set document = objElement.ownerDocument
If aqObject.IsSupported(document, "defaultView") Then
' Internet Explorer 9+, Firefox, Chrome, Safari, Opera
Set style = document.defaultView.getComputedStyle(objElement, "")
getStyle = style.getPropertyValue(strStyleProp)
Else
' Internet Explorer 7 - 8
getStyle = objElement.currentStyle.getPropertyValue(strStyleProp)
End If
End Function
'===============================================================================
' Sub: ScrollDown
'
' Description: Scrolls down to a value equal to the height of the objScrollBox,
' until the objElement is not visible on the screen.
'
' Parameters:
' Object - an object with scrollbar.
' Object - object that you want to find.
'
'===============================================================================
Sub ScrollDown(objScrollBox, objElement)
If Not objElement.VisibleOnScreen Then
If objScrollBox.scrollTop < objScrollBox.scrollHeight Then
objScrollBox.scrollTop = objScrollBox.scrollTop + objScrollBox.height
Else
Log.Warning("Item is NOT EXISTS")
End if
Call ScrollDown(objScrollBox, objElement)
End if
End sub