Silktest Question 14: How to test dynamic text in web based application?

I'm using Silk Test for testing a web based application. When I fill the form out and submit, the page shows a text message along with the username in the next page, for example "Successfully created test account for user John Winrunner". The message changes when different username is given, for example "Successfully created test account for user Andrew SilkTest". How to verify this dynamic text?


There must be a particular set of messages that you might be getting. Here are some few advices that you might want to use depending on your testing requirements.

1) Use the index of the message and not the caption to declare it, since the caption keeps on changing non-uniquely.

2) Declare each message separately, and check for their existence. At a time only one should exist and you can proceed depending on what is to be done on the occurrence of the corresponding message.

3) Setting Agent Option OPT_VERIFY_UNIQUE to false temporarily through 4Test code. For example :

Agent.SetOption (OPT_VERIFY_UNIQUE, FALSE)
// 4Test code that requires non-unique messages
Agent.SetOption (OPT_VERIFY_UNIQUE, TRUE)

No comments:

SilkTest interview questions for QA Testers