Page 1 of 1

create excel connector and do data binding from code.

Posted: Fri Jul 08, 2016 4:26 am
by siddhantsudan
Hi,

I wanted to know whether it is possible to specify the excel file path in data driven testing at runtime or in code. Currently I have created a data connector and I am using the test suite's "manage data sources" to specify the file name.The problem is that I will have multiple excel files with different data but same column names and on the basis of the username of the user who is running ranorex I will have to pick the corresponding excel file (name of excel is the username).Thanks in advance.

Re: create excel connector and do data binding from code.

Posted: Mon Jul 11, 2016 10:09 am
by jma
Hi,

a similar topic was already discussed in the following forum thread: http://www.ranorex.com/forum/multiple-d ... tml#p31720

You could create different data sources for each excel file and set the data source of the test case accordingly. Note that this information needs to be updated before the corresponding test case is executed.

Hope that helps!

Re: create excel connector and do data binding from code.

Posted: Fri Jul 15, 2016 8:36 am
by siddhantsudan
jma wrote:Hi,

a similar topic was already discussed in the following forum thread: multiple-data-source-in-one-test-case-or-use-ancestor-s-t7838.html#p31720

You could create different data sources for each excel file and set the data source of the test case accordingly. Note that this information needs to be updated before the corresponding test case is executed.

Hope that helps!
I do not want to create excel connectors in ranorex studio and then choose one of them in code.I want to create one connector but I just want the excel file path for that connector to change at runtime(using code).This should not change the data binding .The problem with creating multiple connectors is that I would have to create a new connector each time a new user wants to use the solution because the file for the user would be at a different location.

Re: create excel connector and do data binding from code.

Posted: Mon Jul 18, 2016 12:01 pm
by jma
I'm afraid there is no way to update the path of the data connector during runtime. In this case, I would suggest specifying the same path/file name for each data source (for example, C:\TestData\test.xlsx). Before the test is executed, you will need to deploy the correct test data (according to the user) to that file location. For example, the user specific file user.xlsx will be copied to test.xlsx.