Hi,
I’m new to using clj-webdriver. I am using it with lein–cucumber. I am trying to create a “Given” for clicking on links on my site based on the text the user sees in the link.
Here’s what’s I’ve got:
(require '[clj-webdriver.taxi :as taxi]
'[clj-webdriver.core :as core]
'[myproject.browser :refer [browser-up browser-down]]
'[clojure.test :refer :all])
(Given #"^I click on \"User Profiles\"$" []
(taxi/click "a[href*='/profiles']")) ;; This works, but I have to write a given for every link.
(Given #"^clicking on \"([^\"]*)\"$" [link_text]
(taxi/click (core/by-link-text link_text))) ;;This won’t work, because by-link-text doesn’t return a string.
Can you recommend the best way to click on a link by link text?
Regards,
Richard
Hi Daniel,
Thank you. I'll use this for the future. I greatly appreciate your reply – it's very helpful. It'll reduce a lot of tests for me.
--
You received this message because you are subscribed to a topic in the Google Groups "clj-webdriver" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clj-webdriver/EIxeX91nT3M/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clj-webdrive...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.