Skip to content

Commit 5ccbdb6

Browse files
committed
Chore: Update wd_ demo
Added DemoUpload
1 parent 1ce1b9d commit 5ccbdb6

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

wd_demo.au3

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ Local $aDemoSuite[][2] = [["DemoTimeouts", False], _
2323
["DemoFrames", False], _
2424
["DemoActions", False], _
2525
["DemoDownload", False], _
26-
["DemoWindows", False]]
26+
["DemoWindows", False], _
27+
["DemoUpload", False]]
2728

2829
Local $aDebugLevel[][2] = [["None", $_WD_DEBUG_None], _
2930
["Error", $_WD_DEBUG_Error], _
@@ -325,6 +326,16 @@ Func DemoWindows()
325326
FileClose($hFileOpen)
326327
EndFunc
327328

329+
Func DemoUpload()
330+
; Uses files created in DemoWindows
331+
_WD_Navigate($sSession, "https://www.htmlquick.com/reference/tags/input-file.html")
332+
_WD_SelectFiles($sSession, $_WD_LOCATOR_ByXPath, "//section[@id='examples']//input[@name='uploadedfile']", @ScriptDir & "\Screen1.png")
333+
_WD_SelectFiles($sSession, $_WD_LOCATOR_ByXPath, "//p[contains(text(),'Upload files:')]//input[@name='uploadedfiles[]']", @ScriptDir & "\Screen1.png" & @LF & @ScriptDir & "\Screen2.png")
334+
335+
Local $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//p[contains(text(),'Upload files:')]//input[2]")
336+
_WD_ElementAction($sSession, $sElement, 'click')
337+
EndFunc
338+
328339
Func SetupGecko()
329340
_WD_Option('Driver', 'geckodriver.exe')
330341
_WD_Option('DriverParams', '--log trace')

0 commit comments

Comments
 (0)