appium-novawindows2-driver 0.2.2 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -201
- package/README.md +554 -554
- package/build/lib/commands/app.d.ts.map +1 -1
- package/build/lib/commands/app.js +35 -31
- package/build/lib/commands/app.js.map +1 -1
- package/build/lib/commands/extension.d.ts +1 -1
- package/build/lib/commands/extension.d.ts.map +1 -1
- package/build/lib/commands/extension.js +26 -26
- package/build/lib/commands/extension.js.map +1 -1
- package/build/lib/commands/file.js +22 -22
- package/build/lib/commands/functions.js +189 -189
- package/build/lib/commands/index.d.ts +1 -1
- package/build/lib/commands/index.d.ts.map +1 -1
- package/build/lib/commands/powershell.d.ts.map +1 -1
- package/build/lib/commands/powershell.js +164 -197
- package/build/lib/commands/powershell.js.map +1 -1
- package/build/lib/driver.d.ts +0 -1
- package/build/lib/driver.d.ts.map +1 -1
- package/build/lib/driver.js +7 -3
- package/build/lib/driver.js.map +1 -1
- package/build/lib/powershell/elements.js +738 -738
- package/build/lib/powershell/msaa.d.ts +10 -0
- package/build/lib/powershell/msaa.d.ts.map +1 -0
- package/build/lib/powershell/msaa.js +188 -0
- package/build/lib/powershell/msaa.js.map +1 -0
- package/build/lib/temp/MSAAHelper.dll +0 -0
- package/build/lib/winapi/uia.d.ts +163 -0
- package/build/lib/winapi/uia.d.ts.map +1 -0
- package/build/lib/winapi/uia.js +677 -0
- package/build/lib/winapi/uia.js.map +1 -0
- package/build/lib/xpath/native.d.ts +14 -0
- package/build/lib/xpath/native.d.ts.map +1 -0
- package/build/lib/xpath/native.js +329 -0
- package/build/lib/xpath/native.js.map +1 -0
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +64 -63
|
@@ -2,195 +2,195 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PAGE_SOURCE = exports.FIND_CHILDREN_RECURSIVELY = void 0;
|
|
4
4
|
const powershell_1 = require("../powershell");
|
|
5
|
-
exports.FIND_CHILDREN_RECURSIVELY = (0, powershell_1.pwsh /* ps1 */) `
|
|
6
|
-
function Find-ChildrenRecursively {
|
|
7
|
-
param (
|
|
8
|
-
[Parameter(Mandatory=$true)]
|
|
9
|
-
[AutomationElement]$element,
|
|
10
|
-
[Parameter(Mandatory=$true)]
|
|
11
|
-
[Condition]$condition,
|
|
12
|
-
[Parameter(Mandatory=$false)]
|
|
13
|
-
[bool]$includeSelf = $false
|
|
14
|
-
)
|
|
15
|
-
|
|
16
|
-
$scope = if ($includeSelf) {
|
|
17
|
-
[TreeScope]::Element -bor [TreeScope]::Children
|
|
18
|
-
} else {
|
|
19
|
-
[TreeScope]::Children
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
$validChild = $element.FindFirst($scope, $condition)
|
|
23
|
-
|
|
24
|
-
if ($validChild -ne $null) {
|
|
25
|
-
return $validChild
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
$children = $element.FindAll([TreeScope]::Children, [Condition]::TrueCondition)
|
|
29
|
-
foreach ($child in $children) {
|
|
30
|
-
$result = Find-AllChildrenRecursively -element $child -condition $condition -returnFirstResult $true
|
|
31
|
-
if ($result -ne $null) {
|
|
32
|
-
return $result[0]
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return $null
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
function Find-AllChildrenRecursively {
|
|
40
|
-
param (
|
|
41
|
-
[Parameter(Mandatory=$true)]
|
|
42
|
-
[AutomationElement]$element,
|
|
43
|
-
[Parameter(Mandatory=$true)]
|
|
44
|
-
[Condition]$condition,
|
|
45
|
-
[bool]$returnFirstResult = $false,
|
|
46
|
-
[Parameter(Mandatory=$false)]
|
|
47
|
-
[bool]$includeSelf = $false
|
|
48
|
-
)
|
|
49
|
-
|
|
50
|
-
$children = $element.FindAll([TreeScope]::Children, [Condition]::TrueCondition)
|
|
51
|
-
$validChildren = @($children | Where-Object { $_.FindFirst([TreeScope]::Element, $condition) -ne $null })
|
|
52
|
-
|
|
53
|
-
if ($includeSelf) {
|
|
54
|
-
$self = $element.FindFirst([TreeScope]::Element, $condition)
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
if ($null -ne $self) {
|
|
58
|
-
$validChildren += $self
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
foreach ($child in $children) {
|
|
62
|
-
$Allresults = Find-AllChildrenRecursively -element $child -condition $condition
|
|
63
|
-
if ($returnFirstResult -and $Allresults.Count -gt 0) {
|
|
64
|
-
return $Allresults
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
foreach ($result in $Allresults) {
|
|
68
|
-
$validChildren += ($result | Where-Object { $_.FindFirst([TreeScope]::Element, $condition) -ne $null })
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
return $validChildren
|
|
73
|
-
}
|
|
5
|
+
exports.FIND_CHILDREN_RECURSIVELY = (0, powershell_1.pwsh /* ps1 */) `
|
|
6
|
+
function Find-ChildrenRecursively {
|
|
7
|
+
param (
|
|
8
|
+
[Parameter(Mandatory=$true)]
|
|
9
|
+
[AutomationElement]$element,
|
|
10
|
+
[Parameter(Mandatory=$true)]
|
|
11
|
+
[Condition]$condition,
|
|
12
|
+
[Parameter(Mandatory=$false)]
|
|
13
|
+
[bool]$includeSelf = $false
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
$scope = if ($includeSelf) {
|
|
17
|
+
[TreeScope]::Element -bor [TreeScope]::Children
|
|
18
|
+
} else {
|
|
19
|
+
[TreeScope]::Children
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
$validChild = $element.FindFirst($scope, $condition)
|
|
23
|
+
|
|
24
|
+
if ($validChild -ne $null) {
|
|
25
|
+
return $validChild
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
$children = $element.FindAll([TreeScope]::Children, [Condition]::TrueCondition)
|
|
29
|
+
foreach ($child in $children) {
|
|
30
|
+
$result = Find-AllChildrenRecursively -element $child -condition $condition -returnFirstResult $true
|
|
31
|
+
if ($result -ne $null) {
|
|
32
|
+
return $result[0]
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return $null
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function Find-AllChildrenRecursively {
|
|
40
|
+
param (
|
|
41
|
+
[Parameter(Mandatory=$true)]
|
|
42
|
+
[AutomationElement]$element,
|
|
43
|
+
[Parameter(Mandatory=$true)]
|
|
44
|
+
[Condition]$condition,
|
|
45
|
+
[bool]$returnFirstResult = $false,
|
|
46
|
+
[Parameter(Mandatory=$false)]
|
|
47
|
+
[bool]$includeSelf = $false
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
$children = $element.FindAll([TreeScope]::Children, [Condition]::TrueCondition)
|
|
51
|
+
$validChildren = @($children | Where-Object { $_.FindFirst([TreeScope]::Element, $condition) -ne $null })
|
|
52
|
+
|
|
53
|
+
if ($includeSelf) {
|
|
54
|
+
$self = $element.FindFirst([TreeScope]::Element, $condition)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if ($null -ne $self) {
|
|
58
|
+
$validChildren += $self
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
foreach ($child in $children) {
|
|
62
|
+
$Allresults = Find-AllChildrenRecursively -element $child -condition $condition
|
|
63
|
+
if ($returnFirstResult -and $Allresults.Count -gt 0) {
|
|
64
|
+
return $Allresults
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
foreach ($result in $Allresults) {
|
|
68
|
+
$validChildren += ($result | Where-Object { $_.FindFirst([TreeScope]::Element, $condition) -ne $null })
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return $validChildren
|
|
73
|
+
}
|
|
74
74
|
`;
|
|
75
|
-
exports.PAGE_SOURCE = (0, powershell_1.pwsh /* ps1 */) `
|
|
76
|
-
function Get-PageSource {
|
|
77
|
-
param (
|
|
78
|
-
[Parameter(Mandatory = $true)]
|
|
79
|
-
[AutomationElement]$element,
|
|
80
|
-
[Xml.XmlDocument]$xmlDoc,
|
|
81
|
-
[Xml.XmlElement]$xmlElement
|
|
82
|
-
)
|
|
83
|
-
|
|
84
|
-
try {
|
|
85
|
-
$localizedControlType = $element.GetCurrentPropertyValue([AutomationElement]::LocalizedControlTypeProperty)
|
|
86
|
-
$controlType = $element.GetCurrentPropertyValue([AutomationElement]::ControlTypeProperty)
|
|
87
|
-
|
|
88
|
-
$tagName = ''
|
|
89
|
-
try {
|
|
90
|
-
$tagName = $controlType.ProgrammaticName.Split('.')[-1]
|
|
91
|
-
if ($tagName -eq 'DataGrid') { $tagName = 'List' }
|
|
92
|
-
elseif ($tagName -eq 'DataItem') { $tagName = 'ListItem' }
|
|
93
|
-
} catch {
|
|
94
|
-
# fallback to LocalizedControlType ControlType is empty
|
|
95
|
-
$tagName = -join ($localizedControlType -split ' ' | ForEach-Object {
|
|
96
|
-
$_.Substring(0, 1).ToUpper() + $_.Substring(1).ToLower()
|
|
97
|
-
})
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
$acceleratorKey = $element.GetCurrentPropertyValue([AutomationElement]::AcceleratorKeyProperty)
|
|
101
|
-
$accessKey = $element.GetCurrentPropertyValue([AutomationElement]::AccessKeyProperty)
|
|
102
|
-
$automationId = $element.GetCurrentPropertyValue([AutomationElement]::AutomationIdProperty)
|
|
103
|
-
$className = $element.GetCurrentPropertyValue([AutomationElement]::ClassNameProperty)
|
|
104
|
-
$frameworkId = $element.GetCurrentPropertyValue([AutomationElement]::FrameworkIdProperty)
|
|
105
|
-
$hasKeyboardfocus = $element.GetCurrentPropertyValue([AutomationElement]::HasKeyboardfocusProperty)
|
|
106
|
-
$helpText = $element.GetCurrentPropertyValue([AutomationElement]::HelpTextProperty)
|
|
107
|
-
$isContentelement = $element.GetCurrentPropertyValue([AutomationElement]::IsContentelementProperty)
|
|
108
|
-
$isControlelement = $element.GetCurrentPropertyValue([AutomationElement]::IsControlelementProperty)
|
|
109
|
-
$isEnabled = $element.GetCurrentPropertyValue([AutomationElement]::IsEnabledProperty)
|
|
110
|
-
$isKeyboardfocusable = $element.GetCurrentPropertyValue([AutomationElement]::IsKeyboardfocusableProperty)
|
|
111
|
-
$isOffscreen = $element.GetCurrentPropertyValue([AutomationElement]::IsOffscreenProperty)
|
|
112
|
-
$isPassword = $element.GetCurrentPropertyValue([AutomationElement]::IsPasswordProperty)
|
|
113
|
-
$isRequiredforform = $element.GetCurrentPropertyValue([AutomationElement]::IsRequiredforformProperty)
|
|
114
|
-
$itemStatus = $element.GetCurrentPropertyValue([AutomationElement]::ItemStatusProperty)
|
|
115
|
-
$itemType = $element.GetCurrentPropertyValue([AutomationElement]::ItemTypeProperty)
|
|
116
|
-
$name = $element.GetCurrentPropertyValue([AutomationElement]::NameProperty)
|
|
117
|
-
$orientation = $element.GetCurrentPropertyValue([AutomationElement]::OrientationProperty)
|
|
118
|
-
$processId = $element.GetCurrentPropertyValue([AutomationElement]::ProcessIdProperty)
|
|
119
|
-
$runtimeId = $element.GetCurrentPropertyValue([AutomationElement]::RuntimeIdProperty) -join '.'
|
|
120
|
-
$boundingRectangle = $element.Current.BoundingRectangle
|
|
121
|
-
$x = $boundingRectangle.X - $rootElement.Current.BoundingRectangle.X
|
|
122
|
-
$y = $boundingRectangle.Y - $rootElement.Current.BoundingRectangle.Y
|
|
123
|
-
$width = $boundingRectangle.Width
|
|
124
|
-
$height = $boundingRectangle.Height
|
|
125
|
-
|
|
126
|
-
if ($null -eq $xmlDoc) { $xmlDoc = [Xml.XmlDocument]::new() }
|
|
127
|
-
|
|
128
|
-
$newXmlElement = $xmlDoc.CreateElement($tagName)
|
|
129
|
-
$newXmlElement.SetAttribute("AcceleratorKey", $acceleratorKey)
|
|
130
|
-
$newXmlElement.SetAttribute("AccessKey", $accessKey)
|
|
131
|
-
$newXmlElement.SetAttribute("AutomationId", $automationId)
|
|
132
|
-
$newXmlElement.SetAttribute("ClassName", $className)
|
|
133
|
-
$newXmlElement.SetAttribute("FrameworkId", $frameworkId)
|
|
134
|
-
$newXmlElement.SetAttribute("HasKeyboardfocus", $hasKeyboardfocus)
|
|
135
|
-
$newXmlElement.SetAttribute("HelpText", $helpText)
|
|
136
|
-
$newXmlElement.SetAttribute("IsContentelement", $isContentelement)
|
|
137
|
-
$newXmlElement.SetAttribute("IsControlelement", $isControlelement)
|
|
138
|
-
$newXmlElement.SetAttribute("IsEnabled", $isEnabled)
|
|
139
|
-
$newXmlElement.SetAttribute("IsKeyboardfocusable", $isKeyboardfocusable)
|
|
140
|
-
$newXmlElement.SetAttribute("IsOffscreen", $isOffscreen)
|
|
141
|
-
$newXmlElement.SetAttribute("IsPassword", $isPassword)
|
|
142
|
-
$newXmlElement.SetAttribute("IsRequiredforform", $isRequiredforform)
|
|
143
|
-
$newXmlElement.SetAttribute("ItemStatus", $itemStatus)
|
|
144
|
-
$newXmlElement.SetAttribute("ItemType", $itemType)
|
|
145
|
-
$newXmlElement.SetAttribute("LocalizedControlType", $localizedControlType)
|
|
146
|
-
$newXmlElement.SetAttribute("Name", $name)
|
|
147
|
-
$newXmlElement.SetAttribute("Orientation", $orientation)
|
|
148
|
-
$newXmlElement.SetAttribute("ProcessId", $processId)
|
|
149
|
-
$newXmlElement.SetAttribute("RuntimeId", $runtimeId)
|
|
150
|
-
$newXmlElement.SetAttribute("x", $x)
|
|
151
|
-
$newXmlElement.SetAttribute("y", $y)
|
|
152
|
-
$newXmlElement.SetAttribute("width", $width)
|
|
153
|
-
$newXmlElement.SetAttribute("height", $height)
|
|
154
|
-
|
|
155
|
-
$pattern = $null
|
|
156
|
-
|
|
157
|
-
if ($element.TryGetCurrentPattern([WindowPattern]::Pattern, [ref]$pattern)) {
|
|
158
|
-
$newXmlElement.SetAttribute("CanMaximize", $
|
|
159
|
-
$newXmlElement.SetAttribute("CanMinimize", $
|
|
160
|
-
$newXmlElement.SetAttribute("IsModal", $
|
|
161
|
-
$newXmlElement.SetAttribute("WindowVisualState", $
|
|
162
|
-
$newXmlElement.SetAttribute("WindowInteractionState", $
|
|
163
|
-
$newXmlElement.SetAttribute("IsTopmost", $
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
if ($element.TryGetCurrentPattern([TransformPattern]::Pattern, [ref]$pattern)) {
|
|
167
|
-
$newXmlElement.SetAttribute("CanRotate", $
|
|
168
|
-
$newXmlElement.SetAttribute("CanResize", $
|
|
169
|
-
$newXmlElement.SetAttribute("CanMove", $
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
# TODO: more to be added depending on the available patterns
|
|
173
|
-
|
|
174
|
-
if ($null -eq $xmlElement) {
|
|
175
|
-
$xmlElement = $xmlDoc.AppendChild($newXmlElement)
|
|
176
|
-
} else {
|
|
177
|
-
$xmlElement = $xmlElement.AppendChild($newXmlElement)
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
$elementsToProcess = New-Object System.Collections.Queue
|
|
181
|
-
$element.FindAll([TreeScope]::Children, $cacheRequest.TreeFilter) | ForEach-Object {
|
|
182
|
-
$elementsToProcess.Enqueue($_)
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
while ($elementsToProcess.Count -gt 0) {
|
|
186
|
-
$currentElement = $elementsToProcess.Dequeue()
|
|
187
|
-
Get-PageSource $currentElement $xmlDoc $xmlElement | Out-Null
|
|
188
|
-
}
|
|
189
|
-
} catch {
|
|
190
|
-
# noop
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
return $xmlElement
|
|
194
|
-
}
|
|
75
|
+
exports.PAGE_SOURCE = (0, powershell_1.pwsh /* ps1 */) `
|
|
76
|
+
function Get-PageSource {
|
|
77
|
+
param (
|
|
78
|
+
[Parameter(Mandatory = $true)]
|
|
79
|
+
[AutomationElement]$element,
|
|
80
|
+
[Xml.XmlDocument]$xmlDoc,
|
|
81
|
+
[Xml.XmlElement]$xmlElement
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
try {
|
|
85
|
+
$localizedControlType = $element.GetCurrentPropertyValue([AutomationElement]::LocalizedControlTypeProperty)
|
|
86
|
+
$controlType = $element.GetCurrentPropertyValue([AutomationElement]::ControlTypeProperty)
|
|
87
|
+
|
|
88
|
+
$tagName = ''
|
|
89
|
+
try {
|
|
90
|
+
$tagName = $controlType.ProgrammaticName.Split('.')[-1]
|
|
91
|
+
if ($tagName -eq 'DataGrid') { $tagName = 'List' }
|
|
92
|
+
elseif ($tagName -eq 'DataItem') { $tagName = 'ListItem' }
|
|
93
|
+
} catch {
|
|
94
|
+
# fallback to LocalizedControlType ControlType is empty
|
|
95
|
+
$tagName = -join ($localizedControlType -split ' ' | ForEach-Object {
|
|
96
|
+
$_.Substring(0, 1).ToUpper() + $_.Substring(1).ToLower()
|
|
97
|
+
})
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
$acceleratorKey = $element.GetCurrentPropertyValue([AutomationElement]::AcceleratorKeyProperty)
|
|
101
|
+
$accessKey = $element.GetCurrentPropertyValue([AutomationElement]::AccessKeyProperty)
|
|
102
|
+
$automationId = $element.GetCurrentPropertyValue([AutomationElement]::AutomationIdProperty)
|
|
103
|
+
$className = $element.GetCurrentPropertyValue([AutomationElement]::ClassNameProperty)
|
|
104
|
+
$frameworkId = $element.GetCurrentPropertyValue([AutomationElement]::FrameworkIdProperty)
|
|
105
|
+
$hasKeyboardfocus = $element.GetCurrentPropertyValue([AutomationElement]::HasKeyboardfocusProperty)
|
|
106
|
+
$helpText = $element.GetCurrentPropertyValue([AutomationElement]::HelpTextProperty)
|
|
107
|
+
$isContentelement = $element.GetCurrentPropertyValue([AutomationElement]::IsContentelementProperty)
|
|
108
|
+
$isControlelement = $element.GetCurrentPropertyValue([AutomationElement]::IsControlelementProperty)
|
|
109
|
+
$isEnabled = $element.GetCurrentPropertyValue([AutomationElement]::IsEnabledProperty)
|
|
110
|
+
$isKeyboardfocusable = $element.GetCurrentPropertyValue([AutomationElement]::IsKeyboardfocusableProperty)
|
|
111
|
+
$isOffscreen = $element.GetCurrentPropertyValue([AutomationElement]::IsOffscreenProperty)
|
|
112
|
+
$isPassword = $element.GetCurrentPropertyValue([AutomationElement]::IsPasswordProperty)
|
|
113
|
+
$isRequiredforform = $element.GetCurrentPropertyValue([AutomationElement]::IsRequiredforformProperty)
|
|
114
|
+
$itemStatus = $element.GetCurrentPropertyValue([AutomationElement]::ItemStatusProperty)
|
|
115
|
+
$itemType = $element.GetCurrentPropertyValue([AutomationElement]::ItemTypeProperty)
|
|
116
|
+
$name = $element.GetCurrentPropertyValue([AutomationElement]::NameProperty)
|
|
117
|
+
$orientation = $element.GetCurrentPropertyValue([AutomationElement]::OrientationProperty)
|
|
118
|
+
$processId = $element.GetCurrentPropertyValue([AutomationElement]::ProcessIdProperty)
|
|
119
|
+
$runtimeId = $element.GetCurrentPropertyValue([AutomationElement]::RuntimeIdProperty) -join '.'
|
|
120
|
+
$boundingRectangle = $element.Current.BoundingRectangle
|
|
121
|
+
$x = $boundingRectangle.X - $rootElement.Current.BoundingRectangle.X
|
|
122
|
+
$y = $boundingRectangle.Y - $rootElement.Current.BoundingRectangle.Y
|
|
123
|
+
$width = $boundingRectangle.Width
|
|
124
|
+
$height = $boundingRectangle.Height
|
|
125
|
+
|
|
126
|
+
if ($null -eq $xmlDoc) { $xmlDoc = [Xml.XmlDocument]::new() }
|
|
127
|
+
|
|
128
|
+
$newXmlElement = $xmlDoc.CreateElement($tagName)
|
|
129
|
+
$newXmlElement.SetAttribute("AcceleratorKey", $acceleratorKey)
|
|
130
|
+
$newXmlElement.SetAttribute("AccessKey", $accessKey)
|
|
131
|
+
$newXmlElement.SetAttribute("AutomationId", $automationId)
|
|
132
|
+
$newXmlElement.SetAttribute("ClassName", $className)
|
|
133
|
+
$newXmlElement.SetAttribute("FrameworkId", $frameworkId)
|
|
134
|
+
$newXmlElement.SetAttribute("HasKeyboardfocus", $hasKeyboardfocus)
|
|
135
|
+
$newXmlElement.SetAttribute("HelpText", $helpText)
|
|
136
|
+
$newXmlElement.SetAttribute("IsContentelement", $isContentelement)
|
|
137
|
+
$newXmlElement.SetAttribute("IsControlelement", $isControlelement)
|
|
138
|
+
$newXmlElement.SetAttribute("IsEnabled", $isEnabled)
|
|
139
|
+
$newXmlElement.SetAttribute("IsKeyboardfocusable", $isKeyboardfocusable)
|
|
140
|
+
$newXmlElement.SetAttribute("IsOffscreen", $isOffscreen)
|
|
141
|
+
$newXmlElement.SetAttribute("IsPassword", $isPassword)
|
|
142
|
+
$newXmlElement.SetAttribute("IsRequiredforform", $isRequiredforform)
|
|
143
|
+
$newXmlElement.SetAttribute("ItemStatus", $itemStatus)
|
|
144
|
+
$newXmlElement.SetAttribute("ItemType", $itemType)
|
|
145
|
+
$newXmlElement.SetAttribute("LocalizedControlType", $localizedControlType)
|
|
146
|
+
$newXmlElement.SetAttribute("Name", $name)
|
|
147
|
+
$newXmlElement.SetAttribute("Orientation", $orientation)
|
|
148
|
+
$newXmlElement.SetAttribute("ProcessId", $processId)
|
|
149
|
+
$newXmlElement.SetAttribute("RuntimeId", $runtimeId)
|
|
150
|
+
$newXmlElement.SetAttribute("x", $x)
|
|
151
|
+
$newXmlElement.SetAttribute("y", $y)
|
|
152
|
+
$newXmlElement.SetAttribute("width", $width)
|
|
153
|
+
$newXmlElement.SetAttribute("height", $height)
|
|
154
|
+
|
|
155
|
+
$pattern = $null
|
|
156
|
+
|
|
157
|
+
if ($element.TryGetCurrentPattern([WindowPattern]::Pattern, [ref]$pattern)) {
|
|
158
|
+
$newXmlElement.SetAttribute("CanMaximize", $pattern.Current.CanMaximize)
|
|
159
|
+
$newXmlElement.SetAttribute("CanMinimize", $pattern.Current.CanMinimize)
|
|
160
|
+
$newXmlElement.SetAttribute("IsModal", $pattern.Current.IsModal)
|
|
161
|
+
$newXmlElement.SetAttribute("WindowVisualState", $pattern.Current.WindowVisualState)
|
|
162
|
+
$newXmlElement.SetAttribute("WindowInteractionState", $pattern.Current.WindowInteractionState)
|
|
163
|
+
$newXmlElement.SetAttribute("IsTopmost", $pattern.Current.IsTopmost)
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
if ($element.TryGetCurrentPattern([TransformPattern]::Pattern, [ref]$pattern)) {
|
|
167
|
+
$newXmlElement.SetAttribute("CanRotate", $pattern.Current.CanRotate)
|
|
168
|
+
$newXmlElement.SetAttribute("CanResize", $pattern.Current.CanResize)
|
|
169
|
+
$newXmlElement.SetAttribute("CanMove", $pattern.Current.CanMove)
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
# TODO: more to be added depending on the available patterns
|
|
173
|
+
|
|
174
|
+
if ($null -eq $xmlElement) {
|
|
175
|
+
$xmlElement = $xmlDoc.AppendChild($newXmlElement)
|
|
176
|
+
} else {
|
|
177
|
+
$xmlElement = $xmlElement.AppendChild($newXmlElement)
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
$elementsToProcess = New-Object System.Collections.Queue
|
|
181
|
+
$element.FindAll([TreeScope]::Children, $cacheRequest.TreeFilter) | ForEach-Object {
|
|
182
|
+
$elementsToProcess.Enqueue($_)
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
while ($elementsToProcess.Count -gt 0) {
|
|
186
|
+
$currentElement = $elementsToProcess.Dequeue()
|
|
187
|
+
Get-PageSource $currentElement $xmlDoc $xmlElement | Out-Null
|
|
188
|
+
}
|
|
189
|
+
} catch {
|
|
190
|
+
# noop
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
return $xmlElement
|
|
194
|
+
}
|
|
195
195
|
`;
|
|
196
196
|
//# sourceMappingURL=functions.js.map
|
|
@@ -98,7 +98,7 @@ declare const commands: {
|
|
|
98
98
|
}): Promise<void>;
|
|
99
99
|
getAttributes(this: import("../driver").NovaWindows2Driver, arg: any): Promise<string>;
|
|
100
100
|
typeDelay(this: import("../driver").NovaWindows2Driver, args: {
|
|
101
|
-
delay: number;
|
|
101
|
+
delay: number | string;
|
|
102
102
|
} | string | number | undefined): Promise<void>;
|
|
103
103
|
getProperty(this: import("../driver").NovaWindows2Driver, propertyName: string, elementId: string): Promise<string>;
|
|
104
104
|
getAttribute(this: import("../driver").NovaWindows2Driver, propertyName: string, elementId: string): Promise<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/commands/index.ts"],"names":[],"mappings":"AASA,QAAA,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/commands/index.ts"],"names":[],"mappings":"AASA,QAAA,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAoBize,CAAC;;;mBAAurB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;iBAAknH,CAAC;SAAgB,CAAC;SAAgB,CAAC;cAAqB,CAAC;oBAA8B,CAAC;kBAA+G,CAAC;aAAoB,CAAC;yBAAgC,CAAC;;;sBAAgzG,CAAC;cAAqB,CAAC;cAAqB,CAAC;oBAA2B,CAAC;YAAmB,CAAC;YAAmB,CAAC;oBAA2B,CAAC;kBAA4F,CAAC;;;iBAA04H,CAAC;SAAgB,CAAC;SAAgB,CAAC;cAAqB,CAAC;cAAqB,CAAC;oBAA2B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAVt32B,CAAC;AAEF,KAAK,QAAQ,GAAG;KACX,GAAG,IAAI,MAAM,OAAO,QAAQ,GAAG,OAAO,QAAQ,CAAC,GAAG,CAAC;CACvD,CAAC;AAEF,OAAO,QAAQ,WAAW,CAAC;IACvB,UAAU,kBAAmB,SAAQ,QAAQ;KAAI;CACpD;AAED,eAAe,QAAQ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"powershell.d.ts","sourceRoot":"","sources":["../../../lib/commands/powershell.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"powershell.d.ts","sourceRoot":"","sources":["../../../lib/commands/powershell.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAiJ/C,wBAAsB,sBAAsB,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAuFpF;AAED,wBAAsB,6BAA6B,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAyC9G;AAED,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAuBtG;AAED,wBAAsB,0BAA0B,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAiCxF"}
|