I am unable to write the correct XPath to select the title "MRS" for below code. I am using below code, but unable to execute it.
driver.findElement(By.xpath("//div[@value='MRS']")).click();
Getting below error message :
Exception in thread "main" org.openqa.selenium.NoSuchElementException: no such element: Unable to locate element: {"method":"xpath","selector":"//div[@value='MRS']"}
<div class="question-group">
<label class="on">Mr</label>
<input type="radio" name="title" value="MR" class="ui-helper-hidden-accessible">
<label class="off">Mrs</label>
<input type="radio" name="title" value="MRS" class="ui-helper-hidden-accessible">
<label class="off">Miss</label>
<input type="radio" name="title" value="MISS" class="ui-helper-hidden-accessible">
<label class="off">Ms</label>
<input type="radio" name="title" value="MS" class="ui-helper-hidden-accessible">
<label class="off">Dr</label>
<input type="radio" name="title" value="DR" class="ui-helper-hidden-accessible">
<label class="off">Rev</label>
<input type="radio" name="title" value="REV" class="ui-helper-hidden-accessible">
<input type="text" maxlength="20" style="display:none" name="otherTitle" value="" placeholder="Other title:" id="otherTitle">
</div>
div
? That will make it hard for anyone to help you as well.