# How to create a testing environment of import and export records or contents

**URL:** <https://the.fmsoup.org/t/how-to-create-a-testing-environment-of-import-and-export-records-or-contents/1707>\
**Category:** Questions\
**Tags:** scripting\
**Created:** [February 17, 2021, 6:37am UTC](https://the.fmsoup.org/t/how-to-create-a-testing-environment-of-import-and-export-records-or-contents/1707 "2021-02-17T06:37:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![samfmp](https://avatars.discourse-cdn.com/v4/letter/s/a9a28c/32.png) [@samfmp](https://the.fmsoup.org/u/samfmp)\
**Post date:** [February 17, 2021, 6:37am UTC](https://the.fmsoup.org/t/how-to-create-a-testing-environment-of-import-and-export-records-or-contents/1707/1 "2021-02-17T06:37:14Z")

</div>

Hi, I would like to test the import record and export record steps in my solution. Are there any ways to make these steps fail so that I could test the error handling?

---

<div class="post-metadata">

**Author:** ![Malcolm](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/malcolm/32/196_2.png) [@Malcolm](https://the.fmsoup.org/u/Malcolm)\
**Post date:** [February 17, 2021, 7:44am UTC](https://the.fmsoup.org/t/how-to-create-a-testing-environment-of-import-and-export-records-or-contents/1707/2 "2021-02-17T07:44:05Z")

</div>

There are so many ways for the import/export to fail that its not funny. Not all of these will definitely cause your import to break, but they may help things go wrong.

Change a file name  
add/remove header rows  
Change the input file text encoding  
Add commas to a CSV file  
Include unicode characters  
Change field names in the database  
Change layout names  
Change the script name  
Login as a different user  
etc,

---

<div class="post-metadata">

**Author:** ![samfmp](https://avatars.discourse-cdn.com/v4/letter/s/a9a28c/32.png) [@samfmp](https://the.fmsoup.org/u/samfmp)\
**Post date:** [February 17, 2021, 7:49am UTC](https://the.fmsoup.org/t/how-to-create-a-testing-environment-of-import-and-export-records-or-contents/1707/3 "2021-02-17T07:49:42Z")

</div>

Thank you. If my script exports data from table A to a temporary path, then imports data from this temporary path to table B and does some data manipulating, finally it export data as csv.

In this scenario, is that ok to just handle error of last exporting record step?

---

<div class="post-metadata">

**Author:** ![Malcolm](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/malcolm/32/196_2.png) [@Malcolm](https://the.fmsoup.org/u/Malcolm)\
**Post date:** [February 17, 2021, 7:19pm UTC](https://the.fmsoup.org/t/how-to-create-a-testing-environment-of-import-and-export-records-or-contents/1707/4 "2021-02-17T19:19:59Z")

</div>

Did the data export cleanly?  
Is it correct?  
Was it moved / disappeared / locked before import?  
Is the environment it is being imported into the same? (change to the import table can affect you)  
How do you know the correct records arrived in the correct location?
