I have a question about etaoin. Why do I see this difference?
(eta/displayed? driver [{:id :app}]) ;; false
(boolean (re-find #“id=\“app\“” (eta/get-source driver))) ;; true
I have 2 suspicions: 1) browser's algorithm decided that :app is not in viewport (see https://www.w3.org/TR/webdriver/#element-displayedness)
2) you have to wait for element to be rendered before checking eta/displayed?
because a lot of Webdriver operations are async
if neither works you could also resort to using exists?
instead of displayed?
but I guess exists?
won't catch an error if there's an accidental display:none
in the element
(eta/displayed? driver [{:id :app}]) ;; false
(eta/query driver [{:id :app}]) ;; “0.1251476918489347-1”, wat?
ah, displayed vs exists
exists works
awesome 🙂
Thank you for creating a channel for the library. Sorry for the delayed answer. As it has been said above, sometimes browsers behave quite strange when detecting whether an element is visible or not. After all, you'd better to have a snapshot and see if it really presents on the screen.
@igrishaev No problem, I hope this channel will help adoption 🙂