Page 1 of 1

Help:How to make Repository Item Data Driven

Posted: Sat Apr 30, 2016 10:19 pm
by sensay
I am trying to make the url section of a test to be data driven.

I have already done data binding to the recording module with an excel sheet and it works fine. But having hard times to data bind the repository items as a result i have to manually edit it everytime before running the test.

Can anyone tell me the ways to data bind the repository items.

I did look at the tutorial about how to make repository items data-driven. But still no luck :(

Do i need to add another excel sheet to the repository?
Please help

Re: Help:How to make Repository Item Data Driven

Posted: Mon May 02, 2016 8:07 am
by odklizec
Hi,

I'm not sure what exactly is your problem? From what you posted it looks like there should be no problem with connecting variables with data connector. I don't understand what you mean by "i have to manually edit it everytime before running the test"? If the Domain string looks different from the url you want to open in browser, then you need to use two different variables (one for 'domain' attribute, and another one for URL path).

To be honest, I would strongly discourage you from variabilizing 'domain' attribute of the DOM element. The problem is, that DOM is a top level object in your repo hierarchy, which means you will have to bind the VarURL variable in every single recording module you add to your project.

Re: Help:How to make Repository Item Data Driven

Posted: Mon May 02, 2016 2:47 pm
by krstcs
I would argue that if you name your variables the same as the data columns in your data connectors, it doesn't matter how many modules a variable is in. Autobind will bind them correctly automatically for the whole test case at a time.

I use domain as a variable in every web-based test I make because otherwise you would have to make a new repo object for every /dom you are going to hit (in my case 5 different ones for different version staging areas), which means multiples of EVERY OBJECT UNDER THE DOM. This is not the right way to do it and it isn't maintainable. Making the domain a variable is the correct way to handle this as you only need one copy of any repo object. In addition, once the variables are mapped once, you don't have to do it again.