简体   繁体   English

当框架是Hybrid并且测试用例是由Selenium中的excel驱动时,如何使用TestNG注释?

[英]How to use TestNG annotations when the framework is Hybrid and test cases are driven by excel in Selenium?

When I use a Hybrid framework using Selenium where my test cases are driven by Excel, how can I use TestNG annotations like @Test for my test cases which are in Excel format? 当我使用Selenium的混合框架,我的测试用例由Excel驱动时,我如何使用@Test等TestNG注释来处理Excel格式的测试用例? Meaning, I have all my test steps converted in Excel as Element, Action and Data combination to trigger an action in UI. 这意味着,我将所有测试步骤在Excel中转​​换为元素,动作和数据组合,以触发UI中的操作。

I will be calling a method in main() which in turn calls another method where the reading of Excel and converting the set of rows/columns to frame the Selenium command to trigger events for a test case flow. 我将在main()中调用一个方法,该方法又调用另一个方法,其中读取Excel并转换行/列集以构建Selenium命令以触发测试用例流的事件。 Given this, how/where can I mention @Test to let TestNG that this is my test method? 鉴于此,我如何/在哪里可以提到@Test让TestNG这是我的测试方法?

I have 1000+ test cases to execute and planning to use Selenium GRID for distributed execution in multiple VMs. 我有1000多个测试用例要执行并计划使用Selenium GRID在多个VM中进行分布式执行。 In order to do this, I believe we need to have TestNG to let Selenium GRID know that these are my test methods. 为了做到这一点,我相信我们需要让TestNG让Selenium GRID知道这些是我的测试方法。 Any help on this regard is highly appreciated. 对此方面的任何帮助都非常感谢。

Regards, Bala 此致,巴拉

Stop wasting time on excel driven solutions. 停止在excel驱动的解决方案上浪费时间。 Write normal code for elements and actions. 编写元素和动作的正常代码。 Combine them in your tests. 在测试中将它们组合在一起。 Feed with data which will be populated to the forms. 使用将填充到表单的数据进行提要。 That's all. 就这样。 There are a lot of frameworks which make it an easy task. 有很多框架使它成为一项简单的任务。

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

相关问题 如何在测试用例中使用testng注释? - How to use testng annotations in test cases? Cucumber框架如何正确使用TestNG注解 - How to use correctly TestNG annotations with Cucumber framework 如何构建数据驱动的 Selenium WebDriver + Java + TestNG 框架 - How to Build a Data Driven Selenium WebDriver + Java + TestNG Framework 在TestNG框架中运行测试用例 - running Test cases in TestNG framework 如何使用带有Selenium WebDriver的TestNG Framework在Excel文件中编写测试结果(通过/失败)? - How can I write Test Result (Pass/Fail) in Excel file using TestNG Framework with Selenium WebDriver? 如何从网站获取数据并在 excel Page object model 中打印 - How to fetch data from website and print in excel Page object model, Data driven and page factory this is hybrid framework 如何在java中使用testng注释 - How to use testng annotations in java 如何在关键字驱动的框架中实施TestNg报告 - How to implement TestNg reporting in keyword driven framework 如何使用来自excel文件的不同测试数据集在testng中运行多个测试用例? - How to run multiple test cases in testng with different set of test data from excel file? Web驱动程序和数据驱动框架中的testng的并行执行测试是否可靠 - Is parallel execution of test is reliable in Web driver and testng in data driven framework
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM