Thursday 26 November 2015

An Authentication object was not found in the SecurityContext error in load runner fix

In web-services applications, during recording of it  VuGen doesn't record the authentication object and while replaying the script throw the error "An Authentication object was not found in the Security Context"

The reason for the SOAP fault is An Authentication object was not found in the SecurityContext of that page or request. The application is mostly launched via a web-link where the run time jars / dlls are downloaded locally and application will be launched. During launching itself the application takes the authentication credentials from local system and authenticates the user. While replaying in VuGen this authentication information won't be available, this can be done by sending the authentication information in the header before the first web-service request. The following code can help you on that. If your web service method has property for sending authentication object then you can do same in the request itself.