SilkTest Question:

Download Job Interview Questions and Answers PDF

How to do negative testing on webpage? Can I have to capture all error pages?

SilkTest Interview Question
SilkTest Interview Question

Answer:

Capturing all the error messages page would lengthen your script.....Capture only one page and using "*" in declaration try to make the identifier common to all the pages...
If the error message appears as a text message, get the index of the text (Generally it is fixed) and retrieve the value of the test and compare with the expected e,g

if BrowserPage.HtmlText ("#1").GetText () == "Invalid date"
Print ("Pass")
else
Print ("Fail")


Suppose first time you enter an invalid mail ID and the error page has the tag "Error Page - Invalid mail ID". 2nd time you enter invalid date and the error page has the tag "Error Page - Invalid date".
To generalize the error page, change the tag to "Error Page - Invalid*" or "Error Page*" which suffices that error page is there.....

Download SilkTest Interview Questions And Answers PDF

Previous QuestionNext Question
Html Push button is not recognizingHow actually ST works internally from developers point of view?