Skip to content

Commit

Permalink
_WD_FrameEnter parameters description (#54)
Browse files Browse the repository at this point in the history
parameters $sIndexOrID >> $vIdentifier
and descriptions extended
  • Loading branch information
mlipok committed Apr 4, 2021
1 parent a9f8f1f commit 4cbcf2d
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions wd_helper.au3
Expand Up @@ -501,9 +501,9 @@ EndFunc ;==>_WD_IsWindowTop
; #FUNCTION# ====================================================================================================================
; Name ..........: _WD_FrameEnter
; Description ...: This will enter the specified frame for subsequent WebDriver operations.
; Syntax ........: _WD_FrameEnter($sSession, $sIndexOrID)
; Syntax ........: _WD_FrameEnter($sSession, $vIdentifier)
; Parameters ....: $sSession - Session ID from _WD_CreateSession
; $sIndexOrID - Integer index or Element ID
; $vIdentifier - Index (as 0-based Integer) or HTMLElement @ID (as String) or Null (Keyword)
; Return values .: Success - True
; Failure - WD Response error message (E.g. "no such frame")
; @ERROR - $_WD_ERROR_Success
Expand All @@ -515,17 +515,17 @@ EndFunc ;==>_WD_IsWindowTop
; Link ..........:
; Example .......: No
; ===============================================================================================================================
Func _WD_FrameEnter($sSession, $sIndexOrID)
Func _WD_FrameEnter($sSession, $vIdentifier)
Local Const $sFuncName = "_WD_FrameEnter"
Local $sOption
Local $sResponse, $oJSON
Local $sValue

;*** Encapsulate the value if it's an integer, assuming that it's supposed to be an Index, not ID attrib value.
If IsInt($sIndexOrID) Or IsKeyword($sIndexOrID) = $KEYWORD_NULL Then
$sOption = '{"id":' & $sIndexOrID & '}'
If IsInt($vIdentifier) Or IsKeyword($vIdentifier) = $KEYWORD_NULL Then
$sOption = '{"id":' & $vIdentifier & '}'
Else
$sOption = '{"id":{"' & $_WD_ELEMENT_ID & '":"' & $sIndexOrID & '"}}'
$sOption = '{"id":{"' & $_WD_ELEMENT_ID & '":"' & $vIdentifier & '"}}'
EndIf

$sResponse = _WD_Window($sSession, "frame", $sOption)
Expand All @@ -545,7 +545,6 @@ Func _WD_FrameEnter($sSession, $sIndexOrID)
EndIf

Return SetError($_WD_ERROR_Success, 0, $sValue)

EndFunc ;==>_WD_FrameEnter

; #FUNCTION# ====================================================================================================================
Expand Down

0 comments on commit 4cbcf2d

Please sign in to comment.