How to Write user defined functions?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / kkamalay
Hi Padmaja,
with silktest you can write user defined functions as same
as c, c++
<returntype> <functionName> (Arguments list)
--------------
------------
statements
return
eg:1
Integer simpleAdd(Integer a, Integer b)
Integer c=0
c=a+b
return c
eg: 2
Void PrintStatement(String msg)
Print(msg)
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / suresh
USER defined function can be written as we write them in C/
the syntax:
return type functionname(list of arguments)
]//@@@@@@@@
simple example
//@@@@@@@@@@
int sum(int a ,int b)
int sum
sum=a+b
return sum
Is This Answer Correct ? | 3 Yes | 3 No |
can we test the application by inserting checkpoints using silktest as we do in qtp and winrunner and also what are the automation frameworks in silktest
How to assign attribute values to test cases?
What is the standard flow of execution of a test case?
Define PEER Review ,what it contains & What we discuss in that meeting.
In how many ways we can perform datadriven test in silk test, throgh flatfiles can we perform?
How dom browser extension identify a web application ui object?
What statement in for test is used to transfer control of the script out of the innermost nested for, for each, while switch or selected statement?
What are testplan attributes?
Whats the difference between Basestate & Default basestate?
how to pass TDS intery in tally?
How to select a group of test cases in a testplan to run?
Hi All, An newbiee to silk test tool. I wanted to write a function which checks the browser type installed in the local machine & then based on the browser type test case should run. I tried little bit writing the function : Void Func_ValidateBrowserType() Window myWin myWin = Browser.GetRealBrowser () print (myWin) Any help please.. Thanks, V