Closed ir-fuel closed 8 years ago
The element is probably not visible at the time of the click. The Selenium click action works a bit different than the one from Javascript. You need to run your test with --verbose
flag to identify what the issue is. In any case it doesn't look like a Nightwatch issue, if you're seeking assistance
please use the Mailing List or StackOverflow.
You are quick in closing this ticket, no?
The line before doing this click I have: .waitForElementVisible('@createAccountModalBackground', 1000)
so why are you concluding that the element is not visible at the time of the click? If it isn't visible that line should fail.
edit: running my tests shows me:
Element <div.modal-backdrop> was visible after 48 milliseconds.
Maybe element is hovered by other element or you need to scroll down to the element? That would explain why this works fine
client.execute(function() {
document.querySelector('div.modal-backdrop').click()
})
Or you had luck and element disappear sometimes just after you check if the element is visible
Also, what do you mean The click never gets executed. The modal stays on screen.
? Is there any error?
Thanks for the feedback. I'll investigate more and continue on Stackoverflow. Nice framework btw!
got similar issue. your click
workaround helps me a lot! thanks! :)
i am facing the same problem and that workaround doesnt work for me also.
I had a similar issue and it turns out to be the library flatpickr, that when the calendar were open it was blocking the button.
So after I set a date I call .keys([''\uE00C''])
('\uE00C'
means ESC
key) and the button were clickable again.
I have the same issue, where click doesn't work with annotations everywhere I have a CSS path which is very lengthy. The application is developed in reactjs elements: { id : 'css path' }, commands:[{ .click('@id') // the above line doesnt work throws error .click ('css path') // this works }]
I don't understand what i am missing? Can anyone help me?
Something strange happens when testing my Bootstrap website using Nightwatch.
I have the following element in my page definition:
In my test I execute the following code:
The click never gets executed. The modal stays on screen.
If however I replace the
click
call with:It works fine.
Is there an issue somewhere?
Do you need more information?