Skip to content

Commit bcf9d3a

Browse files
committed
Chore: code cleanup
Standardize hungarian notation Tidy
1 parent 8b51e4f commit bcf9d3a

File tree

3 files changed

+106
-106
lines changed

3 files changed

+106
-106
lines changed

wd_core.au3

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -644,14 +644,14 @@ EndFunc ;==>_WD_Window
644644
; #FUNCTION# ====================================================================================================================
645645
; Name ..........: _WD_FindElement
646646
; Description ...: Find element(s) by designated strategy
647-
; Syntax ........: _WD_FindElement($sSession, $sStrategy, $sSelector[, $sStartNodeID = Default[, $lMultiple = Default[,
648-
; $lShadowRoot = Default]]])
647+
; Syntax ........: _WD_FindElement($sSession, $sStrategy, $sSelector[, $sStartNodeID = Default[, $bMultiple = Default[,
648+
; $bShadowRoot = Default]]])
649649
; Parameters ....: $sSession - Session ID from _WDCreateSession
650650
; $sStrategy - Locator strategy. See defined constant $_WD_LOCATOR_* for allowed values
651651
; $sSelector - Value to find
652652
; $sStartNodeID - [optional] ID to use as starting node. Default is ""
653-
; $lMultiple - [optional] Return multiple matching elements? Default is False
654-
; $lShadowRoot - [optional] Starting node is a shadow root? Default is False
653+
; $bMultiple - [optional] Return multiple matching elements? Default is False
654+
; $bShadowRoot - [optional] Starting node is a shadow root? Default is False
655655
;
656656
; Return values .: Success - Element ID(s) returned by web driver
657657
; Failure - ""
@@ -667,17 +667,17 @@ EndFunc ;==>_WD_Window
667667
; Link ..........: https://www.w3.org/TR/webdriver#element-retrieval
668668
; Example .......: No
669669
; ===============================================================================================================================
670-
Func _WD_FindElement($sSession, $sStrategy, $sSelector, $sStartNodeID = Default, $lMultiple = Default, $lShadowRoot = Default)
670+
Func _WD_FindElement($sSession, $sStrategy, $sSelector, $sStartNodeID = Default, $bMultiple = Default, $bShadowRoot = Default)
671671
Local Const $sFuncName = "_WD_FindElement"
672672
Local $sCmd, $sBaseCmd = '', $sResponse, $sResult, $iErr
673673
Local $oJson, $oValues, $sKey, $iRow, $aElements[0]
674674

675675
If $sStartNodeID = Default Then $sStartNodeID = ""
676-
If $lMultiple = Default Then $lMultiple = False
677-
If $lShadowRoot = Default Then $lShadowRoot = False
676+
If $bMultiple = Default Then $bMultiple = False
677+
If $bShadowRoot = Default Then $bShadowRoot = False
678678

679679
If $sStartNodeID Then
680-
$sBaseCmd = ($lShadowRoot) ? "/shadow/" : "/element/"
680+
$sBaseCmd = ($bShadowRoot) ? "/shadow/" : "/element/"
681681
$sBaseCmd &= $sStartNodeID
682682

