cancel
Showing results for 
Search instead for 
Did you mean: 

Excel data sources - using a relative path name for files

SOLVED
Contributor

Excel data sources - using a relative path name for files

We need to use ReadyAPI across different machines. Our code is checked out from Git and sometimes our local directories differ (for example I use E:\, a colleague uses C:\)

 

As we need to share our data sources (excel files) that are also checked in, how can they be set in ReadyAPI to use a relative Path, instead of fixed paths?

1 ACCEPTED SOLUTION

Accepted Solutions
Community Leader

Re: Excel data sources - using a relative path name for files

Hi @maxrussell 

Can you please use relative paths.

Instead of using  "E:/GitRepo/Test/Sample.xlsx" use ${projectDir}/GitRepo/Test/Sample.xlsx. Always keep these excel file folders(Ex:GitRepo/Test..along with project file(.xml)  wherever you store, either in version control or local.  And Change like below at project level properties.

 

PrathapR_3-1607620892699.png

 

https://support.smartbear.com/readyapi/docs/testing/best-practices/root.html

 

Thanks!

View solution in original post

4 REPLIES 4
Contributor

Re: Excel data sources - using a relative path name for files

When I try to use the $projectDir variable, I get errors on my datasource test steps:

Community Hero

Re: Excel data sources - using a relative path name for files

Hey @maxrussel,

Can you indicate step by step exactly what you did please?
Looking at the screenshot it appears that two full paths have concatenated so it reads something like E:/...E:/fullpath

Ta

Rich
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
Community Leader

Re: Excel data sources - using a relative path name for files

Hi @maxrussell 

Can you please use relative paths.

Instead of using  "E:/GitRepo/Test/Sample.xlsx" use ${projectDir}/GitRepo/Test/Sample.xlsx. Always keep these excel file folders(Ex:GitRepo/Test..along with project file(.xml)  wherever you store, either in version control or local.  And Change like below at project level properties.

 

PrathapR_3-1607620892699.png

 

https://support.smartbear.com/readyapi/docs/testing/best-practices/root.html

 

Thanks!

View solution in original post

Community Manager

Re: Excel data sources - using a relative path name for files

Thanks everyone!

 

@maxrussell Does the suggestion help? Please let us know.


Sonya Mihaljova
Community and Education Specialist

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors