HI Pasadi, You can do the multiple user login in same script as bellow.
user login: LoginLogoutUtil loginUtil = new LoginLogoutUtil(9443, "localhost"); // use correct port *sessionCookie* = loginUtil.login(TENANT_NAME_1, TENANT_PASSWORD, backendURL); Make sure to update the cookie information as above. Use updated cookie for your next activities. Ex: WebAppAdminClient webAppAdminClient = new WebAppAdminClient(backendURL, *sessionCookie*); Thanks and Best Regards, Saneth Dharmakeerthi Senior Software Engineer WSO2, Inc. Mobile: +94772325511 On Tue, Jan 27, 2015 at 6:52 PM, Malintha Adikari <[email protected]> wrote: > Hi Prasadi, > > In WSO2 Test Automation Framework, we store all configurations details > related to tests in automation.xml file [1]. You can add/remove your tents > under <userManagement> element of that file. Then Test Framework will > automatically create tenants which are mentioned under above tag. So in > your case please add two tenants in to that files > > > <tenant domain="wso2.com" key="wso2.com"> <admin> <user key="admin > "> <userName>admin</userName> <password>admin</password> </ > user> </admin> <users> <user key="user1"> <userName > >testuser11</userName> <password>testuser11</password> </user> > <user key="user2"> <userName>testuser21</userName> <password > >testuser21</password> </user> </users> > > <tenant domain="test.com" key="test.com"> <admin><user key="admin"> > <userName>admin</userName> <password>admin</password> </user> </admin > > <users> <user key="user11"> <userName>testuser111</userName> < > password>testuser11</password> </user> <user key="user21"> <userName > >testuser211</userName> <password>testuser21</password> </user> </ > users> > > > > Then you can use those tenants seperately inside your tests. You can > create separate "AutomationContext" objects in your test (in your case two) > and use those AutomationContext objects for writing your test case. You can > achieve tenant separation through these objects. > > > > *AutomationContext tenant1Context= new AutomationContext(productGroupName, > instanceName, "wso2.com <http://wso2.com>", "admin")AutomationContext > tenant2Context= new AutomationContext(productGroupName, instanceName, > "test.com <http://test.com>", "user11")* > > (Please refer AutmationContext.java class[4] for different constructors > you can use to create your AutomationContext object) > > In ESB tests above "AutomationContext" object is created inside a base > class [3] and all test classes inherited from that class. You can add your > "AutomationContext" objects in your test class and it will do no harm > > Note: Tenant creation process is done by AutomationFramework here. (In the > upstart of the carbon server) > > If you want to create tenants inside your test case it self please refer > how Automation Framework do the same thing [2] > > [1] > https://github.com/wso2/product-as/blob/master/modules/integration/tests-integration/tests/src/test/resources/automation.xml > [2] > https://github.com/wso2-dev/carbon-platform-integration-utils/tree/master/common-framework-extensions/src/main/java/org/wso2/carbon/integration/common/extensions/usermgt > [3] > https://github.com/wso2-dev/product-esb/blob/master/modules/integration/test-common/integration-test-utils/src/main/java/org/wso2/esb/integration/common/utils/ESBIntegrationTest.java > [4] > https://github.com/wso2-dev/carbon-platform-integration/blob/master/test-automation-framework/org.wso2.carbon.automation.engine/src/main/java/org/wso2/carbon/automation/engine/context/AutomationContext.java > > Regards, > Malintha Adikari > > > > On Tue, Jan 27, 2015 at 12:46 PM, Irham Iqbal <[email protected]> wrote: > >> Hi, >> >> In this class[1] we populate users for tenant. you can go through >> addTenantUsers method and see how you can add users. >> >> [1] >> https://github.com/wso2-dev/carbon-platform-integration-utils/blob/master/common-framework-extensions/src/main/java/org/wso2/carbon/integration/common/extensions/usermgt/UserPopulator.java >> >> Thanks, >> Iqbal >> >> On Tue, Jan 27, 2015 at 5:55 PM, Pasadi Munasinghe <[email protected]> >> wrote: >> >>> Hi Irham, >>> >>> Thank you for the reply. >>> What I actually need to do is to create one tenant and make him execute >>> a certain process and the other one should log in and some other process. >>> Can you please elaborate how can I get each user to perform their >>> respective activities..?? >>> Thanx..!! >>> >>> On Tue, Jan 27, 2015 at 5:40 PM, Irham Iqbal <[email protected]> wrote: >>> >>>> Hi Pasadi, >>>> >>>> You can use automation.xml[1] to create multiple tenants. >>>> You can define your tenants inside <userManagement> tag and inside < >>>> listenerExtensions> tag add the extension class[2]. This >>>> automation.xml[1] already has those configuration. >>>> >>>> [1] >>>> https://github.com/wso2/product-as/blob/master/modules/integration/tests-integration/tests/src/test/resources/automation.xml >>>> >>>> >>>> [2]org.wso2.carbon.integration.common.extensions.usermgt.UserPopulateExtension >>>> >>>> >>>> Thanks, >>>> Iqbal >>>> >>>> On Tue, Jan 27, 2015 at 5:20 PM, Pasadi Munasinghe <[email protected]> >>>> wrote: >>>> >>>>> Hi, >>>>> I am in the process of implementing a test case where initially 2 >>>>> tenant users should be able to log in. How should I do this..?? >>>>> Thanx..!!! >>>>> -- >>>>> Pasadi Munasinghe >>>>> Software Engineer Intern >>>>> WSO2, Inc >>>>> Mobile: +9471 377 5515 >>>>> >>>>> _______________________________________________ >>>>> Dev mailing list >>>>> [email protected] >>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev >>>>> >>>>> >>>> >>>> >>>> -- >>>> Irham Iqbal >>>> Software Engineer - Test Automation >>>> WSO2, Inc.: http://wso2.com >>>> lean. enterprise. middleware >>>> phone: +94 777888452 >>>> >>> >>> >>> >>> -- >>> Pasadi Munasinghe >>> Software Engineer Intern >>> WSO2, Inc >>> Mobile: +9471 377 5515 >>> >> >> >> >> -- >> Irham Iqbal >> Software Engineer - Test Automation >> WSO2, Inc.: http://wso2.com >> lean. enterprise. middleware >> phone: +94 777888452 >> >> _______________________________________________ >> Dev mailing list >> [email protected] >> http://wso2.org/cgi-bin/mailman/listinfo/dev >> >> > > > -- > *Malintha Adikari* > Software Engineer > WSO2 Inc.; http://wso2.com > lean.enterprise.middleware > > Mobile: +94 71 2312958 > Blog: http://malinthas.blogspot.com > Page: http://about.me/malintha > > _______________________________________________ > Dev mailing list > [email protected] > http://wso2.org/cgi-bin/mailman/listinfo/dev > >
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
