简体   繁体   English

硒自动化测试,可帮助手动测试人员编写测试脚本

[英]Selenium automation testing that helps manual testers to write tests scripts

I am writing this testing framework using selenium and Java so that manual testers are able to write test scripts and maintain them.I would want my testing framework to be in such a way so that manual testers basically write them as step by step procedures rather then understanding any of the underlying technology. 我正在使用selenium和Java编写此测试框架,以便手动测试人员能够编写测试脚本并对其进行维护。我希望我的测试框架采用这样的方式,以便手动测试人员基本上将它们逐步编写为程序,而不是了解任何基础技术。

I want manual testers to write scripts as below: 我希望手动测试人员编写如下脚本:

    click("Configure");
    click("Network");
    click("Port Setup");

Configure, Network, PortSetup are all buttons with value/id: configure, network, port-setup. 配置,网络,端口设置是具有值/标识的所有按钮:配置,网络,端口设置。 How do I write a framework with a method "click" that can scan through the entire page and click on buttons with values/ids that has been passed on click method by testers? 如何编写带有“点击”方法的框架,该方法可以扫描整个页面并单击测试人员在点击方法中传递的带有值/标识的按钮?

IMHO, I'd suggest allowing the testers to utilize the element locators that Selenium provides ( See here ). 恕我直言,我建议允许测试人员使用Selenium提供的元素定位器( 请参见此处 )。 Doing otherwise and writing "all-purpose" wrapper methods such as the below will limit the flexibility that is needed when performing UI testing. 否则,编写“通用”包装方法(例如以下方法)将限制执行UI测试时所需的灵活性。

Provide a class with the following method. 提供具有以下方法的类。 The class can be coded to have the driver method instance available to it, or you may want to pass the driver object in as a parameter. 可以对该类进行编码以使其具有可用的驱动程序方法实例,或者您可能希望将驱动程序对象作为参数传递。

public void click(String locatorValue)
{
     WebElement foundElement = driver.findElement(By.id(locatorValue));
     foundElement.click();
}

Furthermore, this is just a base method. 此外,这只是基本方法。 If you wish to handle additional situations or check for a By.name in case the id doesn't work, then implement the additional logic. 如果您希望处理其他情况或在ID不起作用的情况下检查By.name,请实施其他逻辑。 Again, this can become a very narrow-focused mess very quickly. 同样,这会很快变成非常狭窄的混乱局面。 Good luck! 祝好运!

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

相关问题 手动测试/自动化-Selenium webdriver / TestNG / Nightwatch.js - Manual Testing/Automation - Selenium webdriver/TestNG/Nightwatch.js 一种允许测试人员在Selenium Grid上运行测试的方法 - A way to allow testers to run tests on Selenium Grid Selenium 自动化 - 在邮件中写入文本 - Selenium Automation - Write text in mail 在Selenium Java中编写自动化脚本的准则 - Guidelines for writing automation scripts in Selenium Java 带有Java Eclipse的Selenium自动化脚本进入VSTS - Selenium automation scripts with java eclipse into VSTS 为超过 100 个字段的字段级验证编写 selenium 和 testng 自动化脚本的最佳方法是什么 - What would be the best way to write selenium and testng automation scripts for field level validation tor more than 100 fields 结合使用Selenium和Java进行自动化测试 - Drag & Drop using Selenium with Java for automation testing 使用 Safari 浏览器使用 Selenium 进行自动化测试 - Automation Testing with Selenium using Safari Browser 如何编写 Selenium 自动化测试的伪代码? - How to write a pseudocode of an Selenium automation test? 我们应该为自动化测试代码库编写单元测试吗? - Should we write unit tests for the automation tests code base?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM