This is a migrated thread and some comments may be shown as answers.

Using "local data" file for internal test data

8 Answers 206 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Svetlana
Top achievements
Rank 1
Svetlana asked on 08 Jun 2010, 09:32 AM
Hi,

I need to create some entity during the test and it's necessary that all properties of the entity are available during the test.
Also I need to save the data into file.

Can I use "Local data" storage for this purpose? And if yes, could you, please give an example how to write a data into "Local data" storage on some step of test.

Thanks,
Svetlana

8 Answers, 1 is accepted

Sort by
0
Missing User
answered on 08 Jun 2010, 06:53 PM
Hello Svetlana,

Edit: I have changed this post due to corrections after the fact and apologize for any confusion.

You can use Log.WriteLine("MyMessage"); to write to the test log on an individual test run.

For Test List Execution, the message will be written to the test log location defaulted to C:\WebAiiLog

An example of a test step customized such as clicking on a cell may looks like:

Pages.Google.TableCell.Click(false);

Pages.Google.TableCell is a wrapper class that has properties populated by the table cell on the page and then write all that information to your file. Here is a link to the Html Control Wrapper documentation.

All the best,
Nelson Sin
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Svetlana
Top achievements
Rank 1
answered on 09 Jun 2010, 08:51 AM
Hi Nelson,

Seems that I expressed the situation not fully... I have an entity on my site (e.g. user). User has many properties: First name, Last name, age, login, e-mail e t.c.
During the test I need to create random user (I can get the data from stand alone application) and save the user's info to some storage for verification on last test's step. As for now, I'm using logging (for saving the info in file for visual verification after the test) and variables (for verification during the test).

The question is: may I use "Local data" storage to perform the verification easier?

Thanks,
Svetlana
0
Missing User
answered on 09 Jun 2010, 05:51 PM
Hi again Svetlana,

Thanks for clearing this up some more. You can use WebUI's data driven feature for verification test steps as well. Please see the attached screenshots for binding a data source to a test and the quick start guide 'Creating a Data Driven Test' topic for reference on how to do this.

You can access the local data if you are storing it in a data base, excel, cvs, or xml file. There is also the local data grid that you can use to bind data as well.

Please let us know if this is what you were looking for.

Kind regards,
Nelson
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Missing User
answered on 17 Jun 2010, 04:42 PM
Hi again Svetlana,

Just wanted to check back to see if this worked out for you.

Greetings,
Nelson
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Svetlana
Top achievements
Rank 1
answered on 05 Jul 2010, 11:59 AM
Hi Nelson,

Is there a possibility to set value in local data grid at runtime?

Regards,
Svetlana
0
Missing User
answered on 06 Jul 2010, 09:06 PM
Hi again Svetlana,

You can use the data driven feature to also data bind to any test step that does any user input on fields, like typing, setting text fields or drop down menu selections.

Hope that helps,
Nelson
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Svetlana
Top achievements
Rank 1
answered on 07 Jul 2010, 08:57 AM
Hi Nelson,

The key problem is that I don't have the values to be set before the test execution, they will be generated on runtime.

Is it possible to write something like this:
(string)Data["Animals"] = myStringVariable;

To be used in standard (not coded) steps?

Regards,
Svetlana
0
Missing User
answered on 07 Jul 2010, 04:48 PM
Hello again Svetlana,

So from what I understand in the code, it looks like you are wanting to set a variable and use it later which is not something you can do in a standard, non-coded recorded step. The data would be used immediately to set or verify a field on the page

Please remember if you decide to use the code you posted to data drive your test, the entire test will run for each data row you have in your data source.

Kind regards,
Nelson
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
Svetlana
Top achievements
Rank 1
Answers by
Missing User
Svetlana
Top achievements
Rank 1
Share this question
or