Forum Discussion

tkhak's avatar
tkhak
Occasional Contributor
16 years ago

Problem expanding property in a SQL-query within a DataSource JCDB test step

Hi
I'm new with sopaUI pro and I'm currently making my first steps with the version 3.0.1.

Let me explain what I try to do:
1. I send a soap request to a web service, retrieve a specific value from it's response and store it
    within a property of the test case.
2. Then I make a SQL query and wan't to use the property as a parameter within the query.
3. As a result  I always get zero rows back. If I use the value stored in the property instead I get
    the result I expect. What do I make wrong?

I made a screenshot of the configuration of the DataSource-Step. It may helps you ...

Thanks for your help!
Regards Patrik

9 Replies

  • M_McDonald's avatar
    M_McDonald
    Super Contributor
    Try removing the initial '#' from the expansion expression:

    [tt:20zwsa7m]${CCXV2_setAutoPayment#autoPaymentId}[/tt:20zwsa7m]
  • tkhak's avatar
    tkhak
    Occasional Contributor
    Hi M McDonald

    I just tried your suggestion but it didn't worked, still no rows coming back ...

    Thanks anyway for your help!
  • M_McDonald's avatar
    M_McDonald
    Super Contributor
    If you put a known good ID into the statement does it return rows?
  • tkhak's avatar
    tkhak
    Occasional Contributor
    If I put a real value (the value which is also set to the property) I get one single row back as expected ...
  • M_McDonald's avatar
    M_McDonald
    Super Contributor
    Sorry, I didn't see at first. CCXV2... is your test case, correct? Then you need to use

    [tt:vy58otj9]${#TestCase#autoPaymentID}[/tt:vy58otj9]
  • tkhak's avatar
    tkhak
    Occasional Contributor
    Yes "CCXV2_SetAutoPayment" ist the name of the test case; so my initial version was correct ?
  • M_McDonald's avatar
    M_McDonald
    Super Contributor
    You use the literal string #TestCase#, not the name of the test case.
  • tkhak's avatar
    tkhak
    Occasional Contributor
    Okay a tried now this one:
    select amount, currency, timeperiod, validfrom, amounttype, executiontype from autopay where objid='${#TestCase#autoPaymentID}'

    => still no rows 
  • tkhak's avatar
    tkhak
    Occasional Contributor
    The hint with #Testcase# was correct but in the meantime the row was deleted out of the database and I didn't realized it!
    => everthing is wnow working as it should!

    Thanks a lot for the fast and great help!