Ask a Question

How to set Data Source path to use on local as well as CI/CD in Azure DevOps

SOLVED
thanvikunal
Established Member

How to set Data Source path to use on local as well as CI/CD in Azure DevOps

Hi Team,

 

I have a question related to setting data source path so that I can use the same input excel file in local as well as Azure DevOps pipeline.

 

I am moving my project and data source (Excel document) from local to Git repository manually. The aim is to run the project in Azure DevOps pipeline.

 

Consider my data source path mentioned in the project file is "C:/TestDocuments/Inputfile.xlsx". The moment I put my project in Git repo and try to access it through pipeline, I can provide path for project however I can't provide the path for input source file from Git repo. It means my project still tries to get source file path from my local machine. I tried reading the others posts but they do not provide information on how to update the source file path for CI CD.

 

This blocks me while executing data driven testing in Azure DevOps pipeline. Please share any solution you have.

1 ACCEPTED SOLUTION

Accepted Solutions
PrathapR
Frequent Contributor

Re: How to set Data Source path to use on local as well as CI/CD in Azure DevOps

Hi @thanvikunal 

Can you please use relative paths.

Instead of using  "C:/TestDocuments/Inputfile.xlsx" use ${projectDir}/Inputfile.xlsx. Always keep the excel file along with project file(.xml) wherever you store, either in version control or local. Can also keep in a folder(ex: TestData) like ${projectDir}/TestData/Inputfile.xlsx. And Change like below at project level properties.

 

RelatvPath.png

 

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

 

Thanks!

View solution in original post

2 REPLIES 2
PrathapR
Frequent Contributor

Re: How to set Data Source path to use on local as well as CI/CD in Azure DevOps

Hi @thanvikunal 

Can you please use relative paths.

Instead of using  "C:/TestDocuments/Inputfile.xlsx" use ${projectDir}/Inputfile.xlsx. Always keep the excel file along with project file(.xml) wherever you store, either in version control or local. Can also keep in a folder(ex: TestData) like ${projectDir}/TestData/Inputfile.xlsx. And Change like below at project level properties.

 

RelatvPath.png

 

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

 

Thanks!

View solution in original post

sonya_m
Community Manager

Re: How to set Data Source path to use on local as well as CI/CD in Azure DevOps

Awesome advice Redde, thanks!

 

@thanvikunal does this help?


Sonya Mihaljova
Community and Education Specialist

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
cancel
Showing results for 
Search instead for 
Did you mean: