Reputation: 1859
I open a payment form in a window and each time Dusk is struggling to find the input elements on the screen. I have tried adding pause(3)
but that did nothing.
I am running laravel 5.5 and Dusk 2.0.
$browser->waitFor('.stripe-card iframe', 30);
// Lets make the switch to iframe
$browser->driver
->switchTo()
->frame('__privateStripeFrame5');
$browser->type('cardnumber', '4242424242424242')
->type('exp-date', '12 50')
->type('cvc', '123');
I have tried:
->pause(3000)
before type('cardnumber')
but did nothing->keys('input[name=cardnumber]', '4242424242424242')
but did nothingThe error that I am given
Facebook\WebDriver\Exception\NoSuchElementException: no such element: Unable to locate element: {"method":"css selector","selector":"body textar ea[name='cardnumber']"}
When using keys()
i get: Facebook\WebDriver\Exception\NoSuchElementException: no such element: Unable to locate element: {"method":"css selector","selector":"body input[name=cardnumber]"}
Upvotes: 1
Views: 304
Reputation: 1859
I would recommend to everyone in a similar position to upgrade Laravel to 5.7 and Dusk to 5.0.
Dusk has a new method called withinFrame()
which makes testing easier to write and clearer to read:
https://github.com/laravel/dusk/commit/8bfb9f01ae09d1d9ca3ce53e36b1f020c0f8dc8f
Upvotes: 1