I am using selenium to automation test browser application, I need a javascript api to get the browser current cursor style, not care where it is. Is there some API get the information link document.readstate
See Question&Answers more detail:osI am using selenium to automation test browser application, I need a javascript api to get the browser current cursor style, not care where it is. Is there some API get the information link document.readstate
See Question&Answers more detail:osSince it may not have been defined inline, you need the computed style:
document.addEventListener('click', e => {
const tgt = e.target;
const inline = tgt.style.cursor || "Not defined"
const computed = window.getComputedStyle(tgt)["cursor"]
console.log("Inline: ",inline,"Computed: ",computed)
});
.help { cursor: help }
<span style="cursor:pointer">Inline Pointer</span>
<hr>
<span class="help">CSS help</span>