@@ -664,8 +664,7 @@ Func _WD_HighlightElement($sSession, $sElement, $iMethod = Default)
664
664
If $iMethod < 0 Or $iMethod > 3 Then $iMethod = 1
665
665
666
666
Local $sScript = " arguments[0].style='" & $aMethod [$iMethod ] & " '; return true;"
667
- Local $sJsonElement = __WD_JsonElement($sElement )
668
- Local $sResult = _WD_ExecuteScript($sSession , $sScript , $sJsonElement , Default , $_WD_JSON_Value )
667
+ Local $sResult = _WD_ExecuteScript($sSession , $sScript , __WD_JsonElement($sElement ), Default , $_WD_JSON_Value )
669
668
Local $iErr = @error
670
669
Return ($sResult = " true" ? SetError (0 , 0 , True ) : SetError ($iErr , 0 , False ))
671
670
EndFunc ; ==>_WD_HighlightElement
@@ -1145,7 +1144,7 @@ EndFunc ;==>_WD_GetShadowRoot
1145
1144
Func _WD_SelectFiles($sSession , $sStrategy , $sSelector , $sFilename )
1146
1145
Local Const $sFuncName = " _WD_SelectFiles"
1147
1146
1148
- Local $sResult = " 0" , $sJsonElement , $ sSavedEscape
1147
+ Local $sResult = " 0" , $sSavedEscape
1149
1148
Local $sElement = _WD_FindElement($sSession , $sStrategy , $sSelector )
1150
1149
Local $iErr = @error
1151
1150
@@ -1166,8 +1165,7 @@ Func _WD_SelectFiles($sSession, $sStrategy, $sSelector, $sFilename)
1166
1165
EndIf
1167
1166
1168
1167
If $iErr = $_WD_ERROR_Success Then
1169
- $sJsonElement = __WD_JsonElement($sElement )
1170
- $sResult = _WD_ExecuteScript($sSession , " return arguments[0].files.length" , $sJsonElement , Default , $_WD_JSON_Value )
1168
+ $sResult = _WD_ExecuteScript($sSession , " return arguments[0].files.length" , __WD_JsonElement($sElement ), Default , $_WD_JSON_Value )
1171
1169
$iErr = @error
1172
1170
If @error Then $sResult = " 0"
1173
1171
EndIf
@@ -1701,7 +1699,7 @@ EndFunc ;==>_WD_GetElementByName
1701
1699
; ===============================================================================================================================
1702
1700
Func _WD_SetElementValue($sSession , $sElement , $sValue , $iStyle = Default )
1703
1701
Local Const $sFuncName = " _WD_SetElementValue"
1704
- Local $sResult , $iErr , $sScript , $sJsonElement
1702
+ Local $sResult , $iErr , $sScript
1705
1703
1706
1704
If $iStyle = Default Then $iStyle = $_WD_OPTION_Standard
1707
1705
If $iStyle < $_WD_OPTION_Standard Or $iStyle > $_WD_OPTION_Advanced Then $iStyle = $_WD_OPTION_Standard
@@ -1713,8 +1711,7 @@ Func _WD_SetElementValue($sSession, $sElement, $sValue, $iStyle = Default)
1713
1711
1714
1712
Case $_WD_OPTION_Advanced
1715
1713
$sScript = " Object.getOwnPropertyDescriptor(arguments[0].__proto__, 'value').set.call(arguments[0], arguments[1]);arguments[0].dispatchEvent(new Event('input', { bubbles: true }));"
1716
- $sJsonElement = __WD_JsonElement($sElement )
1717
- $sResult = _WD_ExecuteScript($sSession , $sScript , $sJsonElement & ' ,"' & $sValue & ' "' )
1714
+ $sResult = _WD_ExecuteScript($sSession , $sScript , __WD_JsonElement($sElement ) & ' ,"' & $sValue & ' "' )
1718
1715
$iErr = @error
1719
1716
1720
1717
EndSwitch
@@ -1760,7 +1757,7 @@ EndFunc ;==>_WD_SetElementValue
1760
1757
; ===============================================================================================================================
1761
1758
Func _WD_ElementActionEx($sSession , $sElement , $sCommand , $iXOffset = Default , $iYOffset = Default , $iButton = Default , $iHoldDelay = Default , $sModifier = Default )
1762
1759
Local Const $sFuncName = " _WD_ElementActionEx"
1763
- Local $sAction , $sJavascript , $iErr , $sResult , $sJsonElement , $ iActionType = 1
1760
+ Local $sAction , $sJavascript , $iErr , $sResult , $iActionType = 1
1764
1761
1765
1762
If $iXOffset = Default Then $iXOffset = 0
1766
1763
If $iYOffset = Default Then $iYOffset = 0
@@ -1889,8 +1886,7 @@ Func _WD_ElementActionEx($sSession, $sElement, $sCommand, $iXOffset = Default, $
1889
1886
$iErr = @error
1890
1887
1891
1888
Case 2
1892
- $sJsonElement = __WD_JsonElement($sElement )
1893
- $sResult = _WD_ExecuteScript($sSession , $sJavascript , $sJsonElement , Default , $_WD_JSON_Value )
1889
+ $sResult = _WD_ExecuteScript($sSession , $sJavascript , __WD_JsonElement($sElement ), Default , $_WD_JSON_Value )
1894
1890
$iErr = @error
1895
1891
EndSwitch
1896
1892
0 commit comments