Angular2 testing – Get element by Id April 11, 2023 by Tarik You can also use by.css de = fixture.debugElement.query(By.css('#theid'));