@@ -300,7 +300,7 @@ Func DemoTimeouts()
300
300
Local $oJSON = Json_Decode($sResponse )
301
301
Local $sTimouts = Json_Encode(Json_Get($oJSON , " [value]" ))
302
302
303
- _WD_Navigate($sSession , " http ://google.com" )
303
+ _WD_Navigate($sSession , " https ://google.com" )
304
304
305
305
; Set page load timeout
306
306
_WD_Timeouts($sSession , ' {"pageLoad":2000}' )
@@ -309,21 +309,21 @@ Func DemoTimeouts()
309
309
_WD_Timeouts($sSession )
310
310
311
311
; This should timeout
312
- _WD_Navigate($sSession , " http ://yahoo.com" )
312
+ _WD_Navigate($sSession , " https ://yahoo.com" )
313
313
314
314
; Restore initial settings
315
315
_WD_Timeouts($sSession , $sTimouts )
316
316
EndFunc ; ==>DemoTimeouts
317
317
318
318
Func DemoNavigation()
319
- _WD_Navigate($sSession , " http ://google.com" )
319
+ _WD_Navigate($sSession , " https ://google.com" )
320
320
ConsoleWrite (" - #" & @ScriptLineNumber & " : URL=" & _WD_Action($sSession , ' url' ) & @CRLF )
321
321
322
- _WD_NewTab($sSession , Default , Default , " http ://yahoo.com" )
322
+ _WD_NewTab($sSession , Default , Default , " https ://yahoo.com" )
323
323
ConsoleWrite (" - #" & @ScriptLineNumber & " : URL=" & _WD_Action($sSession , ' url' ) & @CRLF )
324
324
325
- ; _WD_Navigate($sSession, "http ://yahoo.com")
326
- _WD_NewTab($sSession , True , Default , ' http ://bing.com' , ' width=200,height=200' )
325
+ ; _WD_Navigate($sSession, "https ://yahoo.com")
326
+ _WD_NewTab($sSession , True , Default , ' https ://bing.com' , ' width=200,height=200' )
327
327
ConsoleWrite (" - #" & @ScriptLineNumber & " : URL=" & _WD_Action($sSession , ' url' ) & @CRLF )
328
328
329
329
_WD_Attach($sSession , " google.com" , " URL" )
@@ -337,7 +337,7 @@ EndFunc ;==>DemoNavigation
337
337
Func DemoElements()
338
338
Local $sElement , $aElements , $sValue , $sButton , $sResponse , $bDecode , $hFileOpen
339
339
340
- _WD_Navigate($sSession , " http ://google.com" )
340
+ _WD_Navigate($sSession , " https ://google.com" )
341
341
342
342
; Locate a single element
343
343
$sElement = _WD_FindElement($sSession , $_WD_LOCATOR_ByXPath , $sElementSelector )
@@ -395,7 +395,7 @@ Func DemoElements()
395
395
FileWrite ($hFileOpen , $bDecode )
396
396
FileClose ($hFileOpen )
397
397
398
- _WD_Navigate($sSession , " http ://demo.guru99.com/test/simple_context_menu.html" )
398
+ _WD_Navigate($sSession , " https ://demo.guru99.com/test/simple_context_menu.html" )
399
399
400
400
Sleep (2000 )
401
401
@@ -428,13 +428,14 @@ Func DemoScript()
428
428
$sValue = _WD_ExecuteScript($sSession , " dslfkjsdklfj;" , ' {}' , Default , $_WD_JSON_Value )
429
429
ConsoleWrite (" - #" & @ScriptLineNumber & " : ERROR=" & @error & " $sValue = " & $sValue & " _WD_LastHTTPResult = " & _WD_LastHTTPResult() & @CRLF )
430
430
431
- $sValue = _WD_ExecuteScript($sSession , " return $.ajax({url:'http://hosting105782.a2f0c.netcup.net/test.php',type:'post',dataType: 'text', data:'getaccount=1',success : function(text){return text;}});" , Default , $_WD_JSON_Value )
432
- ConsoleWrite (" - #" & @ScriptLineNumber & " : ERROR=" & @error & " $sValue = " & $sValue & " _WD_LastHTTPResult = " & _WD_LastHTTPResult() & @CRLF )
431
+ ; 2022-03-23 This website no longer exists
432
+ ; $sValue = _WD_ExecuteScript($sSession, "return $.ajax({url:'https://hosting105782.a2f0c.netcup.net/test.php',type:'post',dataType: 'text', data:'getaccount=1',success : function(text){return text;}});", Default, $_WD_JSON_Value)
433
+ ; ConsoleWrite("- #" & @ScriptLineNumber & " : ERROR=" & @error & " $sValue = " & $sValue & " _WD_LastHTTPResult = " & _WD_LastHTTPResult() & @CRLF)
433
434
EndFunc ; ==>DemoScript
434
435
435
436
Func DemoCookies()
436
437
ConsoleWrite (" - #" & @ScriptLineNumber & " : WD: Navigating:" & @CRLF )
437
- _WD_Navigate($sSession , " http ://google.com" )
438
+ _WD_Navigate($sSession , " https ://google.com" )
438
439
439
440
ConsoleWrite (" - #" & @ScriptLineNumber & " : WD: Get all cookies:" & @CRLF )
440
441
Local $sAllCookies = _WD_Cookies($sSession , ' getall' )
@@ -535,9 +536,7 @@ Func DemoFrames()
535
536
; changing context to first sub frame
536
537
_WD_FrameEnter($sSession , $sElement )
537
538
538
- Local $sButton = _WD_FindElement($sSession , $_WD_LOCATOR_ByXPath , " //button[@id='w3loginbtn']" )
539
- _WD_ElementAction($sSession , $sButton , ' click' )
540
- _WD_LoadWait($sSession , 2000 )
539
+ _WD_LinkClickByText($sSession , " Not Sure Where" )
541
540
542
541
_WD_FrameLeave($sSession )
543
542
$bIsWindowTop = _WD_IsWindowTop($sSession )
@@ -554,7 +553,7 @@ EndFunc ;==>DemoFrames
554
553
Func DemoActions()
555
554
Local $sElement , $sAction
556
555
557
- _WD_Navigate($sSession , " http ://google.com" )
556
+ _WD_Navigate($sSession , " https ://google.com" )
558
557
$sElement = _WD_FindElement($sSession , $_WD_LOCATOR_ByXPath , $sElementSelector )
559
558
ConsoleWrite (" - #" & @ScriptLineNumber & " : $sElement = " & $sElement & @CRLF )
560
559
@@ -588,14 +587,14 @@ Func DemoActions()
588
587
EndFunc ; ==>DemoActions
589
588
590
589
Func DemoDownload()
591
- _WD_Navigate($sSession , " http ://google.com" )
590
+ _WD_Navigate($sSession , " https ://google.com" )
592
591
593
592
; Get the website's URL
594
593
Local $sUrl = _WD_Action($sSession , ' url' )
595
594
596
595
; Find the element
597
- Local $sElement = _WD_FindElement($sSession , $_WD_LOCATOR_ByXPath , " //img[@id='hplogo ']" )
598
-
596
+ Local $sElement = _WD_FindElement($sSession , $_WD_LOCATOR_ByXPath , " //img[@alt='Google ']" )
597
+
599
598
If @error <> $_WD_ERROR_Success Then
600
599
; Try alternate element
601
600
$sElement = _WD_FindElement($sSession , $_WD_LOCATOR_ByXPath , " //div[@id='hplogo']//img" )
@@ -611,19 +610,19 @@ Func DemoDownload()
611
610
; Download the file
612
611
_WD_DownloadFile($sUrl , @ScriptDir & " \testimage.png" )
613
612
614
- _WD_DownloadFile(" http ://www.google.com/notexisting.jpg" , @ScriptDir & " \testimage2.jpg" )
613
+ _WD_DownloadFile(" https ://www.google.com/notexisting.jpg" , @ScriptDir & " \testimage2.jpg" )
615
614
EndIf
616
615
EndFunc ; ==>DemoDownload
617
616
618
617
Func DemoWindows()
619
618
Local $sResponse , $hFileOpen , $sHnd1 , $sHnd2 , $bDecode , $oWRect
620
619
621
620
$sHnd1 = ' {"handle":"' & _WD_Window($sSession , " window" ) & ' "}'
622
- _WD_Navigate($sSession , " http ://google.com" )
621
+ _WD_Navigate($sSession , " https ://google.com" )
623
622
624
623
_WD_NewTab($sSession )
625
624
$sHnd2 = ' {"handle":"' & _WD_Window($sSession , " window" ) & ' "}'
626
- _WD_Navigate($sSession , " http ://yahoo.com" )
625
+ _WD_Navigate($sSession , " https ://yahoo.com" )
627
626
628
627
; Get window coordinates
629
628
$oWRect = _WD_Window($sSession , ' rect' )
0 commit comments