Skip to content

Commit 9e0bc7b

Browse files
authored
Fix error in _WD_FrameEnter (#475)
1 parent 820a83e commit 9e0bc7b

File tree

2 files changed

+26
-29
lines changed

2 files changed

+26
-29
lines changed

CHANGELOG.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
Go to [legend](#legend---types-of-changes) for further information about the types of changes.
1111

12-
## [Unreleased]
12+
## [1.0.1] 2023-05-23
13+
14+
### Fixed
15+
16+
- _WD_FrameEnter: Remove GUID validation
1317

1418
### Project
1519

@@ -1090,7 +1094,8 @@ _WD_CapabilitiesDisplay
10901094
- Initial release
10911095

10921096

1093-
[Unreleased]: https://github.com/Danp2/au3WebDriver/compare/1.0.0...HEAD
1097+
[Unreleased]: https://github.com/Danp2/au3WebDriver/compare/1.0.1...HEAD
1098+
[1.0.1]: https://github.com/Danp2/au3WebDriver/compare/1.0.0...1.0.1
10941099
[1.0.0]: https://github.com/Danp2/au3WebDriver/compare/0.13.0...1.0.0
10951100
[0.13.0]: https://github.com/Danp2/au3WebDriver/compare/0.12.0...0.13.0
10961101
[0.12.0]: https://github.com/Danp2/au3WebDriver/compare/0.11.0...0.12.0

wd_helper.au3

Lines changed: 19 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,6 @@ EndFunc ;==>_WD_IsWindowTop
703703
; Return values .: Success - True.
704704
; Failure - WD Response error message (E.g. "no such frame") and sets @error to one of the following values:
705705
; - $_WD_ERROR_Exception
706-
; - $_WD_ERROR_InvalidArgue
707706
; Author ........: Decibel
708707
; Modified ......: Danp2, mLipok, jchd
709708
; Remarks .......: You can drill-down into nested frames by calling this function repeatedly or use identifier like 'null/2/0'
@@ -729,34 +728,27 @@ Func _WD_FrameEnter($sSession, $vIdentifier)
729728
ElseIf IsInt($vIdentifier) Then
730729
$sOption = '{"id":' & $vIdentifier & '}'
731730
Else
732-
_WinAPI_GUIDFromString("{" & $vIdentifier & "}")
733-
If @error Then
734-
$iErr = $_WD_ERROR_InvalidArgue
735-
Else
736-
$sOption = '{"id":' & __WD_JsonElement($vIdentifier) & '}'
737-
EndIf
731+
$sOption = '{"id":' & __WD_JsonElement($vIdentifier) & '}'
738732
EndIf
739733

740-
If $iErr = $_WD_ERROR_Success Then ; check if $vIdentifier was succesfully validated
741-
If Not $bIdentifierAsPath Then
742-
$sResponse = _WD_Window($sSession, "frame", $sOption)
743-
$iErr = @error
744-
Else
745-
Local $aIdentifiers = StringSplit($vIdentifier, '/')
746-
For $i = 1 To $aIdentifiers[0]
747-
If String($aIdentifiers[$i]) = 'null' Then
748-
$aIdentifiers[$i] = '{"id":null}'
749-
Else
750-
$aIdentifiers[$i] = '{"id":' & $aIdentifiers[$i] & '}'
751-
EndIf
752-
$sResponse = _WD_Window($sSession, "frame", $aIdentifiers[$i])
753-
If Not @error Then ContinueLoop
734+
If Not $bIdentifierAsPath Then
735+
$sResponse = _WD_Window($sSession, "frame", $sOption)
736+
$iErr = @error
737+
Else
738+
Local $aIdentifiers = StringSplit($vIdentifier, '/')
739+
For $i = 1 To $aIdentifiers[0]
740+
If String($aIdentifiers[$i]) = 'null' Then
741+
$aIdentifiers[$i] = '{"id":null}'
742+
Else
743+
$aIdentifiers[$i] = '{"id":' & $aIdentifiers[$i] & '}'
744+
EndIf
745+
$sResponse = _WD_Window($sSession, "frame", $aIdentifiers[$i])
746+
If Not @error Then ContinueLoop
754747

755-
$iErr = @error
756-
$sMessage = ' Error on ID#' & $i & ' > ' & $aIdentifiers[$i]
757-
ExitLoop
758-
Next
759-
EndIf
748+
$iErr = @error
749+
$sMessage = ' Error on ID#' & $i & ' > ' & $aIdentifiers[$i]
750+
ExitLoop
751+
Next
760752
EndIf
761753

762754
If $iErr = $_WD_ERROR_Success Then
@@ -769,7 +761,7 @@ Func _WD_FrameEnter($sSession, $vIdentifier)
769761
Else
770762
$sValue = True
771763
EndIf
772-
ElseIf $iErr <> $_WD_ERROR_InvalidArgue And Not $_WD_DetailedErrors Then
764+
ElseIf Not $_WD_DetailedErrors Then
773765
$iErr = $_WD_ERROR_Exception
774766
EndIf
775767

0 commit comments

Comments
 (0)