Thankyou Haikal for your support and it is working can you tell where i can find more information about this beanshell scripting
Thanks & Regards On Wed, Feb 3, 2010 at 11:44 AM, Haikal <[email protected]> wrote: > Try replace comparison operator == with comparison function equals() > before: > > if (vars.get("AC") == YES) > after: > > if ("YES".equals(vars.get("AC"))) > > The operator == compare object reference, not the contents of the string. > > ~haikal > > On Wed, Feb 3, 2010 at 12:55 PM, sudheer reddy <[email protected]> > wrote: > > Hi All > > > > I am facing a problem while using the bean shell preprocessor . > > > > I have a scenario where i extract a value from a http request using the > > xpath extractor and am using the the same value > > > > as condition for if else statement in bean shell preprocessor. and i have > > written the if else condition in bean shell preprocessor . > > > > > > below is my test plan > > > > thread group > > > > |--http request > > > > |_ xpath extractor ( extracting the value for attribute AC AC = > YES) > > > > |--http request ( AC and App are attributes in this http rquest > > using AC=YES/NO condition i have to assign the value for App) > > > > |_ BeanShell PreProcessor > > > > below is my script for beanshell > > > > if (vars.get("AC") == YES) > > { > > vars.put( "App", "null" ); > > print(vars.get("App")); > > } > > else > > { > > vars.put( "App", "P2SGPAppEng01" ); > > print(vars.get("App")); > > } > > > > PLs assist me in solving this > > > > Thanks & rgds > > > > Sudheer > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >

