@@ -594,23 +594,18 @@ Func _WD_Window($sSession, $sCommand, $sOption = Default)
594
594
EndSwitch
595
595
596
596
If $iErr = $_WD_ERROR_Success Then
597
- If $_WD_HTTPRESULT = $HTTP_STATUS_OK Then
598
-
599
- Switch $sCommand
600
- Case ' close' , ' frame' , ' fullscreen' , ' maximize' , ' minimize' , ' parent' , ' switch'
601
- $sResult = $sResponse
597
+ Switch $sCommand
598
+ Case ' close' , ' frame' , ' fullscreen' , ' maximize' , ' minimize' , ' parent' , ' switch'
599
+ $sResult = $sResponse
602
600
603
- Case ' new'
604
- $oJSON = Json_Decode($sResponse )
605
- $sResult = Json_Get($oJSON , " [value][handle]" )
601
+ Case ' new'
602
+ $oJSON = Json_Decode($sResponse )
603
+ $sResult = Json_Get($oJSON , " [value][handle]" )
606
604
607
- Case Else
608
- $oJSON = Json_Decode($sResponse )
609
- $sResult = Json_Get($oJSON , $_WD_JSON_Value )
610
- EndSwitch
611
- Else
612
- $iErr = $_WD_ERROR_Exception
613
- EndIf
605
+ Case Else
606
+ $oJSON = Json_Decode($sResponse )
607
+ $sResult = Json_Get($oJSON , $_WD_JSON_Value )
608
+ EndSwitch
614
609
EndIf
615
610
616
611
Return SetError (__WD_Error($sFuncName , $iErr , $sParameters ), 0 , $sResult )
@@ -670,32 +665,27 @@ Func _WD_FindElement($sSession, $sStrategy, $sSelector, $sStartNodeID = Default,
670
665
EndIf
671
666
672
667
If $iErr = $_WD_ERROR_Success Then
673
- If $_WD_HTTPRESULT = $HTTP_STATUS_OK Then
674
- If $bMultiple Then
668
+ If $bMultiple Then
675
669
676
- $oJSON = Json_Decode($sResponse )
677
- $oValues = Json_Get($oJSON , $_WD_JSON_Value )
670
+ $oJSON = Json_Decode($sResponse )
671
+ $oValues = Json_Get($oJSON , $_WD_JSON_Value )
678
672
679
- If UBound ($oValues ) > 0 Then
680
- $sKey = " [" & $_WD_ELEMENT_ID & " ]"
673
+ If UBound ($oValues ) > 0 Then
674
+ $sKey = " [" & $_WD_ELEMENT_ID & " ]"
681
675
682
- Dim $aElements [UBound ($oValues )]
676
+ Dim $aElements [UBound ($oValues )]
683
677
684
- For $oValue In $oValues
685
- $aElements [$iRow ] = Json_Get($oValue , $sKey )
686
- $iRow += 1
687
- Next
688
- Else
689
- $iErr = $_WD_ERROR_NoMatch
690
- EndIf
678
+ For $oValue In $oValues
679
+ $aElements [$iRow ] = Json_Get($oValue , $sKey )
680
+ $iRow += 1
681
+ Next
691
682
Else
692
- $oJSON = Json_Decode($sResponse )
693
-
694
- $sResult = Json_Get($oJSON , $_WD_JSON_Element )
683
+ $iErr = $_WD_ERROR_NoMatch
695
684
EndIf
696
-
697
685
Else
698
- $iErr = $_WD_ERROR_Exception
686
+ $oJSON = Json_Decode($sResponse )
687
+
688
+ $sResult = Json_Get($oJSON , $_WD_JSON_Element )
699
689
EndIf
700
690
EndIf
701
691
@@ -791,27 +781,21 @@ Func _WD_ElementAction($sSession, $sElement, $sCommand, $sOption = Default)
791
781
EndSwitch
792
782
793
783
If $iErr = $_WD_ERROR_Success Then
794
- Switch $_WD_HTTPRESULT
795
- Case $HTTP_STATUS_OK
796
- Switch $sCommand
797
- Case ' clear' , ' click' , ' shadow'
798
- $sResult = $sResponse
799
-
800
- Case ' value'
801
- If $sOption Then
802
- $sResult = $sResponse
803
- Else
804
- $oJSON = Json_Decode($sResponse )
805
- $sResult = Json_Get($oJSON , $_WD_JSON_Value )
806
- EndIf
807
-
808
- Case Else
809
- $oJSON = Json_Decode($sResponse )
810
- $sResult = Json_Get($oJSON , $_WD_JSON_Value )
811
- EndSwitch
784
+ Switch $sCommand
785
+ Case ' clear' , ' click' , ' shadow'
786
+ $sResult = $sResponse
787
+
788
+ Case ' value'
789
+ If $sOption Then
790
+ $sResult = $sResponse
791
+ Else
792
+ $oJSON = Json_Decode($sResponse )
793
+ $sResult = Json_Get($oJSON , $_WD_JSON_Value )
794
+ EndIf
812
795
813
796
Case Else
814
- $iErr = $_WD_ERROR_Exception
797
+ $oJSON = Json_Decode($sResponse )
798
+ $sResult = Json_Get($oJSON , $_WD_JSON_Value )
815
799
EndSwitch
816
800
EndIf
817
801
0 commit comments