The below code fetches an input and splits the input at value "HttpOnly" and there after if an "if" condition is satisfied then it returns the value as such.
How can I make the value to return as NULL or "123" if the condition fails at split() itself ?
from soaptest.api import *
from com.parasoft.api import *
def getHeader(input, context):
headerNew = ""
strHeader = str(input).split("HttpOnly")
for i in strHeader:
if "com.abc.mb.SSO_GUID" in i:
Application.showMessage(i)
headerNew = i
return headerNew
EDIT
Input - "abcdefgHttpOnly"
Output - "abcdefg"
Input - "abcdefg"
Output - "123"