683683
; Make sure using a relative selector if using xpath strategy
@@ -688,7 +688,7 @@ Func _WD_FindElement($sSession, $sStrategy, $sSelector, $sStartNodeID = Default,
688688
EndIf
689689

690690
If $iErr = $_WD_ERROR_Success Then
691-
$sCmd = '/element' & (($lMultiple) ? 's' : '')
691+
$sCmd = '/element' & (($bMultiple) ? 's' : '')
692692
$sSelector = __WD_EscapeString($sSelector)
693693

694694
$sResponse = __WD_Post($_WD_BASE_URL & ":" & $_WD_PORT & "/session/" & $sSession & $sBaseCmd & $sCmd, '{"using":"' & $sStrategy & '","value":"' & $sSelector & '"}')
@@ -697,7 +697,7 @@ Func _WD_FindElement($sSession, $sStrategy, $sSelector, $sStartNodeID = Default,
697697

698698
If $iErr = $_WD_ERROR_Success Then
699699
If $_WD_HTTPRESULT = $HTTP_STATUS_OK Then
700-
If $lMultiple Then
700+
If $bMultiple Then
701701

702702
$oJson = Json_Decode($sResponse)
703703
$oValues = Json_Get($oJson, '[value]')
@@ -733,7 +733,7 @@ Func _WD_FindElement($sSession, $sStrategy, $sSelector, $sStartNodeID = Default,
733733
Return SetError(__WD_Error($sFuncName, $iErr, "HTTP status = " & $_WD_HTTPRESULT), $_WD_HTTPRESULT, "")
734734
EndIf
735735

736-
Return SetError($_WD_ERROR_Success, $_WD_HTTPRESULT, ($lMultiple) ? $aElements : $sResult)
736+
Return SetError($_WD_ERROR_Success, $_WD_HTTPRESULT, ($bMultiple) ? $aElements : $sResult)
737737
EndFunc ;==>_WD_FindElement
738738

739739
; #FUNCTION# ====================================================================================================================
@@ -859,11 +859,11 @@ EndFunc ;==>_WD_ElementAction
859859
; #FUNCTION# ====================================================================================================================
860860
; Name ..........: _WD_ExecuteScript
861861
; Description ...: Execute Javascipt commands
862-
; Syntax ........: _WD_ExecuteScript($sSession, $sScript[, $sArguments = Default[, $lAsync = Default]])
862+
; Syntax ........: _WD_ExecuteScript($sSession, $sScript[, $sArguments = Default[, $bAsync = Default]])
863863
; Parameters ....: $sSession - Session ID from _WDCreateSession
864864
; $sScript - Javascript command(s) to run
865865
; $sArguments - [optional] String of arguments in JSON format
866-
; $lAsync - [optional] Perform request asyncronously? Default is False.
866+
; $bAsync - [optional] Perform request asyncronously? Default is False.
867867
; Return values .: Raw response from web driver
868868
; @ERROR - $_WD_ERROR_Success
869869
; - $_WD_ERROR_Exception
@@ -877,17 +877,17 @@ EndFunc ;==>_WD_ElementAction
877877
; Link ..........: https://www.w3.org/TR/webdriver#executing-script
878878
; Example .......: No
879879
; ===============================================================================================================================
880-
Func _WD_ExecuteScript($sSession, $sScript, $sArguments = Default, $lAsync = Default)
880+
Func _WD_ExecuteScript($sSession, $sScript, $sArguments = Default, $bAsync = Default)
881881
Local Const $sFuncName = "_WD_ExecuteScript"
882882
Local $sResponse, $sData, $sCmd
883883

884884
If $sArguments = Default Then $sArguments = ""
885-
If $lAsync = Default Then $lAsync = False
885+
If $bAsync = Default Then $bAsync = False
886886

887887
$sScript = __WD_EscapeString($sScript)
888888

889889
$sData = '{"script":"' & $sScript & '", "args":[' & $sArguments & ']}'
890-
$sCmd = ($lAsync) ? 'async' : 'sync'
890+
$sCmd = ($bAsync) ? 'async' : 'sync'
891891

892892
$sResponse = __WD_Post($_WD_BASE_URL & ":" & $_WD_PORT & "/session/" & $sSession & "/execute/" & $sCmd, $sData)
893893

@@ -1224,7 +1224,7 @@ EndFunc ;==>_WD_Option
12241224
; ===============================================================================================================================
12251225
Func _WD_Startup()
12261226
Local Const $sFuncName = "_WD_Startup"
1227-
Local $sFunction, $lLatest, $sUpdate, $sFile, $pid
1227+
Local $sFunction, $bLatest, $sUpdate, $sFile, $pid
12281228

12291229
If $_WD_DRIVER = "" Then
12301230
Return SetError(__WD_Error($sFuncName, $_WD_ERROR_InvalidValue, "Location for Web Driver not set." & @CRLF), 0, 0)
@@ -1236,7 +1236,7 @@ Func _WD_Startup()
12361236

12371237
If $_WD_DEBUG = $_WD_DEBUG_Info Then
12381238
$sFunction = "_WD_IsLatestRelease"
1239-
$lLatest = Call($sFunction)
1239+
$bLatest = Call($sFunction)
12401240

12411241
Select
12421242
Case @error = 0xDEAD And @extended = 0xBEEF
@@ -1245,10 +1245,10 @@ Func _WD_Startup()
12451245
Case @error
12461246
$sUpdate = " (Update status unknown [" & @error & "])"
12471247

1248-
Case $lLatest
1248+
Case $bLatest
12491249
$sUpdate = " (Up to date)"
12501250

1251-
Case Not $lLatest
1251+
Case Not $bLatest
12521252
$sUpdate = " (Update available)"
12531253

12541254
EndSelect

wd_demo.au3

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
Local Const $sElementSelector = "//input[@name='q']"
99

1010
Local $sDesiredCapabilities, $iIndex, $sSession
11-
Local $nMsg, $lProcess = False
11+
Local $nMsg, $bProcess = False
1212

1313
Local $aBrowsers[][2] = _
1414
[["Firefox", SetupGecko], _
@@ -72,7 +72,7 @@ While 1
7272
Case $idDebugging
7373

7474
Case $idButton
75-
$lProcess = True
75+
$bProcess = True
7676
ExitLoop
7777

7878
Case Else
@@ -94,7 +94,7 @@ $_WD_DEBUG = $aDebugLevel[_GUICtrlComboBox_GetCurSel($idDebugging)][1]
9494
Call($aBrowsers[_GUICtrlComboBox_GetCurSel($idBrowsers)][1])
9595

9696
GUIDelete($hGUI)
97-
If Not $lProcess Then Exit
97+
If Not $bProcess Then Exit
9898

9999
_WD_Startup()
100100

@@ -399,7 +399,7 @@ Func SetupChrome()
399399
_WD_Option('Port', 9515)
400400
_WD_Option('DriverParams', '--verbose --log-path="' & @ScriptDir & '\chrome.log"')
401401

402-
$sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "excludeSwitches": [ "enable-automation"], "useAutomationExtension": false }}}}'
402+
$sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "excludeSwitches": [ "enable-automation"]}}}}'
403403
EndFunc ;==>SetupChrome
404404

405405
Func SetupEdge()

0 commit comments

Comments
 (0)