AnsweredAssumed Answered

How do you use a Key from a subprocess that is dynamically created and not part of the Output Properties of the subprocess in test steps of the test case

Question asked by mzaegel on Jul 26, 2018
Latest reply on Jul 27, 2018 by gadpr08

Hello I am working on trying to create a subprocess that can create a unique Key/Value from a XML call. I am able to get the key to create in the subprocess however I cannot use it other test steps. Is there a way to make this dynamic key available outside the called subprocess where the key is dynamic created.

 

Subprocess is an XML RQ with a DB call for input data.Then I created a Java Step to create my new Dynamic Key and Value. 

 

Step 1 Query MariaDB for these items

Query

SELECT `CTRY_ISO_2CODE` as `AppSec_ISOCountryCode`,
  `LANG_ISO_2CODE` as `AppSec_ISOLanguageCode`,
        `APPSEC_STATIC_ID` as `AppSec_AppStaticId`,
        `APPSEC_LOGON_ID` as `AppSec_LogonId`,
        `APPSEC_PASSWORD` as `AppSec_Password`,
        `CALLER_ID` as `AppSec_CallerIdentity`,
        `CALLING_PROCESS` as `AppSec_CallingProcess`,
        `CALLING_APP_NAME` as `AppSec_CallingApplicationName`,
        `CALLING_APP_VERSION` as `AppSec_CallingApplicationVersion`,
        `CALLING_INTERFACE_VERSION` as `AppSec_CallingInterfaceVersion`,
        `CALLING_HOST_WEBLOGIC_INSTANCE` as `AppSec_CallingHostOrWeblogicInstance`,
        `APP_SEC_KEY`
FROM RQATAutomationDB.APPSEC_TOKEN
WHERE APPSEC_ENVIRONMENT = 'PROD' AND TEAM_NAME = 'TKTSVCS' AND APPL_NAME = 'TICKET LIGHTWEIGHT';

 

Response from Query

Test successful. The DataSet returned the following: {AppSec_AppStaticId=115001382682, AppSec_CallingProcess=, APP_SEC_KEY=AppSec_Token_Ticket, AppSec_LogonId=SVC_TKT, AppSec_ISOCountryCode=US, AppSec_CallingApplicationVersion=1.0, AppSec_CallerIdentity=, AppSec_ISOLanguageCode=en, AppSec_CallingHostOrWeblogicInstance=DevTest, AppSec_CallingApplicationName=DevTest, AppSec_CallingInterfaceVersion=1.0, DB-AppSec-Ticket_TeamSpecific_RowNum=1, AppSec_Password=password}

Step 2 Execute AppSecCall

Key and Value Returned

AppSec_Token = AOSTOKEN_1_5:919ABD700953826641ECA4BD4……

Step 3 Create a new Key for a specific Key Value and then assign value from another Key

Keys / Value Available

APP_SEC_KEY = AppSec_Token_Ticket

AppSec_Token = AOSTOKEN_1_5: 919ABD700953826641ECA4BD4……

 

Use a Java Step to create Key
String appsecToken ="";

String appsecKey ="";

appsecToken=testExec.getStateString("AppSec_Token","");

appsecKey=testExec.getStateString("APP_SEC_KEY","");

testExec.setStateValue(appsecKey, appsecToken);

return appsecKey+"="+appsecToken;

New local to the subprocess Key is created

AppSec_Token_Ticket = AOSTOKEN_1_5: 919ABD700953826641ECA4BD4……

 

 

How do I get this Dynamic Key to return from the subprocess to the test case and use across other test steps in that test case?

Outcomes