Test automation for APIs involves creating scripts and programs that simulate API requests and verify the responses, allowing for efficient and repeatable testing. The strategy and structure of test automation for APIs involve defining a comprehensive plan and framework to efficiently and effectively validate the API functionalities.
We want to take this opportunity to shed light on our comprehensive approach to API testing, emphasizing our commitment to delivering reliable and high-quality products of journal entry APIs in General Ledger Accounting. To have an overview of Journal Entry APIs, please visit our blog APIs for Journal Entries – The Collection.
Automated Testing Strategy and Process
Our testing methodology revolves around a proactive and systematic approach to ensure the functionality and reliability of our APIs. At the core of our strategy is comprehensive test automation, allowing us to efficiently cover a wide array of use cases while maintaining a high level of accuracy and reliability.
We leverage cutting-edge automation tools and frameworks to streamline our testing process. Our automation suite is designed to execute test cases rapidly and consistently, minimizing human error and ensuring thorough coverage across various endpoints and payloads. By automating repetitive and critical test scenarios, we ensure the reliability and efficiency of our APIs.
Coverage and Schedule
Every API we develop undergoes a rigorous testing process that encompasses various scenarios and use cases. We start by defining clear use cases based on real-world applications, ensuring that our APIs meet the diverse needs of our customers. We validate the core functionality of an API to ensure it performs as expected.
To maintain a vigilant eye on our testing outcomes, we run daily reports to monitor the results. Below is a snapshot of a sample report:
Continual Improvement
Our testing doesn’t conclude at the product release; it’s an ongoing process. We follow a meticulously planned testing schedule that aligns with our development cycles. Continuous integration and deployment enable us to implement fixes swiftly and seamlessly, ensuring rapid response to any identified issues while maintaining uninterrupted service for our customers.
Use Cases
So far, our test automation has been implemented for the following journal entry APIs within General Ledger Accounting, encompassing various critical use scenarios:
API |
Use Scenario |
Journal Entry – Post (Synchronous) Journal Entry – Post (Asynchronous) |
|
Journal Entry by Ledger – Post (Asynchronous) |
|
Journal Entry – Clearing (Asynchronous) |
|
Journal Entry – Change (Asynchronous) |
|
At present, we’ve automated testing for over 100 sub-use cases, with the number continuously expanding to incorporate a wider array of scenarios that cater to the diverse needs of our customers:
API | Sub-use Case |
Journal Entry – Post (Synchronous) Journal Entry – Post (Asynchronous) |
|
Journal Entry by Ledger – Post (Asynchronous) |
|
Journal Entry – Clearing (Asynchronous) |
|
Journal Entry – Change (Asynchronous) |
|
Sample Payload
Below you can view the payload for sub-use case Supplier Invoice with Input Tax:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sfin="http://sap.com/xi/SAPSCORE/SFIN">
<soapenv:Header/>
<soapenv:Body>
<sfin:JournalEntryBulkCreateRequest>
<MessageHeader>
<ID>TAOJ_SIWIT</ID>
<!--<ReferenceID></ReferenceID>-->
<CreationDateTime>{{$isoTimestamp}}</CreationDateTime>
</MessageHeader>
<!--1 or more repetitions:-->
<JournalEntryCreateRequest>
<MessageHeader>
<ID>TAOJ_SIWIT_1</ID>
<!--<ReferenceID></ReferenceID>-->
<CreationDateTime>{{$isoTimestamp}}</CreationDateTime>
</MessageHeader>
<JournalEntry>
<OriginalReferenceDocumentType>BKPFF</OriginalReferenceDocumentType>
<OriginalReferenceDocument/>
<OriginalReferenceDocumentLogicalSystem/>
<BusinessTransactionType>RFBU</BusinessTransactionType>
<AccountingDocumentType>KR</AccountingDocumentType>
<DocumentReferenceID>123</DocumentReferenceID>
<DocumentHeaderText>Postman:Supplier Invoice</DocumentHeaderText>
<CreatedByUser>_SAPUSERNAME</CreatedByUser>
<CompanyCode>{{companyCode}}</CompanyCode>
<DocumentDate>{{currentDate}}</DocumentDate>
<PostingDate>{{currentDate}}</PostingDate>
<Reference1InDocumentHeader>ap-invoice-w-tax</Reference1InDocumentHeader>
<TaxDeterminationDate>{{currentDate}}</TaxDeterminationDate>
<Item>
<GLAccount>0063001000</GLAccount>
<AmountInTransactionCurrency currencyCode="EUR">100</AmountInTransactionCurrency>
<Tax>
<TaxCode>V1</TaxCode>
</Tax>
<DebitCreditCode>H</DebitCreditCode>
<AccountAssignment>
<!--Optional:-->
<CostCenter>0010101201</CostCenter>
</AccountAssignment>
</Item>
<CreditorItem>
<ReferenceDocumentItem>2</ReferenceDocumentItem>
<Creditor>S1030001</Creditor>
<AmountInTransactionCurrency currencyCode="EUR">-119</AmountInTransactionCurrency>
<DebitCreditCode>S</DebitCreditCode>
</CreditorItem>
<ProductTaxItem>
<!--Optional:-->
<ReferenceDocumentItem>3</ReferenceDocumentItem>
<TaxCode>V1</TaxCode>
<DebitCreditCode>H</DebitCreditCode>
<ConditionType>MWVS</ConditionType>
<AmountInTransactionCurrency currencyCode="EUR">19</AmountInTransactionCurrency>
<TaxBaseAmountInTransCrcy currencyCode="EUR">100</TaxBaseAmountInTransCrcy>
</ProductTaxItem>
</JournalEntry>
</JournalEntryCreateRequest>
<JournalEntryCreateRequest>
<MessageHeader>
<ID>TAOJ_SIWIT_2</ID>
<!--<ReferenceID></ReferenceID>-->
<CreationDateTime>{{$isoTimestamp}}</CreationDateTime>
</MessageHeader>
<JournalEntry>
<OriginalReferenceDocumentType>BKPFF</OriginalReferenceDocumentType>
<OriginalReferenceDocument/>
<OriginalReferenceDocumentLogicalSystem/>
<BusinessTransactionType>RFBU</BusinessTransactionType>
<AccountingDocumentType>KR</AccountingDocumentType>
<DocumentReferenceID>123</DocumentReferenceID>
<DocumentHeaderText>Postman:Supplier Invoice</DocumentHeaderText>
<CreatedByUser>_SAPI069526</CreatedByUser>
<CompanyCode>{{companyCode}}</CompanyCode>
<DocumentDate>{{currentDate}}</DocumentDate>
<PostingDate>{{currentDate}}</PostingDate>
<Reference1InDocumentHeader>ap-invoice-w-tax</Reference1InDocumentHeader>
<TaxDeterminationDate>{{currentDate}}</TaxDeterminationDate>
<Item>
<GLAccount>0063001000</GLAccount>
<AmountInTransactionCurrency currencyCode="EUR">200</AmountInTransactionCurrency>
<Tax>
<TaxCode>V1</TaxCode>
</Tax>
<DebitCreditCode>H</DebitCreditCode>
<AccountAssignment>
<!--Optional:-->
<CostCenter>10101040</CostCenter>
</AccountAssignment>
</Item>
<CreditorItem>
<ReferenceDocumentItem>2</ReferenceDocumentItem>
<Creditor>S1030005</Creditor>
<AmountInTransactionCurrency currencyCode="EUR">-238</AmountInTransactionCurrency>
<DebitCreditCode>S</DebitCreditCode>
</CreditorItem>
<ProductTaxItem>
<!--Optional:-->
<ReferenceDocumentItem>3</ReferenceDocumentItem>
<TaxCode>V1</TaxCode>
<DebitCreditCode>H</DebitCreditCode>
<ConditionType>MWVS</ConditionType>
<AmountInTransactionCurrency currencyCode="EUR">38</AmountInTransactionCurrency>
<TaxBaseAmountInTransCrcy currencyCode="EUR">200</TaxBaseAmountInTransCrcy>
</ProductTaxItem>
</JournalEntry>
</JournalEntryCreateRequest>
</sfin:JournalEntryBulkCreateRequest>
</soapenv:Body>
</soapenv:Envelope>
Your feedback is very valuable to us, and we genuinely appreciate your patience and understanding as we diligently address issues and strive to maintain the high standards you expect from SAP. If you come across any test scenarios that you believe are important but might be missing from our current suite, we welcome and appreciate your effort in helping us enhance and enrich our test scenarios for a more comprehensive coverage.
For further information regarding APIs in general and the SAP Business Accelerator Hub, we encourage you to explore the documentation available on the SAP Help Portal: