Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Smart API and Correlation

jack_jigar
jack_jigar Posts: 9
edited June 2018 in SOAtest

Hi,

Smart API Test Generator can be correlate data between APIs?

For example "Test1" generate a "CSRF Token" that must be used in "Test2" .

Can Smart API automatically extract data (CSRF Token) and put it in a variable then use that variable in Test2?

BR.

Comments

  • OmarR
    OmarR Posts: 233 admin

    Good morning jack_jigar,

    Yes! The Smart API test generator can correlate data between APIs. However, it is currently dependent on where the data is coming from.

    How is the csrf token being returned from Test 1? Does it return as a header or as part of the response payload?

    Also, how is Test 2 using the csrf token? Is it using it as part of its request header (likely) or as part of the payload? We would appreciate your feedback on this!

  • jack_jigar
    jack_jigar Posts: 9

    thank you for your response.

    "csrf token" in "Test1" and "Test2" is part of response/request payload. IT IS NOT USED IN HEADER.

  • OmarR
    OmarR Posts: 233 admin

    One additional question, are both calls in JSON?
    If so, the Smart API test generator will handle this case seamlessly :)

  • jack_jigar
    jack_jigar Posts: 9
    edited June 2018

    No, unfortunately both are Message Client tools. not XML and not JSON

  • jack_jigar
    jack_jigar Posts: 9

    Dear OmarR,

    I can't find any information about correlation in SMART API User Guide. it is very important for automation testing. also I can't find any information about automatically data source generation for input data.

  • OmarR
    OmarR Posts: 233 admin

    To clarify, the tool will have no trouble handling your case if the content-type is JSON.

    As far as correlation, it would be somewhat of a difficult and complicated task to document. I highly recommend requesting a demo from our field team to see the tool in action!

  • jack_jigar
    jack_jigar Posts: 9

    Dear omarR,

    how can I use this feature If content type not be JSON?

    please assist me.

  • jakubiak
    jakubiak Posts: 795 admin

    What content type are your payloads?

  • jack_jigar
    jack_jigar Posts: 9

    in the most time content type is "application/x-www-form-urlencoded".

  • jakubiak
    jakubiak Posts: 795 admin

    The content type is form urlencoded for response payloads as well?

  • jack_jigar
    jack_jigar Posts: 9
    edited June 2018

    please refer to below image. it is real sample.

  • jack_jigar
    jack_jigar Posts: 9

    Also, how can I use automatically data source generation benefit in Smart API?

  • [Deleted User]
    [Deleted User] Posts: 0 admin

    Hi Jack, These are good questions. I would like to meet with you directly so we can hammer out the use case and post a neat solution here in the forum. Ill send you a direct message

  • jack_jigar
    jack_jigar Posts: 9

    Thank you.