简体   繁体   English

如何使用JSON文件传递多行数据

[英]How to pass multi-line data using JSON file

In my application I need to enter multi-line data in one of the field. 在我的应用程序中,我需要在其中一个字段中输入多行数据。 Using JSON file how can I pass the data in my protractor script? 使用JSON文件,如何在量角器脚本中传递数据?

var dataFile = require('../../../test-data/queues.json');

Inside the spec file you can access the same using dataFile.variableName. 在规范文件中,您可以使用dataFile.variableName访问相同文件。

To pass multi-line data you can separate the lines using \\n in json file. 要传递多行数据,您可以在json文件中使用\\ n分隔行。 When you pass the data to your application via protractor it will be send as multi-line data. 当您通过量角器将数据传递到应用程序时,它将作为多行数据发送。

Please let me know if you need any help regarding json structure. 如果您需要有关json结构的任何帮助,请告诉我。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM