send-keys ctrl+a

83 views
Skip to first unread message

Michael Jackson

unread,
Apr 14, 2014, 4:24:11 AM4/14/14
to clj-we...@googlegroups.com
Hi there,

Is it possible to send key combinations to an element using the send keys function and if so, what does this look like? Any help would be greatly appreciated.

Regards,
Mike

Fernando Dobladez

unread,
Apr 14, 2014, 7:44:48 AM4/14/14
to clj-we...@googlegroups.com
From an old test I have around, here's an example of sending some text and pressing "enter" :

    (taxi/send-keys "#elementid" (str "youtext" (core/key-code :enter)))




--
You received this message because you are subscribed to the Google Groups "clj-webdriver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clj-webdrive...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Aditya Athalye

unread,
Apr 14, 2014, 11:18:50 AM4/14/14
to clj-we...@googlegroups.com
Michael, We have the following patterns in our codebase:

(taxi/send-keys
(fn-to-construct-css-selector base-css-selector)
var-bound-to-a-string))


(taxi/send-keys
var-bound-to-selector
(fn-that-generates-random-text))


(defn open-new-tab
[]
(taxi/send-keys "body" (str (core/key-code :command) "t"))


I hope this helps.
Cheers!

Aditya Athalye
www.adityaathalye.com

Michael Jackson

unread,
Apr 16, 2014, 3:30:05 AM4/16/14
to clj-we...@googlegroups.com
That did the trick. Thanks to everyone for the help!
Reply all
Reply to author
Forward
0 new messages