java - Cannot find web elements at "chrome://downloads/" page -


i using java , selenium write tests chrome. need chrome://downloads/ , click on clear all button. can page

remotewebdriver driver = (remotewebdriver) driverchrome;         driver.executescript("window.open();");         thread.sleep(500);         tabs = new arraylist<string>(driverchrome.getwindowhandles());         driverchrome.switchto().window(tabs.get(1));         thread.sleep(500);         driverchrome.get("chrome://downloads/"); 

but cannot click on button, whatever xpath use says no such element

below here javascriptexecutor example perform click on clear all button using selenium :-

javascriptexecutor executor = (javascriptexecutor)driver executor.executescript("var dm = document.getelementsbytagname('downloads-manager')[0];var toolbar = dm.shadowroot.getelementbyid('toolbar');var actions = toolbar.shadowroot.getelementbyid('actions');actions.getelementsbyclassname('clear-all')[0].click();"); 

tested in chrome version 50.0.2661.102 m

hope you..:)


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -