Interviewer And Interviewee Guide

SilkTest Interview Question:

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

Submitted by: Administrator
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.....
Submitted by: Administrator

Read Online SilkTest Job Interview Questions And Answers
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.