我们可以在 Robot Framework 中用 CSV 或 Excel 文件编写测试用例并通过读取 CSV 文件来执行吗 [英] Can we write test cases in CSV OR Excel file in Robot Framework and execute just by reading CSV file

查看:59
本文介绍了我们可以在 Robot Framework 中用 CSV 或 Excel 文件编写测试用例并通过读取 CSV 文件来执行吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究用于移动应用自动化的机器人框架.我已经在 Robot Framework 的 Test Suit 中编写了测试用例和关键字,我可以执行它.但我正在尝试用 CSV 或 Excel 文件编写测试用例,这些文件将作为 Robot Framework 的输入(就像我们在测试完成中所做的那样).我们如何在机器人框架可读的 CSV/Excel 文件中编写测试用例 [寻找格式] 以及我们如何通过读取 CSV 文件在 Robot 中执行这些测试用例.请帮助[注意:目前我只能读取 CSV 文件并记录数据.但它不能在移动设备上执行案例]

I am working on Robot Framework for mobile App Automation. I have written test cases and keywords in Test Suit in Robot Framework and i can execute it. But i am trying to have test cases written in CSV OR Excel file which will be the input to Robot Framework (like we do in Test Complete). How we can write test cases in CSV/Excel file [looking for format] which is readable by Robot-framework and how we execute these test cases in Robot by reading the CSV file.Please help [Note : For now i can just read the CSV file and log the data.But its not executing cases on mobile]

推荐答案

数据驱动的案例,例如 Robot Framework 的模板,实际测试数据是从外部 csv 或 Excel 文件提供的吗?

Data-driven cases like Robot Framework' Template ones, where the actual test data is fed from an external csv or Excel file?

遗憾的是,由于 RF 解析源测试文件并构建其内部对象的方式,目前无法做到这一点.
粗略地说,它在解析时存储 [Template] 案例的当前状态(文本")并用方法等替换关键字,构建要运行的实际案例集, 在这个非常时刻.如果稍后要加载测试数据 - 在运行中注入",它将改变现阶段远非微不足道的案例数量.

Regretfully that is not possible at present, due to the way RF parses the source test files and constructs its internal objects.
Rougly put, at the time of parsing it stores the current state ("the text") of the [Template] case and substitutes keywords with methods etc., constructing the set of the actual cases to be ran, at this very moment. If the test data is to be loaded later on - "injected in the run", it will change the number of cases which is far from trivial at this stage.

我确实看到了库/扩展的价值 - 例如将案例外包"给 PM/开发人员 ;),但不要认为现在有.

I do see value in a library/extension for this - for example to "outsource" the cases to PMs/developers ;), but don't think there is one right now.

这篇关于我们可以在 Robot Framework 中用 CSV 或 Excel 文件编写测试用例并通过读取 CSV 文件来执行吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