Forum Discussion
Hi Harold,
You can start with the following articles:
How to change credentials for OAuth authorization profiles using Groovy?
How to change credentials for an auth profile using Groovy script?
And refer to the documentation: http://www.soapui.org/apidocs/overview-summary.html
Nastya_Khovrina,
Any idea of how could I set the authentication profile just created before at :
1 - Project level
2 - TestSuite level
And at the same time apply the selected authentication profile to all of its childrens
See image for further informations
Regards
Harold
- Nastya_Khovrina8 years agoSmartBear Alumni (Retired)
Hi Harold,
To set the authorization profile for a project and for a testSuite, you can use the setAuthProfile method:
import com.eviware.soapui.config.AuthEntryTypeConfig; def project = context.getTestCase().getTestSuite().getProject(); project.setAuthProfile("Name of your Profile"); def ts = project.getTestSuiteByName("TestSuite Name"); ts.setAuthProfile("Name of your Profile");
To set the "Inherit from parent" value for a child, you can use this script:
def testCase = project.getTestSuiteByName("TestSuite Name").getTestCaseByName("TestCase Name); testCase.setAuthProfile("Inherit from parent");
But, child elements should have this value by default.
Documentation:
Class WsdlProjectPro: https://www.soapui.org/apidocs/pro/com/eviware/soapui/impl/wsdl/WsdlProjectPro.html
- HaroldR8 years agoContributor
Hi Nastya,
Your message is really helpful, thanks you!!!
Also , I was wondering :
Regarding the code you provided in the first frame, if I am about to use the method to set the authentication at the project level, will all childs descending nodes inherit from the authentication profile. In other words, will the inherit from parent method be spread to all containing nodes whithout using the code of the second frame?
Is it the same behaviour if we decide to set the authentication at testsuite level?
Regards,
Harold- Nastya_Khovrina8 years agoSmartBear Alumni (Retired)
Harold,
Please see the screenshots which show the state of the project before and after applying the script.
Also, please see the Inheritance article: https://support.smartbear.com/readyapi/docs/projects/requests/auth/profile/inherit.htmlNote, that if change the profile in the UI you will have an option to choose whether the change should be applied to child nodes. See the video: https://www.screencast.com/t/sfg121SG6s
Related Content
- 10 months ago
- 10 months ago
Recent Discussions
- 18 days ago