> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt ## Resource: About Testing Your Code in Preview Mode ## Article: About Testing Your Code in Preview Mode ## Article Link: https://dev.wix.com/docs/develop-websites/articles/workspace-tools/testing-monitoring/testing-troubleshooting/about-testing-your-code-in-preview-mode.md ## Article Content: # About Testing Your Code in Preview Mode You can test the code on your site before publishing using Preview mode. You can perform any actions in Preview mode that you would be able to perform on your live site. When testing your site, you can check if any errors appear in the [Wix Developer Console](https://dev.wix.com/docs/develop-websites/articles/workspace-tools/testing-monitoring/testing-troubleshooting/about-debugging-your-code.md#debugging-with-the-developer-console). ## Supported IDEs Preview mode is available in Wix Studio and Wix Editor. If you're developing in the [Wix IDE](https://dev.wix.com/docs/develop-websites/articles/workspace-tools/velo-workspace/wix-ide/wix-studio-about-the-wix-ide.md) or the [Local IDE](https://dev.wix.com/docs/develop-websites/articles/workspace-tools/developer-tools/git-integration-wix-cli/about-git-integration-wix-cli.md), you can open your site in Wix Studio or Wix Editor to use Preview mode. ## Enter Preview mode To enter Preview mode in **Wix Studio**, either click the **Run** button in the code editor toolbar, or the preview button on the top right. ![Open Preview mode in Studio](https://wixmp-833713b177cebf373f611808.wixmp.com/images/ffbb8a64bf8ec23768ffae14d7c60cc1.png) To enter Preview mode in **Wix Editor**, either click on the **Run** button in the [code editor toolbar](https://support.wix.com/en/article/velo-working-with-the-code-panel-toolbar-and-right-click-menu), or the **Preview** button in the Editor on the top right. ![Open Preview mode in Editor](https://wixmp-833713b177cebf373f611808.wixmp.com/images/07a171db7d78c7d40a3980c98fccd4d5.png) ## Collections in Preview mode When you've finished previewing and return to the Editor, interactions you had with your site aren't maintained. Your site returns to the state it was in before you entered Preview mode. The only exception is your optional [sandbox collection](https://support.wix.com/en/article/cms-about-sandbox-and-live-collections-and-syncing), which is disabled by default. The sandbox collection is useful when you want to test your site without affecting your site's data. When the sandbox collection is enabled and you interact with data from your collections, you'll be using the optional sandbox version of your collections, not the live version. Changes to data that result from interactions with your site in Preview mode persists in your optional sandbox database. ## Differences between Preview mode and published sites Although your can view your pages and interact with your site and data in Preview mode, the site doesn't behave exactly as it does when published: + When previewing your site, you are assigned the Admin [role](https://support.wix.com/en/article/about-database-collection-permissions#roles). That means you are granted all possible [permissions](https://support.wix.com/en/article/database-permissions#permissions). Users of your live site might have different permissions and therefore have more restricted access. + When previewing your site with [sandbox enabled](https://support.wix.com/en/article/about-sandbox-and-live-collections-and-syncing), you're working with the data in your site's optional [sandbox database](https://support.wix.com/en/article/sandbox-data-vs-live-data#sandbox-data). Users of your live site work with your [live database](https://dev.wix.com/docs/develop-websites/articles/databases/wix-data/collections/importing-and-exporting-collection-data-with-code.md#using-the-form-with-the-live-collection-without-publishing-your-site). [Wix app collections](https://dev.wix.com/docs/develop-websites/articles/databases/wix-data/collections/working-with-wix-app-collections-and-code.md), however, only have the live database version. Any changes you make to these collections in Preview mode are reflected in your published site.   + Backend events and several other APIs don't necessarily work when previewing your site. We note when this is the case in the reference. > > You can try out a test version of your published site on a small percentage of visitors using the [Release Manager](https://dev.wix.com/docs/velo/articles/getting-started/testing-and-debugging.md#release-manager). This is helpful for testing functionality that only works on a published site without exposing that functionality to all site visitors. ## Handling errors If you see errors or your site isn't running as expected, there are tools you can use to debug the code in your site. + [Developer console:](https://dev.wix.com/docs/develop-websites/articles/workspace-tools/testing-monitoring/testing-troubleshooting/about-debugging-your-code.md) Debug in Preview mode. + [Functional testing:](https://dev.wix.com/docs/develop-websites/articles/workspace-tools/testing-monitoring/functional-testing/about-functional-testing.md) Trigger and debug backend code in the code editor. + [Browser developer tools:](https://dev.wix.com/docs/develop-websites/articles/workspace-tools/testing-monitoring/testing-troubleshooting/about-debugging-your-code.md) Debug your sites in Preview mode, published sites, and test sites. + [Logs:](https://dev.wix.com/docs/develop-websites/articles/workspace-tools/testing-monitoring/testing-troubleshooting/about-debugging-your-code.md#debugging-with-wix-logs) Debug in Preview or Published mode. ## See also + [About Debugging Your Code](https://dev.wix.com/docs/develop-websites/articles/workspace-tools/testing-monitoring/testing-troubleshooting/about-debugging-your-code.md)