While trying to print values present within the strong tag using XPath, I'm getting the following exception:
org.openqa.selenium.NoSuchElementException: Unable to locate element: strong
This is my code:
WebElement eleText = driver.findElement(By.xpath("//strong"));
String testerName = eleText.getText();
System.out.println(testerName);
This is my webpage which I'm trying to get values within the strong tag:
<a id="id_109996" class="activity">
<strong>heizil</strong>: <label id="sample_label">
Expected output: heizil
If this is not the proper way, can anyone suggest any other way of getting the values present in the strong tag?