# Test using Construct Editor

Folllow the below steps to easily test the implementation of Web to Game events in your H5 game using Construct Editor.

1. Run the game in Construct Editor using the Preview Layout button.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXc9N2auwrGVs8JyvsVP4oClPxFB7aQzrIRa-6UOjpaxCjKZLmbYFa6Q2qS9dZyZ8BW2Y_8BSlrFNOuNpgJIbBRUm-LROfa6qJpfzkN9zgqUeLsQ1ujnHgr7P6FKTnPynhsXR0y2?key=g_KCpkKpxwohLAYsAU9Jjbiu" alt="" width="563"><figcaption></figcaption></figure>

2. When the game opens in a new browser window, open the browser’s Console. For example, if you are using Chrome on Mac, then press "CMD + Shift + i"

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXe_zTVuNA4ePXE-3C4MJgSmD7DjniutqkudPfuWYPsYEvkQNc7Zfy3o3u5u2gyLnoxKHeX5WLV_ANhcq8v42tRg4DusZdqMkSQwUOM7BHhNF6R3hqf9cZnGq8M4VZIkaUNcDw4?key=g_KCpkKpxwohLAYsAU9Jjbiu" alt="" width="375"><figcaption></figcaption></figure>

3. Paste the following code in the Console

```javascript
postMessage({funcName: “string”, …other data}, "*")
```

<figure><img src="/files/VKtYq5MW9VKg34oPuQFh" alt="" width="563"><figcaption></figcaption></figure>

4. Replace `string` with the name of the Web to Game event you are trying to test and `...other data` with any parameters you want to pass (leave it blank if there are none). For example, to pause the game you can type:

```javascript
postMessage({funcName: "game_pause"}, "*")
```

<figure><img src="/files/4dlC6bvKxbvJKSy5Oeir" alt="" width="563"><figcaption></figcaption></figure>

Note: You can ignore the Console message “Unexpected message type ‘undefined’”

5. Hit enter! This will simulate the event ArcPlay would be sending.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXco62Rg0aUf92fHLVFJooTVjtXAW64QgGA8ovbB4Vv4UUAgnBTZay0ss1E0fMH9mcW1HzrkWZtlL1jvwCvbCcfn4WT292hnrAvFk2V4t-sx6serxY5UD5-e90FRQo7iDIqASTBJ?key=g_KCpkKpxwohLAYsAU9Jjbiu" alt="" width="375"><figcaption></figcaption></figure>

6. Voila! You can now repeat the Steps 4 and 5 to test the rest of the Web to Game events.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://arcplay-ai.gitbook.io/knowledge-portal/for-h5-games/integration-steps/web-to-game-events-listner/test-using-construct-editor.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
