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
'within_frame' working in headless but not when using Chrome driver #35
Comments
Sorry about the delay on this, been really busy. I’ll be looking at it this weekend |
Hello! Just circling back on this for when convenient. Thanks @twalpole! 🙏 |
Greetings! Circling back on the item above if time permits. Thanks @twalpole. |
I finally have some time to refocus on apparition -- any chance of a self contained example of the issue you're having? |
I am having a similar issue with browser.within_frame('foo') do
end I just receive When running with DEBUG=1 I see the following logs before the time out (
Any tips? |
I see that ferrum has similar issue rubycdp/ferrum#235 |
We use Braintree's Drop-in UI to handle credit card payments. They use hosted fields to render some of the sensitive inputs in an iframe.
Our feature tests run successfully when using
headless: true
, but we receive the following error when usingheadless: false
:This occurs at the point in the code where we invoke
within_frame('braintree-hosted-field-number')
We did some digging in
Capybara::Apparition::Page.push_frame
, and this led us to some logic for@session.on 'Page.frameNavigated'
in the same class (being the place where@frames.add()
is called).We could be seeing things incorrectly, but it appears that the iframe in question is successfully added to the
@frames
object when using headless mode, but not when using Chrome driver.Here's some GitGists showing how we landed there:
Output from some manual debugging:
The iframe and input HTML elements in question, followed by the feature test attempting to access them
Headless (working)
C330BCB070A3552F6C37C0E3B8D763D9
for thebraintree-hosted-field-number
frame is added on line-5 and appears in the@frames
collection on line-23 in the Gist.Chrome (not working)
9DEE660824E4CC26E919A73C61A9FD02
for thebraintree-hosted-field-number
frame is added on line-6 but does not appear in the@frames
collection on line-17 in the Gist.Output from using the built-in
ENV['DEBUG']
tooling:Headless
Chrome
Perhaps we're seeing things incorrectly while debugging. In any case, we've never been able to get
within_frame
to properly switch to an iframe which is clearly in the DOM (including after adding asleep 20
for good measure).For reference, here's how we're registering the driver:
Thanks in advance for any guidance!
The text was updated successfully, but these errors were encountered: