cancel
Showing results for 
Search instead for 
Did you mean: 

Changing Excel Data Source file name based on Environment change

SOLVED
New Contributor

Changing Excel Data Source file name based on Environment change

I wish to use the same scripts but across a number of environments.  I would like each environment to use a different Excel data file to populate the data source.  However, I can not see how this can be achieved?  I have been able to change web service connection points and JDBC connections, but can not see how to change the file name for an Excel Data Source.

 

I would even be happy to change the tab name, rather than the file name, but this does not seem possible either.

1 ACCEPTED SOLUTION

Accepted Solutions
New Contributor

Re: Changing Excel Data Source file name based on Environment change

Found my own answer.

 

In case anyone else is wondering, what I did was create a Custom Property "sourceFile".

Then in the Excel data source definition, I was able to reference that Custom Property by putting "${#Project#sourceFile}" in the file name property.  I also assume (although have not yet tested) that I would be able to change the Worksheet name in the same way.

 

Hope others find this useful.

2 REPLIES 2
New Contributor

Re: Changing Excel Data Source file name based on Environment change

Found my own answer.

 

In case anyone else is wondering, what I did was create a Custom Property "sourceFile".

Then in the Excel data source definition, I was able to reference that Custom Property by putting "${#Project#sourceFile}" in the file name property.  I also assume (although have not yet tested) that I would be able to change the Worksheet name in the same way.

 

Hope others find this useful.

Moderator

Re: Changing Excel Data Source file name based on Environment change

Hi @PMarriott,

 

Well done! Thanks for sharing Smiley Happy

 

Olga Terentieva,
SmartBear Assistant Community Manager

New Here?
Join us and watch the welcome video:
Watch the new Interview
Top Kudoed Authors