define_testrun.py 520 B

1234567891011121314151617181920212223242526272829
  1. import pandas as pd
  2. import json
  3. path_to_excel = '../DropsTestRunDefinition.xlsx'
  4. path_to_json = 'testrun.json'
  5. xl = pd.ExcelFile(path_to_excel)
  6. # parse TestCaseSequence
  7. df = xl.parse('TestCaseSequence')
  8. for name in df:
  9. print(name)
  10. '''
  11. testrun = {}
  12. for i in range(len(df)):
  13. step = {
  14. 'name': df['Name'][i],
  15. 'description': df['Description'][i],
  16. 'activity_type': df['ActivityType'][i],
  17. 'locator_type': 'xpath',
  18. }
  19. steps.append(step)
  20. # dump to json
  21. with open(path_to_json, 'w') as f:
  22. json.dump(steps, f)
  23. '''