This is a migrated thread and some comments may be shown as answers.

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

2 Answers 70 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Rahul
Top achievements
Rank 1
Rahul asked on 10 Apr 2018, 12:57 PM

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 Answers, 1 is accepted

Sort by
0
Ivaylo
Telerik team
answered on 13 Apr 2018, 12:08 PM
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!
0
Rahul
Top achievements
Rank 1
answered on 13 Apr 2018, 12:54 PM
Thnx :)
Tags
General Discussions
Asked by
Rahul
Top achievements
Rank 1
Answers by
Ivaylo
Telerik team
Rahul
Top achievements
Rank 1
Share this question
or