Page 1 of 1

Rufaydium V2.1a

Posted: 20 Jan 2023, 07:03
by Xeo786
Rufaydium-Webdriver V2 Alpha
Rufaydium is a WebDriver Library for AutoHotkey V2 working only for chrome browser/chromeDriver for now. User have to download chromedriver.exe

You can find Rufaydium V2 Beta Here

GitHub
Same V1 repository link with "AHKV2" branch

Live JS bridge
Element.ahk aka Webdriver element all methods and properties from Webdriver have been pre-defined, Undefined properties and Call method will be executed directly to Session Active Tab's JavaScript console.

Code: Select all

Chrome := Rufaydium() ; 
Page := Chrome.NewSession()
Page.url := "https://www.autohotkey.com/boards"
Ele1 := Page.querySelector("#search-box") ; get element from document
ele :=  Ele1.querySelector("#keywords") ; get element from element
ele.focus() ; this method is not been defined in element.ahk therefore will be called into JS console

X := "12345"
ele.value := X ; value is undefined property will be __Set the value of element in question using JS execution

ele.abc := '["a","b"]' ; this array is going to set inside JavaScript >> this ["a","b"] AHK array so it will throw error
msgbox ele.abc[0] ; __get "abc[0]" using JS console
ele.abc[0] := "c" ; __set "abc[0]" using JS console
msgbox ele.abc[0]

page.Quit() ; close page
Chrome.driver.Exit() ; close driver
exitapp
Edit:
Capabilities.ahk added

Re: Rufaydium V2.1a

Posted: 05 May 2023, 19:30
by kairushinjuu
Hello, was just wondering if you could explain how to deal with checkboxes, I tried "click()" but it came back with an integer expected error
this is the html for the element in question

Code: Select all

<input type="checkbox" class="create-terms__input" name="agree_terms" value="1" tabindex="7" required="">
changing the "value" doesn't seem to change it to checked. Any help would be appreciated :D

Thank you

Re: Rufaydium V2.1a

Posted: 06 May 2023, 12:22
by Xeo786
kairushinjuu wrote:
05 May 2023, 19:30
Hello, was just wondering if you could explain how to deal with checkboxes, I tried "click()" but it came back with an integer expected error
this is the html for the element in question

Code: Select all

<input type="checkbox" class="create-terms__input" name="agree_terms" value="1" tabindex="7" required="">
changing the "value" doesn't seem to change it to checked. Any help would be appreciated :D

Thank you
have you tried element.click()

Re: Rufaydium V2.1a

Posted: 15 Jun 2023, 00:08
by setered
Hello. I ran your example and received:

Error: (126) The specified module could not be found.

143: {
144: If !(module := DllCall('LoadLibrary', 'str', path, 'ptr'))
▶ 145: Throw OSError(A_LastError)
146: module_load_addr := DllCall('GetProcAddress', 'ptr', module, 'astr', 'ahk2_module_load', 'ptr') || DllCall('GetProcAddress', 'ptr', module, 'ptr', 1, 'ptr')
147: If !module_load_addr

Call stack:
\AutoHotkey\Lib\Rufaydium\JSON\Native.ahk (145) : [Native.LoadModule] Throw OSError(A_LastError)
\AutoHotkey\Lib\Rufaydium\JSON.ahk (8) : [JSON.__New] Native.LoadModule('.\JSON\' (A_PtrSize * 8) 'bit\ahk-json.dll', ['JSON'])
\AutoHotkey\Lib\Rufaydium\JSON.ahk (6) : [] JSON

How to me to correct it? I am a beginner in AHK.