@Thoughtfu1Tux, sorry for this late reply. It's late because I hadn't found
SeleniumBasic 3.141.0.0 yet.
I find Selenium for AHK useful too, and although a lot of websites will detect I'm using Selenium and kick me off, for those that don't many things are just easier than they are with Chrome.ahk.
Here is some sample code for you. If you feel like trying it and run into any installation problems let me know.
Code: Select all
;https://www.autohotkey.com/boards/viewtopic.php?f=7&t=87159
SetBatchLines, -1
wd := ComObjCreate("SeleniumBasic.IWebDriver")
svc := ComObjCreate("SeleniumBasic.FirefoxDriverService")
options := ComObjCreate("SeleniumBasic.FirefoxOptions")
svc.CreateDefaultService.driverPath := "C:\Downloads\WebDrivers" ; the webdrivers are here for me
svc.HideCommandPromptWindow := True
wd.New_FirefoxDriver(svc,Options)
wd.Manage.Window.Maximize
wd.URL := "https://demoqa.com/alerts"
loop {
ready := wd.ExecuteScript("return document.readyState")
if (ready := "complete")
break
else
sleep, 1000
}
Actions.Create(wd)
wd.FindElementById("promtButton").click
sleep, 2000
wd.SwitchTo.Alert.SendKeys("Thoughtfu1Tux")
sleep 2000
wd.SwitchTo.Alert.Accept
sleep 4000
msgbox, ,I will dismiss myself , AHK filled in the prompt`nand submitted it.`nFirefox shows keys sent.`nChrome does not`!, 2
sleep 3000
wd.Quit()
; This page was helpful: https://www.toolsqa.com/selenium-webdriver/alerts-in-selenium/
Regards,
burque505
EDIT: Poor quality animation of SeleniumBasic handling popups/prompts.
- handle_popups_small.gif (355.71 KiB) Viewed 954 times