Fork me on GitHub

Hi! I’m new using etaoin. I’m calling (e/click-single driver [{:tag :div :class "faculty_course_title"} {:tag :a}]) but something is not working. The browser keeps on the same page and on REPL I’m having {:value nil} . Could someone can explain me why it is not going to the link on that tag? This is the HTML where that element is mounted:

<div class="faculty_course_title" title="Course Title">
                        <a href="...">
                            Course Title                        </a>


I’m using Safari’s driver


Hiya @UNUH8H85U! I’ll take a look sometime soon.


Hmm… I’m learning that safaridriver is rather limited. I can reproduce your issue with safaridriver Included with Safari 15.5 (15613.


I see some folks working around this limitation via JavaScript. I’ve saved your html to fiddle/slack20220621.html (but changed href to hit something for testing purposes):

<div class="faculty_course_title" title="Course Title">
 <a href="">Course Title</a>
Then from my REPL I open up your test page with safaridriver:
(require '[etaoin.api :as e]
         '[ :as io])

(def driver (e/safari))
(def test-page (-> "fiddle/slack20220621.html" io/file .toURI str))
(e/go driver test-page)
I can confirm this does not work for me either:
(e/click-single driver [{:tag :div :class "faculty_course_title"} {:tag :a}])
But as a work-around I tried using JavaScript to click on the element:
(let [elem (e/query driver [{:tag :div :class "faculty_course_title"} {:tag :a}])]
  (e/js-execute driver "arguments[0].click()" (e/el->ref elem)))
And that worked for me.


To anybody else reading this who ran into this problem, is this what you do as well for safaridriver?


Thanks a lot ☺️. I thought I was clicking the wrong DOM element. Is there a way to see safaridriver errors in order to know whats happening on next time?


As far as I understand so far, it is just a long standing bug in safaridriver. I suppose we could have Etaoin compensate for it, but not sure if that is a good idea yet.


Umm, ok. Thanks a lot!


The thought is if we start compensating for bugs in WebDriver implementations, how to we manage when they are eventually fixed? And if we compensate… maybe that’s too much magic? Perhaps a note in the user guide with the above work-around might be the better way to go.