How to Write user defined functions?

Answer Posted / jinsha

First we have to define the function and then we have to
call the function.
Eg:
to define a function
integer biger(integer a,integer b)
if (a>b)
return a
else
return b
save the file with .inc extension as x.inc
Now to call a function
Use x.inc
test case userfn1()
int a=10
int b=5
int c=biger(a,b)
print("{c}is greater")

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are testplan attributes?

773


In SilkTest we have a function Except Log which displays the path of the error occured in a Script.In QTP do we have any function like that?

2268


Can silktest switch browsers automatically?

748


How to open an existing silktest project?

778


How to specify a browser extension to a web application?

798


How to include a test case into a testplan?

751


What are the important aspects of a test case?

790


Where is a testplan stored?

762


What is stored in a test frame?

843


How to create and edit a testplan?

769


Can silktest run on mac?

816


What is silktest host?

829


How to define new testplan attributes?

681


What are the problems you faced while identifying an object in silk?

2181


How to assign attribute values to test cases?

824