Using Selenium with AutoHotkey- Cross browser automation!

Helpful script writing tricks and HowTo's
User avatar
rizwan4season
Posts: 11
Joined: 13 Nov 2020, 08:37

Re: Using Selenium with AutoHotkey- Cross browser automation!

14 Feb 2021, 09:04

I Want to use Edge Browser With Selenium Like a Chorme Browser
Need Help on this topic
burque505
Posts: 1447
Joined: 22 Jan 2017, 19:37

Re: Using Selenium with AutoHotkey- Cross browser automation!

15 Feb 2021, 12:44

Just found a SeleniumBasic for Selenium v3.141.000. Here is the link in Chinese(Mandarin?).
My own Mandarin is next to useless, so perhaps others in the forum can be of help. However, just using Google Translate gives a lot of clues.
It has reg and unreg .bat files.
I will now try to destroy my system by installing it. :crazy: I'm curious to see if it might be a significant improvement.

EDIT: This seems very useful indeed. It can control IE, Chrome, Edge (@rizwan4season, this might be worth a look), Opera and Safari out of the box, apparently. I will work on posting something in Ask for Help and Scripts and Functions. The Javascript execution seems to be quite good. It is easy to pass in arguments from the calling script and to return variables from the Javascript call. Async appears to work, unlike SeleniumBasic v2. I have had no success so far getting it to accept Selenium-style Keys.[Key] (i.e. Keys.Enter, Keys.Backspace, Keys.numpad0) from IWebElement.SendKeys(string), but strings themselves work fine. I am for now working around it with "Send, {Enter}" and so on.

Given "svc := ComObjCreate("SeleniumBasic.ChromeDriverService")", "svc.HideCommandPromptWindow := True" runs the script with a hidden command window. Very helpful.

Download link: https://files.cnblogs.com/files/ryueifu-VBA/SeleniumBasic.zip

EDIT: So far so good.

Code: Select all

wd := ComObjCreate("SeleniumBasic.IWebDriver")

si(wd)
wd.New_ChromeDriver
wd.URL := "https://www.autohotkey.com"
msgbox Got it.
wd.Quit
wd := ""

si(d) {
VarType := ComObjType(d)
IName   := ComObjType(d, "Name")
IID     := ComObjType(d, "IID")
CName   := ComObjType(d, "Class")  ; Requires [v1.1.26+]
CLSID   := ComObjType(d, "CLSID")  ; Requires [v1.1.26+]
MsgBox % "Variant type:`t" VarType
	. "`nInterface name:`t" IName "`nInterface ID:`t" IID
	. "`nClass name:`t" CName "`nClass ID (CLSID):`t" CLSID
}
Regards,
burque505
Last edited by BoBo on 18 Feb 2021, 17:39, edited 2 times in total.
Reason: Fixed broken download link. HTH

Return to “Tutorials”

Who is online

Users browsing this forum: No registered users and 4 guests