A useful trick we can deploy is injecting JavaScript to manipulate the browser or change values without specifying user interactions. Let’s see how: internal void CloseActiveTab() { IJavaScriptExecutor js = Context.Driver as IJavaScriptExecutor; js.ExecuteScript("window.close();"); } This code is closing the active tab displayed. By Newing up the IJavaScriptExecutor interface, we can effectively send JavaScript commands directly to the browser console. […]