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.
Preview mode is available in Wix Studio and Wix Editor. If you're developing in the Wix IDE or the Local IDE, you can open your site in Wix Studio or Wix Editor to use 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.
To enter Preview mode in Wix Editor, either click on the Run button in the code editor toolbar, or the Preview button in the Editor on the top right.
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, 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.
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:
You can try out a test version of your published site on a small percentage of visitors using the Release Manager. This is helpful for testing functionality that only works on a published site without exposing that functionality to all site visitors.
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.