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
Report failed selector where Element is not clickable
#1435
Comments
@kevinmcdonnell is this about the stack not showing the command that leads to that error in the test? |
yeah it shows this. But it doesn't help me understand which click in my test fails and where the issue in my test is.
|
I see. We do some filtering of the stack trace so that you only get stack information that are relevant for you. It might be get filtered by that. Will have to investigate. |
Yeah, same problem here. Besides the log information, do you found the workaround? |
you can use |
@kevinmcdonnell @joaoffalcao can you provide a reproducible example where the stack trace isn't helping? |
@christian-bromann apologies for the delay This is a contrived example but produces the error:
|
This is apparently an issue with ChromeDriver marked as WontFix because they didn't have a repro: |
@jedwards1211 without reading that long thread, i think that is a different issue The issue here is the logs don't report the selector which failed to click. I element not being clickable is expected, i just want to know the selector which was used to attempt the click |
@kevinmcdonnell oh, gotcha! |
In v5 we will have an autofix for this issue. Closing. |
I'm still getting this issue using webdriverio 5.7, especially with vuetify. All checkboxes for instance are unclickable, i guess because some element is actually overlapping it, but that's the purpose of these libraries that hide the actual html inputs and shows a nicer UI. Is there any chance that webdriverio handles these cases correctly, for instance with an option in the click method like |
@pciavald interesting, do you have a demo app with a small script I can run? |
@christian-bromann here you go sir describe('test', () => {
it('tests', () => {
browser.url('https://perdu.com')
browser.execute(() => {
const vue = document.createElement('script')
vue.src = 'https://cdn.jsdelivr.net/npm/vue'
const vuetify = document.createElement('script')
vuetify.src = 'https://cdn.jsdelivr.net/npm/vuetify/dist/vuetify.js'
const vuetifyStyle = document.createElement('link')
vuetifyStyle.href = 'https://cdn.jsdelivr.net/npm/vuetify/dist/vuetify.min.css'
vuetifyStyle.rel = 'stylesheet'
document.head.appendChild(vuetifyStyle)
const roboto = document.createElement('link')
roboto.href = 'https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900|Material+Icons'
roboto.rel = 'stylesheet'
document.head.appendChild(roboto)
const app = document.createElement('div')
app.id = 'app'
function appScript() {
const app = new Vue({
el: '#app',
data: () => {
return { value: true }
},
template: '<v-checkbox id="checkbox" v-model="value" label="test" />',
})
}
vue.onload = () => document.head.appendChild(vuetify)
vuetify.onload = appScript
document.body.appendChild(app)
document.head.appendChild(vue)
})
browser.pause(3000)
browser.execute(() => document.querySelector('#checkbox').click())
$('#checkbox').click()
})
})
|
I am experiencing the same issue with a vue.js front end. |
So this is a feature request to pass Cypress has the similar functionality https://docs.cypress.io/api/commands/click.html#Options It uses javascript to click, like proposed by @pciavald |
we should notice in docs that clicking by js it is bad practice |
We will tackle this in #2866 |
The problem
Where an element is not clickable because another element would receive the click, wdio should report the selector which failed to help in debugging the test. Presently it reports the elementId and the element which would receive the click.
eg We should know that the command failed to click
.my-class
happy to work on the fix if I can be pointed in the right direction
Environment
Details
Describe in more detail the problem you have been experiencing, if necessary.
Link to Selenium/WebdriverIO logs
Code To Reproduce Issue [ Good To Have ]
can add if needed
The text was updated successfully, but these errors were encountered: