As a novice in automation using Java and WebDriver, I find myself facing a particular issue:
- Browse for a specific customer
- Select a new customer type from a dropdown menu
- Click on the Save button
Outcome: Upon trying to change the customer, a message pops up (created by JS/Jquery) within a notification div container (refer to the code below). The message could be "Saving your changes", "Success", or "Failed" based on the customer being modified.
<div id="notifications">
<ul id="noty_inline_layout_container" class="" style="width: 100%; height: auto; margin: 0px; padding: 0px; list-style-type: none; z-index: 9999999;">
<li style="overflow: hidden; background: rgb(255, 234, 168) url("data:image/png;base64,iVBORw0KGgoAAAANS") border: 1px solid rgb(255, 194, 55); cursor: pointer; height: 1px;">
<div id="noty_545247324387577860" class="noty_bar">
<div class="noty_message" style="font-size: 13px;">
<span class="noty_text">Saving your changes...</span>
</div>
</div>
</li>
<li style="overflow: hidden; background: lightgreen url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB=="); border: 1px solid rgb(80, 194, 78); cursor: pointer; height: 1px;">
<div id="noty_851025645275431000" class="noty_bar">
<div class="noty_message" style="font-size: 13px; ">
<span class="noty_text">Success</span>
</div>
</div>
</li>
</ul>
</div>
Following some time, the message fades away, leaving the notification div container empty like this:
<div id="notifications"></div>
To retrieve the text ("Saving your changes" or "Success") of the JS message that appears briefly, how can it be achieved?