Files
004_comission/armandarmand/task1/task1-ticket1/_ref/VBScript/SimpleGoogleSearch(Firefox).vbs
louiscklaw ce9a4aa9b3 update,
2025-01-31 19:27:58 +08:00

30 lines
1.6 KiB
Plaintext


'
' VBScript example using the Windows scripting engine
'
Class Script
Dim driver
Sub Class_Initialize
Set Waiter = CreateObject("Selenium.Waiter")
Set Assert = CreateObject("Selenium.Assert")
Set driver = CreateObject("Selenium.FirefoxDriver")
'open the browser and the page
driver.Get "https://www.google.co.uk"
'type into the search input box
driver.FindElementByName("q").SendKeys "Eiffel tower" & driver.Keys.Return
'waits for the title
While Waiter.Not(Instr(driver.Title, "Eiffel tower")): Wend
'waits for the user to click OK
WScript.Echo "Click OK to quit the browser"
End Sub
Sub Class_Terminate
driver.Quit 'Stop the browser
End Sub
End Class
Set s = New Script