Skip to content
This repository has been archived by the owner on Nov 27, 2020. It is now read-only.

CSS does not match :focus-ed element #444

Closed
clarabstract opened this issue Jan 16, 2014 · 4 comments
Closed

CSS does not match :focus-ed element #444

clarabstract opened this issue Jan 16, 2014 · 4 comments

Comments

@clarabstract
Copy link

Trying to create a cucumber step that is basically just "start typing" (i.e. wherever the cursor already is).

Using the capybara selenium driver, this works as expected:

find("input:focus").native.send_keys(keys)

Using poltergeist however, I just get ElementNotFound

This may be related to ariya/phantomjs#10427

Barring a fix to that, is there any other way of just sending keys over to the browser without having to specify a particular element?

@thedelchop
Copy link
Contributor

I agree I think this is a PhantomJS problem, not a Poltergeist problem. And no, there is no way to sendKeys to the page without a particular element.

@route
Copy link
Contributor

route commented Apr 22, 2014

The element should be focused considering this

this.node(page_id, id).mouseEvent('click')

@route route reopened this Apr 22, 2014
@twalpole
Copy link
Contributor

When there is a resolution to ariya/phantomjs#10427 this should be fixed - there's nothing Poltergeist can do about it.

@twalpole
Copy link
Contributor

I'm closing this because it's a phantomjs issue we can do nothing about. As a workaround, to basically do the same thing you can run

evaluate_script('document.activeElement').send_keys(keys)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants