[英]Keyword driven framework (Selenium) in Java
I have created a Hybrid framework (Keyword driven + TestNG). 我创建了一个混合框架(关键字驱动+ TestNG)。 It is in Java and to execute the methods, I use reflections in Java.
它在Java中,为了执行这些方法,我在Java中使用了反射。 The code is in such a way that I am executing all methods (Action Keywords) using a single line of code (method[i].invoke()) Reflections and hence all the methods have to take same number and the same type of inputs.
代码的方式是,我使用一行代码(method [i] .invoke())反射来执行所有方法(动作关键字),因此所有方法都必须采用相同数量和相同类型的输入。 Is there a way in java that we can implement keyword driven framework without reflections or a better approach to achieve keyword driven framework with reflections?
在Java中,有没有一种方法可以实现无反射的关键字驱动框架,或者有更好的方法来实现有反射的关键字驱动框架?
I found the answer. 我找到了答案。 We can create keyword driven framework with keyword methods having the different number of parameters.
我们可以使用具有不同数量参数的关键字方法创建关键字驱动的框架。 Please check http://www.seleniumeasy.com/selenium-tutorials/keyword-driven-framework-example
请检查http://www.seleniumeasy.com/selenium-tutorials/keyword-driven-framework-example
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.