Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8142825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T12:55:35+00:00 2026-06-06T12:55:35+00:00

I have a table with a form below it. You can fill out the

  • 0

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">
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T12:55:37+00:00Added an answer on June 6, 2026 at 12:55 pm

    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.

    WebElement userName = findElementById("userName");
        userName.click();
        userName.clear();
        userName.sendKeys("testforUndo");
    
        WebElement undo = findElementById("cancel");
        undo.click();
    
        String text = findElementById("userName").getAttribute("value");
        String oldtext = "Testing";
    
        Assert.assertTrue(text.equals(oldtext));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have python code below that will loop through a table and print out
I have a table (in a form) populated with radio buttons (with a button
I have a table where the user can add rows to it but each
From the image below. It can be seen that I have three table User,
I have a data in the table in the form below and it is
I have the below table in a .JSP page: <form:form method=post action=update.dtt id=contactForms modelAttribute=contactForms
I have this contact form on my website, but I can't make it to
I have a table inside a form. It has two columns, the first one
I want to populate a table form a MYSQL database. I have defined the
I have a table let's say in the form of: match(id, hometeam_id, awayteam_id) and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.