Fitnesse does not understand @Autowired

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Fitnesse does not understand @Autowired

FitNesse mailing list
Hi, 

I am using Spring Framework for UI Testing and I am also using Fitnesse with Given, When, Then to call the methods. Problem i am facing with Fitnesse is looks like it doesn't understand @ Autowired annotation may be, because every time i am getting Null pointer exception. I am copying my code here..Please help me to understand how this can be resolved... 

I have autowired Environment . 

@Autowired 
public Environment env; 

public boolean RuleManagerSignIn(String url, String Testsuite) throws Exception 
{
try{
String StrUser = env.getProperty("username"); 
String StrPassword = env.getProperty("password");
String decryptedPwd = EncryptUtils.decrypt(StrPassword); 

OpenUrl(url, Testsuite); 
Thread.sleep(1000); 
enterUserName(StrUser);
enterPwd(decryptedPwd);
clickSignInButton(); 
Thread.sleep(6000); 
return true; 

catch(Exception e) 

e.printStackTrace(); 
return false; 



java.lang.NullPointerException 
at com.mastercard.bdd.RuleManager.pageobjects.RuleManagerLoginPage.RuleManagerSignIn(RuleManagerLoginPage.java:67) 
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
at java.lang.reflect.Method.invoke(Method.java:606) 
at fitnesse.slim.fixtureInteraction.DefaultInteraction.methodInvoke(DefaultInteraction.java:81) 
at fitnesse.slim.MethodExecutor.callMethod(MethodExecutor.java:57) 
at fitnesse.slim.MethodExecutor.invokeMethod(MethodExecutor.java:38) 
at fitnesse.slim.MethodExecutor.findAndInvoke(MethodExecutor.java:72) 
at fitnesse.slim.FixtureMethodExecutor.execute(FixtureMethodExecutor.java:20) 
at fitnesse.slim.StatementExecutor.getMethodExecutionResult(StatementExecutor.java:135) 
at fitnesse.slim.StatementExecutor.call(StatementExecutor.java:108) 
at fitnesse.slim.instructions.CallInstruction.executeInternal(CallInstruction.java:35) 
at fitnesse.slim.instructions.Instruction.execute(Instruction.java:29) 
at fitnesse.slim.ListExecutor$Executive.executeStatement(ListExecutor.java:49) 
at fitnesse.slim.ListExecutor$Executive.executeStatements(ListExecutor.java:43) 
at fitnesse.slim.ListExecutor.execute(ListExecutor.java:85) 
at fitnesse.slim.SlimServer.executeInstructions(SlimServer.java:84) 
at fitnesse.slim.SlimServer.processOneSetOfInstructions(SlimServer.java:77) 
at fitnesse.slim.SlimServer.tryProcessInstructions(SlimServer.java:64) 
at fitnesse.slim.SlimServer.serve(SlimServer.java:49) 
at fitnesse.slim.SlimService.handle(SlimService.java:154) 
at fitnesse.slim.SlimService.acceptOne(SlimService.java:162) 
at fitnesse.slim.SlimService.accept(SlimService.java:124) 
at fitnesse.slim.SlimService.startWithFactory(SlimService.java:76) 
at fitnesse.slim.SlimService.main(SlimService.java:56) Thanks & Regards, Seema Phulwade