Rufaydium AutoHotkey WebDriver

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
OldCityCat
Posts: 6
Joined: 11 Sep 2021, 16:46

Rufaydium AutoHotkey WebDriver

Post by OldCityCat » 03 Jul 2022, 09:53

I'm hoping someone can help out a newbie with what I thought was going to be simple script.

Code: Select all

#Include Rufaydium.ahk
Driver := new RunDriver("C:\Rufaydium-Webdriver-main\chromedriver.exe")
Chrome := new Rufaydium(Driver)
Page := Chrome.NewSession()
Page.Navigate("https://www.autohotkey.com/")
return
I have installed the latest chrome drive
I have verified the path to the chrome drive
All required #include files are in the C:\Rufaydium-Webdriver-main folder
But when I run the script I get a Chrome session "localhost:8080" with "localhost refused to connect" error

Thank you in advance for any and all suggestions

OldCityCat

ahk7
Posts: 574
Joined: 06 Nov 2013, 16:35

Re: Rufaydium AutoHotkey WebDriver

Post by ahk7 » 03 Jul 2022, 13:50

No need to install anything or specify the path to webdriver, that is all taken care of automatically (it downloads the correct driver etc)

Please consult the documentation on GitHub https://github.com/Xeo786/Rufaydium-Webdriver#how-to-use

That basic example should work (the port in your error is incorrect for example as it needs to be 9515 - https://github.com/Xeo786/Rufaydium-Webdriver#driver-default-port

OldCityCat
Posts: 6
Joined: 11 Sep 2021, 16:46

Re: Rufaydium AutoHotkey WebDriver

Post by OldCityCat » 03 Jul 2022, 17:58

ahk7,
Thank you for your reply;
No need to install anything or specify the path to webdriver, that is all taken care of automatically (it downloads the correct driver etc)
Sorry maybe I should not have used "Install", I download the chromedrive based on my version of Chrome 103.0.5060.66 added to my %A_ScriptDir%
Please consult the documentation on GitHub https://github.com/Xeo786/Rufaydium-Webdriver#how-to-use
I have referred to How-to-use, and watched the "Automate Chrome with Rufaydium and AutoHotkey First Tutorial" https://www.the-automator.com/?s=Rufaydium
That basic example should work (the port in your error is incorrect for example as it needs to be 9515 - https://github.com/Xeo786/Rufaydium-Webdriver#driver-default-port
This was in the Chrome web address "localhost:8080" after running the script.

I get the same error with the following code;

Code: Select all

#Include Rufaydium.ahk
;Driver := new RunDriver("chromedriver.exe")
;Chrome := new Rufaydium("chromedriver.exe")
;Page := Chrome.NewSession()
;Page.Navigate("https://www.autohotkey.com/")
return
As you can see the only line running is the #Include

Once again thanks for your input.
OldCityCat

User avatar
Xeo786
Posts: 759
Joined: 09 Nov 2015, 02:43
Location: Karachi, Pakistan

Re: Rufaydium AutoHotkey WebDriver

Post by Xeo786 » 04 Jul 2022, 07:01

OldCityCat wrote:
03 Jul 2022, 17:58
ahk7,
Thank you for your reply;
No need to install anything or specify the path to webdriver, that is all taken care of automatically (it downloads the correct driver etc)
Sorry maybe I should not have used "Install", I download the chromedrive based on my version of Chrome 103.0.5060.66 added to my %A_ScriptDir%
Please consult the documentation on GitHub https://github.com/Xeo786/Rufaydium-Webdriver#how-to-use
I have referred to How-to-use, and watched the "Automate Chrome with Rufaydium and AutoHotkey First Tutorial" https://www.the-automator.com/?s=Rufaydium
That basic example should work (the port in your error is incorrect for example as it needs to be 9515 - https://github.com/Xeo786/Rufaydium-Webdriver#driver-default-port
This was in the Chrome web address "localhost:8080" after running the script.

I get the same error with the following code;

Code: Select all

#Include Rufaydium.ahk
;Driver := new RunDriver("chromedriver.exe")
;Chrome := new Rufaydium("chromedriver.exe")
;Page := Chrome.NewSession()
;Page.Navigate("https://www.autohotkey.com/")
return
As you can see the only line running is the #Include

Once again thanks for your input.
OldCityCat
1) Please Check Task manager and close are ChromeDriver that are already running,
2) Update Chrome (chrome usually update automatically )
3) Update Autohotkey

Run the following script to find out any issue you are facing......

Code: Select all

#include Rufaydium.ahk

Chrome := new Rufaydium("C:\Rufaydium-Webdriver-main\chromedriver.exe")

if ( Chrome.__class = "Rufaydium")
	Msgbox,,Check:, You have sucessfuly included the Rufaydium.ahk`nto Continue.... Press ok 
else
{
	msgbox,,Check:, Rufaydium.ahk is not properly included please learn how to #include libraries`nScript Exitting....!
	return
}

Chrome.Driver.visible := true
if WinExist("C:\Rufaydium-Webdriver-main\chromedriver.exe")
	Msgbox,,Check:, you can see Webdriver CMD is visible`nto Continue.... Press ok 
else
{
	msgbox,,Check:, % "issue: Driver Failed to run for unknown reason"
	. "`nDriver Exist: " FileExist("C:\Rufaydium-Webdriver-main\chromedriver.exe")
	. "`n`nScript Exitting ....!"
	return
}

Page := Chrome.NewSession()

if IsObject(Page)
	msgbox,, Check:, Session have been created`nif you do not see new chrome window opened there might be some issue`n`n Press ok to navigate
else
	msgbox,, Check:, Failed to created Chrome Session`nScriptExitting	

Page.Url := "https://www.autohotkey.com/boards/"

msgbox, page finished loading....!`npress ok to exit chrome and driver

Chrome.QuitAllSessions() ; close all session 
Chrome.Driver.Exit() ; then exits driver
msgbox, all session closed and Driver Exitted,`n`nNow Script is Exitting

return
"When there is no gravity, there is absolute vacuum and light travel with no time" -Game changer theory

Post Reply

Return to “Ask for Help (v1)”