Trying to do a querySelectAll to get this link <a href="#" class="logout">Logout</a>. But the code is not having any luck in getting it.
So the javascript code I am trying to use is:
document.querySelectorAll('[class="logout"]')
But that doesn’t seem to return anything, so I also tried:
document.querySelectorAll('[href=”#” class=”logout”')
Release : SAAS
Component : CA APP SYNTHETIC MONITOR (WATCHMOUSE)
script error
document.querySelectorAll('a.logout') is the correct syntax to select the link.
Running this command on the page produces a NodeList object containing two items. Calling document.querySelectorAll('a.logout')[0].click(); logs out the user.