Hi all
Is there a way to use “Switch-Case” statement such that based on what profile I select only a set of steps are executed within a Test Case? The profile selected should be indicated using global variables I am guessing.
Any leads on how can I make this happen would be much helpful. Thanks in advance.
jj
1 Like
Perfect, what I was looking for. Thanks @Nilau .
This is what I came up with based on the code snippet that you provided.
Script:
Assuming that a variable named ‘sdMessagingAccountName’ is created within every profile that you choose to run.
switch (GlobalVariable.sdMessagingAccountName) {
case ' █████ Nexus 6':
println('\n\n\nNexus Case steps\n\n\n\n\n')
break
case 'Google Pixel XL':
println('\n\n\n\nPixels steps\n\n\n\n')
break
default:
break
}
Following image shows the execution,