@@ -2879,24 +2879,26 @@ EndFunc ;==>_WD_DispatchEvent
2879
2879
; #FUNCTION# ====================================================================================================================
2880
2880
; Name ..........: _WD_GetTable
2881
2881
; Description ...: Return all elements of a table.
2882
- ; Syntax ........: _WD_GetTable($sSession, $sBaseElement [, $sRowsSelector = Default[, $sColsSelector = Default]])
2882
+ ; Syntax ........: _WD_GetTable($sSession, $sStrategy, $sSelector [, $sRowsSelector = Default[, $sColsSelector = Default]])
2883
2883
; Parameters ....: $sSession - Session ID from _WD_CreateSession
2884
- ; $sBaseElement - XPath of the table to return
2884
+ ; $sStrategy - Locator strategy. See defined constant $_WD_LOCATOR_* for allowed values
2885
+ ; $sSelector - Indicates how the WebDriver should traverse through the HTML DOM to locate the desired <table> element.
2885
2886
; $sRowsSelector - [optional] Rows CSS selector. Default is "tr".
2886
2887
; $sColsSelector - [optional] Columns CSS selector. Default is "td, th".
2887
2888
; Return values .: Success - 2D array.
2888
2889
; Failure - "" (empty string) and sets @error to one of the following values:
2889
2890
; - $_WD_ERROR_Exception
2890
2891
; - $_WD_ERROR_NoMatch
2891
2892
; Author ........: danylarson
2892
- ; Modified ......: water, danp2
2893
+ ; Modified ......: water, danp2, mLipok
2893
2894
; Remarks .......:
2894
2895
; Related .......: _WD_FindElement, _WD_ElementAction, _WD_LastHTTPResult
2895
2896
; Link ..........: https://www.autoitscript.com/forum/topic/191990-webdriver-udf-w3c-compliant-version-01182020/page/18/?tab=comments#comment-1415164
2896
2897
; Example .......: No
2897
2898
; ===============================================================================================================================
2898
- Func _WD_GetTable($sSession , $sBaseElement , $sRowsSelector = Default , $sColsSelector = Default )
2899
+ Func _WD_GetTable($sSession , $sStrategy , $sSelector , $sRowsSelector = Default , $sColsSelector = Default )
2899
2900
Local Const $sFuncName = " _WD_GetTable"
2901
+ Local Const $sParameters = ' Parameters: Strategy=' & $sStrategy & ' Selector=' & $sSelector & ' RowsSelector=' & $sRowsSelector & ' ColsSelector=' & $sColsSelector
2900
2902
Local $sElement , $aTable = ' '
2901
2903
$_WD_HTTPRESULT = 0
2902
2904
$_WD_HTTPRESPONSE = ' '
@@ -2905,7 +2907,7 @@ Func _WD_GetTable($sSession, $sBaseElement, $sRowsSelector = Default, $sColsSele
2905
2907
If $sColsSelector = Default Then $sColsSelector = " td, th"
2906
2908
2907
2909
; Get the table element
2908
- $sElement = _WD_FindElement($sSession , $_WD_LOCATOR_ByXPath , $sBaseElement )
2910
+ $sElement = _WD_FindElement($sSession , $sStrategy , $sSelector )
2909
2911
Local $iErr = @error
2910
2912
2911
2913
If $iErr = $_WD_ERROR_Success Then
@@ -2924,7 +2926,7 @@ Func _WD_GetTable($sSession, $sBaseElement, $sRowsSelector = Default, $sColsSele
2924
2926
EndIf
2925
2927
EndIf
2926
2928
2927
- Return SetError (__WD_Error($sFuncName , $iErr ), 0 , $aTable )
2929
+ Return SetError (__WD_Error($sFuncName , $iErr , $sParameters ), 0 , $aTable )
2928
2930
EndFunc ; ==>_WD_GetTable
2929
2931
2930
2932
; #FUNCTION# ====================================================================================================================
0 commit comments