Jython not returning Data Source value
I am using soavirt 2020.2 version. I am trying to use extensibility tool to get a value from writable datasource and get the error below. I tried convert to string and still the same. Assuming there is a convert to unicode in Jython but could not find anything. Any help appreciated. I eventually want to get current time in this script and then subtract the start value below which happens earlier in my scenario, but need this resolved first. thx
AttributeError: 'unicode' object has no attribute 'getValue'
from soaptest.api import *
from com.parasoft.api import *
def getWritableValue(context):
value = context.getValue("writable","start")
return value
Comments
-
"unicode object" is referring to the value being a string, which has no "getValue" as stated by the error. In the Extension Tool, the first argument is the tool's input (a string) and the optional second argument is a com.parasoft.api.ScriptingContext.
So, you want to change "def getWritableValue(context)" to "def getWritableValue(input, context)" instead.
0