I have a button, clicking on it generates a number which is wrapped in paragraph text such as
<p> , I want to get that random number value and do operations based on number it generates.
from below I need to get 34,756 number and store it in java
here is the html code for it
<div class="form-group"> <div class="alert alert-count"> <p> <b> <!-- react-text: 531 --> <!-- /react-text --> <!-- react-text: 532 --> 34,756 <!-- /react-text --> </b>
and the xpath I used is as below
String count = driver.findElement(By.xpath("//div[@class='alert alert-count']/p).getText();
but on console it gives error as "Exception in thread "main" java.lang.NullPointerException"