Fetching data from Text Databank variable from a different test
This is my use case:
Test 1: Extension Tool
Add output --> Text Data Bank
(Extract 2 data variables StartDate and EndDate)
Test 2: Do SOAP calls
Add output --> XML DataBank
Test 3: Extension Tool Parameterize Call
Add output --> Text Data Bank
Test 4: QueryDBUsingvalues
Add output --> Text Databank
My problem:
The two dates that I'm storing in Databank (start and end dates,) I'm unable to use them from Test 3 because I dont get any value returned: Here is my code for Test 3:
from com.parasoft.api import *
from java.util import *
from soaptest.api import *
from java.time import LocalDate
from java.time import LocalDateTime
from java.sql import Timestamp
def fetchOrders(input, context) :
#theDateFilter=context.getValue("BetweenTimeStamp") ## from a previous extension tool
#Application.showMessage("The theDateFilter is: " + context.getValue("Generated Data Source", "BetweenTimeStamp") ) Application.showMessage("The theDateFilter is: " + str(context.getValue("Generated Data Source", "Test 1: startDateTime") ) ) return
The output in the console is --
---------- Test 3: Extension Tool ParameterizeSOACall ----------
The theDateFilter is: None
The theTrkSqlQuery is: 0
The allRowsCount is: 5848
The counter is: 5847
Test 3: Extension Tool ParameterizeSOACall - success
get trkSqlQuery=0
set allRowsOfData=select ATTRIBUTE1 from LOG_header lh where LOG_PROCESS_ID in ('681') and CURRENT_STATUS in ('STARTING', 'COMPLETED') and ATTRIBUTE1 not in ('
Test succeeded
Attribute values are set as show above but I cannot access them in Test 3.
What am I doing wrong?
I reviewed several forum posts on using variables, databanks etc., none of them led me to any resolution.
Any assistance is greatly appreciated. Thank you!
Comments
-
Did you check "Use data source" box?
0 -
@benken_parasoft , thank you for your prompt reply.
Initially No, as I thought I was getting the referenced data from the script viz the "Generated Data Source" --> context.getValue("Generated Data Source", "Test 1: startDateTime") .
Just to verify if it makes any difference, I checked it once, but it did not make any difference in my case. the Console still shows None for output after I checked the "Use Data source" check box.
---------- Test 3: Extension Tool ParameterizeSOACall ----------
The theDateFilter is: None
The theTrkSqlQuery is: 0The allRowsCount is: 5848
The counter is: 58470 -
I don't see anything obviously wrong. However, I'd recommend you verify that Test 1 ran at least once and also verify that the XML document actually contained "z1" and "z2" elements containing text. If "z1" or "z2" were missing or did not contain a text node then the XPaths you used the Data Bank would not match anything. If the XML message from Test 1 is coming from a REST/Messaging Client tool then you could check the tool's traffic viewer to verify what XML document was returned.
You may also consider contacting Parasoft Support for a timely resolution.
0 -
@benken_parasoft , Thank you.
I confirm TEST 1 has run once and I see them coming in to XML databank (the "Evaluate Xpath" step is showing the stored values).I'll create a case with Parasoft Support. Thank you.
0