@@ -23,7 +23,8 @@ Local $aDemoSuite[][2] = [["DemoTimeouts", False], _
23
23
[" DemoFrames" , False ], _
24
24
[" DemoActions" , False ], _
25
25
[" DemoDownload" , False ], _
26
- [" DemoWindows" , False ]]
26
+ [" DemoWindows" , False ], _
27
+ [" DemoUpload" , False ]]
27
28
28
29
Local $aDebugLevel [][2 ] = [[" None" , $_WD_DEBUG_None ], _
29
30
[" Error" , $_WD_DEBUG_Error ], _
@@ -325,6 +326,16 @@ Func DemoWindows()
325
326
FileClose ($hFileOpen )
326
327
EndFunc
327
328
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
+
328
339
Func SetupGecko()
329
340
_WD_Option(' Driver' , ' geckodriver.exe' )
330
341
_WD_Option(' DriverParams' , ' --log trace' )
0 commit comments