cancel
Showing results for 
Search instead for 
Did you mean: 

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

Arunachalam_RM
Occasional Contributor

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

 

2 REPLIES 2
richie
Community Hero

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

Hey @Arunachalam_RM,

Can you confirm exactly what youre trying to do an what the problem is?

Ta

Rich
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
Arunachalam_RM
Occasional Contributor

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

I am just trying to know how custom authorization is going to work in groovy
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors