Reading data from a file

Posted 4 months ago by John

Post a topic
Answered
J
John

Is it possible to create a test that reads data from a file and uses the data to fill out a form?

0 Votes

Mason Lopez

Mason posted 4 months ago Best Answer

Yes, Alchemy has some great features in this area.  Alchemy supports the creation of data-driven-tests.  You can parameterize the inputs to your form, and it is pretty easy and intuitive to do.  There are several different data sources you can create: CSV, Synthetic, or Static.  It is a lot to write about here.  I would suggest watching the YouTube video series for Data-Driven Testing in Alchemy:


Part 1 - Using Data Files

Part 2 - Using Synthetic Data

Part 3 - Creating Synthetic Data


If you want to run the same test logic, but over multiple rows of test data, you would probably store your test data in a spreadsheet, then save it as a .csv (Comma delimited) file.  Now, inside the Alchemy client, head over to the Data tab.  There, you can add a data source of type:CSV, and point it to your csv file.  Alchemy will read the data from the file, and show you a representation of the content.


Now that you have created the data file, and created the data source in Alchemy, the next step is to use the data in your test.  Here, I assume that you have recorded the test already and the steps contain the values you typed into or selected in the form at the time of recording.  Locate the Data Toolbox drawer on the right side of the Alchemy client, and click on it.  Now expand the Data section of the Data Toolbox.  You should see one or more tables, depending how many data sources you created.  Expand the appropriate table and drag, for example, the 'FirstName' column into your test step that types the first name into the form.  Continue for all the other data elements that are hardcoded into your recorded script, dragging the appropriate column into the test step's value field where the recorded data appears.


Finally, to make your test run for each row of test data, click on the Pencil at the top left of your test canvas.  That will open the "Test Information" dialog.  Near the bottom is a "Loop Data" section.  Use the pulldown to select your data table.


Congratulations, you now have a data driven test.  When you run this test in the suite, from the command-line interface, Each row of data will equate to one test.


You could also use the data source in other ways.  For example you could iterate over your data using a Repeater action in Alchemy.  Like I said, Alchemy has a lot of features around data, there is a lot to talk about.  Check out the videos I linked earlier in this answer.

1 Votes


1 Comments

Mason Lopez

Mason posted 4 months ago Answer

Yes, Alchemy has some great features in this area.  Alchemy supports the creation of data-driven-tests.  You can parameterize the inputs to your form, and it is pretty easy and intuitive to do.  There are several different data sources you can create: CSV, Synthetic, or Static.  It is a lot to write about here.  I would suggest watching the YouTube video series for Data-Driven Testing in Alchemy:


Part 1 - Using Data Files

Part 2 - Using Synthetic Data

Part 3 - Creating Synthetic Data


If you want to run the same test logic, but over multiple rows of test data, you would probably store your test data in a spreadsheet, then save it as a .csv (Comma delimited) file.  Now, inside the Alchemy client, head over to the Data tab.  There, you can add a data source of type:CSV, and point it to your csv file.  Alchemy will read the data from the file, and show you a representation of the content.


Now that you have created the data file, and created the data source in Alchemy, the next step is to use the data in your test.  Here, I assume that you have recorded the test already and the steps contain the values you typed into or selected in the form at the time of recording.  Locate the Data Toolbox drawer on the right side of the Alchemy client, and click on it.  Now expand the Data section of the Data Toolbox.  You should see one or more tables, depending how many data sources you created.  Expand the appropriate table and drag, for example, the 'FirstName' column into your test step that types the first name into the form.  Continue for all the other data elements that are hardcoded into your recorded script, dragging the appropriate column into the test step's value field where the recorded data appears.


Finally, to make your test run for each row of test data, click on the Pencil at the top left of your test canvas.  That will open the "Test Information" dialog.  Near the bottom is a "Loop Data" section.  Use the pulldown to select your data table.


Congratulations, you now have a data driven test.  When you run this test in the suite, from the command-line interface, Each row of data will equate to one test.


You could also use the data source in other ways.  For example you could iterate over your data using a Repeater action in Alchemy.  Like I said, Alchemy has a lot of features around data, there is a lot to talk about.  Check out the videos I linked earlier in this answer.

1 Votes

Login or Sign up to post a comment

© Orasi Software, Inc. | All Rights Reserved.