Sometimes we want to delete a component that we don't needed in order to automate the application. Below is the code that will work for you.
For further queries or any suggestions from your side are most welcome. Thanks!
JavascriptExecutor js = null;
if (driver instanceof JavascriptExecutor) {
js = (JavascriptExecutor) driver;
}
js.executeScript("return document.getElementById('ID of a Component which you want to delete').remove();");
Comments
Post a Comment