是否有一种元语言可以替代 Selenium 测试套件?

Is there a meta-language that can sit-over a Selenium test suite?

我们有成千上万的测试场景要在 Web 应用程序中进行测试。 是否存在非程序员可以用来指定要执行的测试和获得的结果的元语言系统? 例如:

检查按钮:"Commit"

按下按钮 "Commit"

检查没有按钮"Commit"

检查文本框:"box_error"、"No data entered"

机器人框架 (http://www.robotframework.org) 就是这样一种工具。它是一个关键字驱动的验收测试框架,您可以从中使用 selenium 驱动浏览器。例如,您的测试可能看起来确实像您要求的那样。

这不是您可以随意使用并让非程序员使用的工具。有许多内置关键字和额外的第三方库,但要为您的特定问题域获取一组关键字需要一些工作。

Behat BDD which uses Gherkin种语言。我们有一个 QA 人员,他们对编程的了解为零,他们为我们(开发人员)编写了所有这些场景,因此任何人都可以编写一个场景并理解它。它可以是任何语言。它被广泛使用。

例如:

Feature: User can search something in Google
  As a user
  I want to be able search something in Google

  Scenario: I'll search Behat in Google
    Given I am on "http://www.google.com/"
    When I fill in "search_box" with "Behat"
    And I press "Search"
    Then I should see "Behat Documentation"

结果可以在命令行或实际浏览器中看到 window,例如 Firefox、Chrome、Opera .... https://www.youtube.com/watch?v=hHPgFvkk4Mo

有很多already defined lines/steps for you to use. If there is something missing then you can easily create one with its expected behavior. Checkout this cheat sheet