querySelector not working with click() method on angular it throws compilation error :
'click' does not exist on type 'Element'
document.body.querySelector(".class").click();
Your question is missing a lot of details but can you try to explicitly cast it as an HTMLElement:
let yourElem= <HTMLElement>document.querySelector('.class');
yourElem.click();