Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for TAB or ENTER keys in browser.type #572

Open
mpibpc-mroose opened this issue Nov 30, 2017 · 4 comments
Open

Add support for TAB or ENTER keys in browser.type #572

mpibpc-mroose opened this issue Nov 30, 2017 · 4 comments
Milestone

Comments

@mpibpc-mroose
Copy link
Contributor

mpibpc-mroose commented Nov 30, 2017

Dear splinter team,
I'm using django-froala-editor in my projects and want to run behavior tests. As it is a bit tricky to get the FroalaField inputs as this are contenteditable DIVs. I'm using the following approach with navigating with TAB keys:

import splinter
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChains

with splinter.browser as b:
    b.visit("/")
    # click on an visible element
    self.browser.find_by_id("id_foo").first.click()
    # next element is a FroalaFieldInput and is defined by tab order
    actions = ActionChains(b.driver)
    actions.send_keys(Keys.TAB)
    actions.send_keys("AB")
    actions.perform()

I would like to somehow have a more "natural" possibility to type "TAB" or other special keystrokes, e.g. by passing selenium Keys to browser.type(). I think as this is implemented in Selenium it could be useful in splinter, too.

@andrewsmedina
Copy link
Member

Hi @mpibpc-mroose I believe that it is a nice feature to have. Thanks.

@caoliang12121
Copy link

yes i'm very confused about this function,really need it

@Formartha
Copy link

Yep,
needed as well from my side.
It's crucial in fact..

@jacebrowning
Copy link
Contributor

I'm interested in helping build this.

I'd rather not have to import anything new if I already have a Browser instance. Would this API work?

browser.type_tab()
browser.type_enter()

Or about about this?

browser.type(tab=True)
browser.type(enter=True)

@andrewsmedina andrewsmedina added this to the after 1.0 milestone Aug 27, 2018
@jsfehler jsfehler added django Relates to the Django client and removed django Relates to the Django client labels Jul 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants