I have followig HTML code and want X path for the text "Analytics & Research"
<div id="LLCompositePageContainer" class="column-wrapper">
<div id="compositePageTitleDiv">
<h1 class="page-header">Analytics & Research</h1>
</div>
I am getting following xpath
using chrome, but that didnt work.
//*[@id="compositePageTitleDiv"]
this is my code
WebElement header = driver.findElement(By.xpath("//div[@id='LLCompositePageContainer']/div[@id='compositePageTitleDiv']/h1[@class='page-header']"));
String header2 = header.getText();
System.out.println(header2);
and following error I am getting
Exception in thread "main" org.openqa.selenium.NoSuchElementException: Unable to find element with xpath == //div[@id='LLCompositePageContainer']/div[@id='compositePageTitleDiv']/h1[@class='page-header'] (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 10.34 seconds For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html