1. I test your code but if failed, script still try to download driver while it's already downloaded (geckodriver.exe, crc32:DC49CCC3) 2. GetCurrentSession is not exist because it's pseudo code as I mentioned above, this explains what pseudo code meansXeo786 wrote: ↑20 Aug 2022, 02:35this Fx := new Rufaydium() will download chromedriver, there is geckodriver for firefox please read this
Following code will download geckodriver,Fx.GetCurrentSession() is not Rufaydium class method (did you add this?), You need to learn how to get existing Session after even reloading AHK script see this,Code: Select all
Fx := new Rufaydium("geckodriver")
Following function is a example to get existing FF session,Code: Select all
FXPage := GetRufaydiumFX("someurlhere") return ; GetRufaydiumFX(URL) gets existing session ; stops us creatting multiple sessions again and again ; make sure do not manually close driver / FX.driver.exit() ; by Xeo786 GetRufaydiumFX(URL) { ; get Firefox geckodriver / runs chrome driver if not running, download driver if available in A_ScriptDir ; Run Firefox geckodriver with default parameters and loads deafult capabilities FX := new Rufaydium("geckodriver") Page := FX.getSessionByUrl(URL) ; check page (created by driver) if already exist if !isobject(page) ; checcking if Session with url exist { Page := FX.getSession(1,1) ; try getting first session first tab if isobject(page) ; if exist Page.NewTab() ; create new tab instead new session else ; if does not exist Page := FX.NewSession() ; create new session ; Page.Exit() if any session manually closed by user which causes lag Page.Navigate(URL) ; navigate } return page }
3. Your code mentions that it only check page created by driver
Code: Select all
Page := FX.getSessionByUrl(URL) ; check page (created by driver) if already exist
In case you forget, I post it again below
1. Open firefox, open target link, run ahk script below
2. Press win+F1
3. (Expect result) A message box shows: Rufaydium WebDriver 1.7.0 (no selenium/websocket)