TestProject Forum

How to read a csv file from skydrive?

Is there is way to read CSV files from Skydrive directly as test data soruce ?

Hi @Hari,
Do you mean from OneDrive? if so you can do this using API.

  1. login to graph API using your Microsoft account used in one drive.
  2. Go to simple queries and then go to Access token

  1. Then save this in Project parameter set as secret
    you should add this to the parameter
 Bearer {Your token},Accept=*/*
  1. First you will need to run this API to get the file id
https://graph.microsoft.com/v1.0/me/drive/root/children
  1. In the response search for the file you want and you will be able to see there your id of the file

chrome_lQ8uoI3sBk

  1. Then use this API call to get the worksheet data
https://graph.microsoft.com/v1.0/me/drive/items/{file id}/workbook/worksheets('Sheet1')/usedRange

  1. In your request you should add JsonPath - $.text
    That way you will get your text content like this for this kind of a file

[[“Tal”,“TP”,“CS”],[“Correct”,“cmd”,“Windows”]]

Please let me know if you managed to implement this