I m currently running my scripts from SILK TEST.
It checks in the Database for a records, if it exist it prints a message(record exist) else prints (Document saved).
In both the condition my testcase passes BUT prints the message accodingly.(Pass or Fail)
I want that if the document is there in DB my TESTCASE SHOULD FAIL with an error message else it should pass with the message.
So how do i code in my script so as to fail my testcase in the above scenario.
Try using "LogError" function.
i.e. LogError("Record already exists")
(for future reference, maybe you should consider LogWarning() and ExceptLog ( ) functions as well)
There are 10 types of people: Those who can read binary, and those who can't.
Or raise an exception.
you can also use RaiseError
John W Green firstname.lastname@example.org
You can also Use
Verfiy () like
Verfiy ( RecordExistsInDB(<Value>, TRUE)
Or for more information on logging the results Have a look at
Silk Test Help --> 4Test Reference --> Functions ---> Results File Operation.
Balloon recommends that you code the following:
if (Database Record exists)
print ("Test passed. Database Record exists")
logerror ("Test failed. Database Record does not exist")