# Hosted Session > Testing Steps
source: https://developer.mastercard.com/mastercard-gateway/documentation/testing/test-your-int/hosted-session/index.md

Careful testing is the cornerstone of software development, ensuring it operates as expected. You cannot move on to a live environment and handle real payments until you have confirmed that your integration works as desired in all scenarios.

## Prerequisites {#prerequisites}

Before you start testing your Hosted Session integration, you must complete:

* \[Basic integration\] using sessions and hosted fields to gather payment details.
* Any \[customizations\] you want to make to the hosted fields on your payment page.
* Integration for any \[subsequent Operations\] you want to handle within your order lifecycles.
* Any customizations related to the [payment methods](https://developer.mastercard.com/mastercard-gateway/documentation/payment-methods/index.md) you want to support.
* All additional \[features\] and \[security-related\] functionality you need.

## Testing your integration {#testing-your-integration}

Cover at least the following steps in your testing:

1. For the payment methods you support, test all individual Operations you want to use in your integration where payer interaction is needed on the hosted payment fields to store the necessary details into the session. Test the process from creating the session to providing the hosted fields, updating the session with the field values, and finally sending the payment transaction using the session.
2. Test that any customizations you have made for the hosted fields work as expected.
3. For the payment methods you support, determine the payment flows or combinations of initial and subsequent transactions you want to be able to use in your integration. Test all the flows with all possible combinations of subsequent transactions.
4. Test all the additional features and security-related functionality that you are using.
5. Confirm that your system reacts appropriately and overcomes all common error scenarios related to invalid requests and server problems.
6. Determine the transaction responses that require further actions from you, and test that your integration is taking expected actions.

### Testing tools {#testing-tools}

To test your integration, the Mastercard Gateway provides some helpful tools:

* **Simulators** : You can test your requests using various simulators, which you can access from your test merchant account. To confirm that you are using your test merchant account, check that the merchant ID supplied by your payment service provider has the prefix "TEST". All requests sent with the test merchant ID are regarded test requests and handled by the simulators. They are not sent forward to actual providers, issuers, and acquirers. Warning: If you already have a merchant ID that has the "TEST" prefix that is your test merchant account your payment service provider sends you another merchant ID when you are ready to process live transactions. The test merchant account is a wholly separate account with a different API password or certificates from your regular account. When switching from one to the other, make sure to change both your merchant ID and any authentication credentials. For more information on specific simulator features and options, see the test instructions within specific payment methods.
* **Test cards**: If you support card payments as payment methods, the gateway provides test cards to enable you to test various scenarios, including EMV 3-D Secure authentication. For more information, see \[Test Cards\] and \[Testing Your Integration for EMV 3-D Secure Authentication\].
* **Predictable response results**: The test simulator is configured to generate predictable results based on the transaction request and the card details you supply. For more information, see Test Cards. You can trigger transaction responses that contain a specific Mastercard Gateway Response Code or Card Security Code validation result, as well as Address verification Response Code, and ensure that your integration reacts appropriately to each.
* **Additional logging for testing purposes**: To support additional logging while testing your Hosted Session integration using a TEST merchant ID, append ?debug=true to the URL when including the Session JavaScript library on your payment page.

```html
<html>
<head> 
<script type="text/javascript" src="{{host}}/form/version/<version>/merchant/<merchant_ID>/session.js?debug=true"></script>
</head>
</html>
```

