Skip to content

Commit 9d8d589

Browse files
authored
Fix _WD_Window (#12)
Fixed: _WD_Window implementation of Maximize, Minimize, Fullscreen, & Screenshot Removed: Normal option from _WD_Window Added: Rect option to _WD_Window
1 parent 53e27d1 commit 9d8d589

File tree

1 file changed

+35
-5
lines changed

1 file changed

+35
-5
lines changed

wd_core.au3

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@
2424
; AutoIt Version : v3.3.14.3
2525
; ==============================================================================
2626
#cs
27+
V0.1.0.8
28+
- Changed: Improve error handling in _WD_Attach
29+
- Fixed: Missing "window" in URL for _WD_Window
30+
- Fixed: Header entry for _WD_Option
31+
- Added: Reference to Edge driver
32+
- Fixed: _WD_Window implementation of Maximize, Minimize, Fullscreen, & Screenshot
33+
- Removed: Normal option from _WD_Window
34+
- Added: Rect option to _WD_Window
35+
2736
V0.1.0.7
2837
- Changed: Add $sOption parameter to _WD_Action
2938
- Changed: Implemented "Actions" command in _WD_Action
@@ -99,7 +108,7 @@
99108

100109

101110
#Region Global Constants
102-
Global Const $__WDVERSION = "0.1.0.7"
111+
Global Const $__WDVERSION = "0.1.0.8"
103112

104113
Global Const $_WD_LOCATOR_ByID = "id"
105114
Global Const $_WD_LOCATOR_ByName = "name"
@@ -438,7 +447,7 @@ EndFunc ;==>_WD_Action
438447
; | Maximize
439448
; | Minimize
440449
; | Fullscreen
441-
; | Normal
450+
; | Rect
442451
; | Screemshot
443452
; | Close
444453
; | Switch
@@ -483,8 +492,29 @@ Func _WD_Window($sSession, $sCommand, $sOption = '')
483492
$sResult = Json_Get($sJSON, "[value]")
484493
EndIf
485494

486-
Case 'maximize', 'minimize', 'fullscreen', 'normal', 'screenshot'
487-
$sResponse = __WD_Get($_WD_BASE_URL & ":" & $_WD_PORT & "/session/" & $sSession & "/window/" & $sCommand)
495+
Case 'maximize', 'minimize', 'fullscreen'
496+
$sResponse = __WD_Post($_WD_BASE_URL & ":" & $_WD_PORT & "/session/" & $sSession & "/window/" & $sCommand, $sOption)
497+
$iErr = @error
498+
499+
If $iErr = $_WD_ERROR_Success Then
500+
$sResult = $sResponse
501+
EndIf
502+
503+
Case 'rect'
504+
If $sOption = '' Then
505+
$sResponse = __WD_Get($_WD_BASE_URL & ":" & $_WD_PORT & "/session/" & $sSession & "/window/" & $sCommand)
506+
Else
507+
$sResponse = __WD_Post($_WD_BASE_URL & ":" & $_WD_PORT & "/session/" & $sSession & "/window/" & $sCommand, $sOption)
508+
EndIf
509+
510+
$iErr = @error
511+
512+
If $iErr = $_WD_ERROR_Success Then
513+
$sResult = $sResponse
514+
EndIf
515+
516+
Case 'screenshot'
517+
$sResponse = __WD_Get($_WD_BASE_URL & ":" & $_WD_PORT & "/session/" & $sSession & $sCommand)
488518
$iErr = @error
489519

490520
If $iErr = $_WD_ERROR_Success Then
@@ -522,7 +552,7 @@ Func _WD_Window($sSession, $sCommand, $sOption = '')
522552
EndIf
523553

524554
Case Else
525-
Return SetError(__WD_Error($sFuncName, $_WD_ERROR_InvalidDataType, "(Window|Handles|Maximize|Minimize|Fullscreen:Normal|Screenshot|Close|Switch|Frame|Parent) $sCommand=>" & $sCommand), 0, "")
555+
Return SetError(__WD_Error($sFuncName, $_WD_ERROR_InvalidDataType, "(Window|Handles|Maximize|Minimize|Fullscreen|Rect|Screenshot|Close|Switch|Frame|Parent) $sCommand=>" & $sCommand), 0, "")
526556

527557
EndSwitch
528558

0 commit comments

Comments
 (0)