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

Data Binding: is it possible to change linked file at runtime?

3 Answers 132 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Svetlana
Top achievements
Rank 1
Svetlana asked on 06 Jul 2010, 05:23 PM
Hello,

I have some file (e.g. file.csv) which is binded to my project and some test.

File's content is:
Name, Surname
SomeName, SomeSurname

There is an example of reading binded data in 'Quick start guide', but examples on how to write some values in existent file are absent.

Is there a possibility to change binded file at runtime in order to use changed values in latest steps and to have them after test execution?

Regards,
Svetlana

3 Answers, 1 is accepted

Sort by
0
Missing User
answered on 06 Jul 2010, 11:27 PM
Hi Svetlana,

Thanks for the post and question. Unfortunately, there is not a way to do this with any built in feature as using WebUI's data driven functionality only allows for binding 1 source per test, but I'll log a feature request for this. 

It would probably be easiest to do what you wanted in code and not use WebUI's data driven feature. If you converted a WebUI test step that set's Google's Search Box, you can see how to use your custom CSV access code to set that value for an example.

Here is a reference for writing code using the framework WebUI is built on, but you would have to write any CSV file or data source access code.

Kind regards,
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 07 Jul 2010, 10:29 AM
Hi Nelson,

Thank you for the reply.
Seems that I expressed the situation not fully. I need to make changes in already binded file's content.

E.g file's content before test execution:
Name, Surname
SomeName, SomeSurname

But I need to change some field at runtime:
Name, Surname
AnotherName, SomeSurname

There is no necessity to bind one more file. Can I make changes in currently binded one?

Regards,
Svetlana
0
Missing User
answered on 07 Jul 2010, 05:37 PM
Hi again Svetlana,

Thanks for clearing that up.

So this would also be something that is not supported out of the box in WebUI, you would need to write custom code to write to the .csv file.

But besides the code for accessing and writing to the .csv file, where you looking to update the original copy of the .csv file or the copy that WebUI uses? And were you looking for WebUI to use updated values from the .csv file?

Updating the original .csv file will probably not be too much of a problem, even if you needed values from the page under test. To obtain values from the page, please see the link in my previous post about the framework.

Since WebUI uses it's own local copy, I'm not sure if you will run into any locking issues for the .csv file or if WebUI will be able to use updated values in later data driven iterations if that is what you were looking to do.

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