How to determine string comparison in bean shell
search cancel

How to determine string comparison in bean shell

book

Article ID: 133357

calendar_today

Updated On:

Products

CA Application Test

Issue/Introduction

Service virtualization: Need help to compare string and determine what the bean shell is doing.

Please help me to debug the beanshell script. I am attempting to do string comparison but am unable to troubleshoot


Environment

Any released DevTest versions.

Component : CA Service Virtualization/Application Test

Cause

If a DevTest property is compared with a string and that property is not defined with any value in the script/testcase/project then the Beanshell code throw a script error.

Resolution

Creating a property "TestEnvironment=PHOENIX" in project.config and then the if clause works when string comparison is done as below:


String Environment = testExec.getStateValue("TestEnvironment");

if(TestEnvironment.equals("PHOENIX")) 

{

....

...

}