Rufaydium
Rufaydium is Webdriver Library that can support any chromium-based browser, It only requires Latest WebDriver,
it can download the latest driver and update the driver according to the web browsers version,
this ability is available for Chrome and MS Edge web browsers for now.
It utilizes Rest Api of W3C from https://www.w3.org/TR/webdriver2/
Rufaydium also supports Chrome Devtools Protocols same as chrome.ahk
Note: no need to install / setup selenium, Rufaydium is AHK's Selenium,
even Selenium 4 has not been implemented with the latest W3C Webdriver methods for many languages,
I am not a user of Selenium therefore, I am not sure if Rufaydium has more functionality compared to selenium
but I am sure Rufaydium is more flexible than selenium
Please feel free to point out issues or suggest functionality
I want you to Test Firefox, Edge, or any other Chromium based Web browser
I am planning to test them as soon as I get free time
Example
We can use all DOM methods of getting element, return element / element array, and that array is AHK array having class objects
Code: Select all
#Include Rufaydium.ahk
f1::
Chrome := new Rufaydium() ; this will return control over Chrome Browser
Page := Chrome.NewSession() ; creating session
Page.url := "https://www.autohotkey.com/boards/" ; can also use page.navigate(url)
Page.getElementByID("keywords").sendkey("Rufaydium`n") ; accessing element and sending keys
return
f12:: ; close all sessions first then exit the driver
Chrome := new Rufaydium() ; accessing browser
Chrome.QuitAllSessions() ; closing all session one by one
Chrome.driver.exit() ; exitting driver
return
Code: Select all
Chrome := new Rufaydium() ; will Download/Load Chrome driver as "chromedriver.exe" is default DriverName
MSEdge := new Rufaydium("msedgedriver.exe","--port=9516") ; will Download/Load MS Edge driver comunication port will be 9516
FireFox := new Rufaydium("geckodriver.exe") ; will Download/Load geckodriver for FireFox
opera := new Rufaydium("operadriver.exe") ; will Download/Load operadriver
Rufaydium does not exit the driver if the script is terminated, previously running driver can be accessed using the following methods, or multiple scripts can access one specific driver for automation,
Code: Select all
Chrome := new Rufaydium("chromedriver.exe")
Session := Chrome.NewSession()
Session := Chrome.getSession(1) ; this will return with Session by number sequencing from first created to latest created
Session := Chrome.getSession(1,2) ; this will return with first session and switch Second tab, Tabs count from left to right
Session := Chrome.getSessionByUrl(URL)
Session2 := Chrome.getSessionByTitle(Title)
Read Readme.md on Git for moreNote: above methods are based on the httpserver\sessions command which is not W3C standard, but Rufaydium uses ahk's functions readini, writeini & deleteini, to store and parse Session IDs, therefore getSessionByUrl() & getSessionByTitle() now support firefox session, this way Rufadium has the ability to continue geckodriver Sessions, or multiple AHK scripts can contorl firefox by sharing ActiveSessions.ini which records/delete sessionids at A_ScriptDir, hence that ini should be shared in such way in case scripts are being run from a different folder, in future update sharing ActiveSessions.ini will be no issue as I just had an idea.
GitHub
Releases
Download Main
Whats New
You can use any driver by downloading manually and they should work fine concerned browser version according to W3C standards.