I am stuck in to automate one of the functionality in my current project using Selenium TestNG.
There is scenario where I want to get the text (The answer you entered was not correct.) from the div given in the source code. I am using element.getText()
method to get the content but I am not able to get the text it carries.Any help would be appreciated.Thanks in advanced.
<div class="error">
<h2 class="visually-hidden">Error message</h2>
<div class="icon">
<svg version="1.1" height="24" viewBox="0 0 64 64">
</div>
The answer you entered was not correct.
</div>