I have a table with a form below it. You can fill out the form, but hitting the ‘Undo’ button will revert any entered information to what it was before edits were made.
I would like to assert the text that is manually entered so I can confirm the ‘Undo’ button is reverting the fields. The ‘value’ attribute does not change unless the item is saved, so I cannot use that for attribute for assertion. The XPath for a field is below if that will help.
<table id="userAdminForm" class="c4i-ui-fieldGrid">
<tbody>
<tr>
<td class="c4i-labelCell">
<td class="c4i-fieldCell" rowspan="1" colspan="1">
<div class="c4i-fieldDiv rel" style="min-height: 36px">
<input id="userName" class="ui-inputfield ui-inputtext ui-widget ui-state-default ui-corner-all" type="text" value="Super User" name="userName" role="textbox" aria-disabled="false" aria-readonly="false" aria-multiline="false">
I found that I needed to grab the “value” attribute from the html to get the text. The following code works to pass the test when ran and it will fail if the “oldtext” string is not the desired text.
Thanks to Hari for getting me on the right track.