Sending e.g. Ctrl+B via Splinter?

30 views
Skip to first unread message

daniel....@regionalhelpwanted.com

unread,
May 2, 2016, 5:21:46 PM5/2/16
to splinter-users
I'm testing a form that uses CKEditor, and wanted to use Ctrl+B just to check something basic, i.e. bold, in CKEditor is working. How can I do this through Splinter's type() method? Or do I need to use a different method?

Douglas Camata

unread,
May 2, 2016, 5:51:41 PM5/2/16
to Splinter Users
Splinter itself doesn't provide its own interface for such action yet. You can import the keys' from Splinter and access the private attribute `_element` of the element that you to send the keys to:


from selenium.webdriver.common.keys import Keys

element = browser.find_by_css('#my_element').first
element._element.send_keys(Keys.CONTROL + 'b')


Best regards,

Douglas Oliveira Camata
Software Developer

Connect with me: Linkedin | Github Blog 
Skype: douglas_camata


On Mon, May 2, 2016 at 6:21 PM, <daniel....@regionalhelpwanted.com> wrote:
I'm testing a form that uses CKEditor, and wanted to use Ctrl+B just to check something basic, i.e. bold, in CKEditor is working. How can I do this through Splinter's type() method? Or do I need to use a different method?

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

Reply all
Reply to author
Forward
0 new messages