SilkTest Question 55: How does conditional operator work?

The conditional operator (some testers called it "immediate if" operator) of 4Test language provides alternative to using the if statement for conditional logic structures.

Let take a look on the sample code:
STRING QuickTest = (Winrunner> Qtp) ? License : Tutorial

  • If value of variable Winrunner is greater than Qtp, 4test would assign value of License to QuickTest;
  • If value of variable Qtp is greater than Winrunner, assign value of Tutorial to QuickTest;
Homework assignment: what happens if the values are equal?

1 comment:

Anonymous said...

It will assign value tutorial to QuickTest.

SilkTest interview questions for QA Testers