Milchmann wrote: ↑20 May 2022, 03:17
Hi,
read above as I made few changes. please get latest repo.
I have 3 scripts accessing Chrome at the same time. So far I have helped myself by opening a new session each time, and then assigning it to the respective script. I can then omit this.
arg parameters I can still assign to each session individually ( different path, incognito, etc)?
I will try the new one on Monday. Top
I would like to gently inquire if you can still answer/eliminate these questions/errors for me?
Xeo786 wrote: ↑
Yesterday, 10:43
Milchmann wrote: ↑
Yesterday, 08:52
Code: Select all - Download - Toggle Line numbers
Code: Select all
MsgBox % "CDP Frame no " k " : Number of Tags : " frame.QuerySelectorAll("input").length()
Page/frame has no input element
How can I then access the frame, for example to insert data into the input element?
Code: Select all
. "`nbody len from CDP " Page.cdp.QuerySelectorAll("body").length()
. "`nkeywords len from Basic " Page.QuerySelectorAll("#keywords").length() ; autohkey search
does not work yet
Code: Select all
Page.QuerySelector("#keywords").sendkey("ABC/")
works, thanks
And a general question.
It is very confusing to have Rufaydium as basic and as cdp. Can't these two be combined into one.
Especially because in addition to get .value which is controlled by javascript I still need
Code: Select all
msgbox % driver.CDP.Evaluate("document.querySelectorAll(xxxx')[0].value;").value
must be called.
frames access methods for Basic and CDP are same now
There are Two ways to automate Chrome / chromium based browsers, 1) Basic 2) is CDP Chrome Devtools Protocls
Consider Webdriver Basic as simple human interactions with webpage, but sometime we need to edit/modify Page, then we have to use CDP
driver.CDP.Evaluate(js) simply evaluate JS is same as driver.ExecuteSync()
for example both method do same thing with different approach using CDP
Code: Select all
; using Evaluate JS
msgbox % driver.CDP.Evaluate("document.querySelectorAll('input')[0].value;").value
; using CDP Getelement
msgbox % driver.CDP.querySelectorAll("input")[0].value
but getting value is simple therefore we should use Basic
Code: Select all
msgbox % driver.querySelectorAll("input")[0].value
its better to use CDP when it comes to DOM manipulation for example changing html of some element
Code: Select all
; here we are changing HTML
msgbox % driver.CDP.querySelectorAll("input")[0].OuterHTML
htm = <div name="abc" id="abc" type="abc" title="abc" class="abc class">abc<div>
driver.CDP.querySelectorAll("input")[0].OuterHTML := htm
msgbox % driver.CDP.querySelectorAll("input")[0].OuterHTML
above code is also possible with basic
Code: Select all
; careful about case as JS is case sensitive
js = document.querySelectorAll("input")[0].outerHTML = '<div name="abc" id="abc" type="abc" title="abc" class="abc class">abc<div>'
driver.ExecuteSync(js)
all these methods uses different approaches, we now have multiple options, simple command doing complicated stuff and complicated commands doing simple stuff. its all depends on user knowledge and way of approach.
"When there is no gravity, there is absolute vacuum and light travel with no time" -Game changer theory