How to Verify Non-Persistent Message alerts coming on Page.

3 posts, 0 answers
  1. Rahul
    Rahul avatar
    12 posts
    Member since:
    Mar 2018

    Posted 10 Apr Link to this post

    On clicking on Submit button, i am getting couple message alerts in a div

    1. Success(Saved successfully)

    2.Error(Duplicate Entry)

    But those message alerts appears on screen for few seconds only.(See attachment Success Message Alert)

    The messages are explicitly removed from DOM after few seconds.(See attachment Error-Message-Container Div)

    How to Verify those alerts. since i can't highlight them and verify that Text contains "Success" message alert because it comes only for few seconds and there is no trace of them in DOM also.

     

     

     

  2. Ivaylo
    Admin
    Ivaylo avatar
    778 posts

    Posted 13 Apr Link to this post

    Hello Rahul,

    Unfortunately you will not be able to verify this using the recorder. You may try to use a coded approach. Something similar to the code below:

    HtmlDiv error = ActiveBrowser.Find.ByAttributes<HtmlDiv>("class=error-message-container");
                if (error == null)
                {
                    Log.WriteLine("Attendee Information has been saved");
                }
     
                else
                {
                    Log.WriteLine(error.InnerText.ToString());
                }

    Please note this is written as an example of what I am seeing from the screenshots provided. You may adjust it as you have full access to the tested application.

    Regards,
    Ivaylo
    Progress Telerik
     
    The New Release of Telerik Test Studio Is Here! Download, install,
    and send us your feedback!
  3. Rahul
    Rahul avatar
    12 posts
    Member since:
    Mar 2018

    Posted 13 Apr in reply to Ivaylo Link to this post

    Thnx :)
Back to Top