Forum Discussion

Arunachalam_RM's avatar
Arunachalam_RM
Occasional Contributor
4 years ago

custom authorization in groovy script .need explanation for each in body section?

def authProfileName = "Name of your profile";
def project = testRunner.getTestCase().getTestSuite().getProject();
def authProfile = project.getAuthRepository().getEntry(authProfileName);
authProfile.setUsername("newUsername");
authProfile.setPassword("newPassword");
authProfile.setDomain("newDomain");

//Set to true for pre-emptive authentication
//Set to false for using global preference
authProfile.setPreemptive(true);

def step = testRunner.testCase.getTestStepByName("Name of your request").getHttpRequest();
step.setSelectedAuthProfile(authProfileName);

 

 

nmrao  rupert_anderson  top contributors please help

 

    • Arunachalam_RM's avatar
      Arunachalam_RM
      Occasional Contributor
      I am just trying to know how custom authorization is going to work in groovy