Which level of the tree are you trying to click?
Lower-level nodes are not visible until you click their parent node.
Have you checked whether the nav-tree is in the DOM just once? You might actually be targetting a different html-element.
An example where the nav-tree is rendered twice is the basic Sidebar_FullResponsive layout.
Both are available in the DOM, but one of them is hidden/off screen depending on your screensize.
Selenium is a portable software-testing framework for web applications. Selenium provides a playback (formerly also recording) tool for authoring tests without the need to learn a test scripting language (Selenium IDE). ... The tests can then run against most modern web browsers.
Navigate To Command
to(String arg0) : void – This method Loads a new web page in the current browser window. It accepts a String parameter and returns nothing.
Command – driver.navigate().to(appUrl);
It does exactly the same thing as the driver.get(appUrl) method. Where appUrlis the website address to load. It is best to use a fully qualified URL.
1 driver.navigate().to("http://www.DemoQA.com");
Forward Command
forward() : void – This method does the same operation as clicking on the Forward Button of any browser. It neither accepts nor returns anything.
Command – driver.navigate().forward();
Takes you forward by one page on the browser’s history.
1 driver.navigate().forward();
Back Command
back() : void – This method does the same operation as clicking on the Back Button of any browser. It neither accepts nor returns anything.
Command – driver.navigate().back();
Takes youback by one page on the browser’s history.
1 driver.navigate().back();
Refresh Command
refresh() : void – This method Refresh the current page. It neither accepts nor returns anything.
Command – driver.navigate().refresh();
Perform the same function as pressing F5 in the browser.
1driver.navigate().refresh();
Practice Exercise