1

Just wondering how other people manage their test cases that are written for selenium test automation? I've been investigating maybe integrating with testlink to show the results and all, but I already have Jenkins set up for my environment and running my tests. What I'm really looking for is some way to nicely document my tests, like what steps each test performs for non-programmers.

I'm using Selenium with python, and Jenkins to run the tests.

4 Answers 4

5

I've tried two ways:

1) You can use Cucumber to write test steps like this:

  @sanity @home_page @test_628
Scenario: Launch Support FAQs & Guides from Home cog
  Given I navigate to Home page
  When I click "Support" user logo link
  Then I should see Support FAQs & Guides app launched

Each step written on Gherkin language (Given, When, Then) you can implement then using Selenium (I have to write on Ruby now, so I use Watir instead of Selenium).

see https://github.com/cucumber/cucumber/wiki/Python

2) But before that I used Robot Framework + Python + Selenium + Jenkins. You can write test like this:

Go To Google Page [Documentation] Go to google page and search something
    Open Browser to Google Page
    Input Search  selenium
    Submit Search

This is done using human readable keywords. It prints very nice reports and can be easily integrated with Jenkins.

see http://www.wallix.org/2011/07/26/how-to-use-robotframework-with-the-selenium-library/

1

To document a test case and that too for non-programmers, Behaviour-Driven Development (BDD) is the best way. Some of the BDD tools are Cucumber, JBehave etc.

For example, lets assume the we have an website to manage some employees and we have a test case in which admin wants to add a new employee.

So the above test case can be documented using Cucumber as shown below:

Feature: Admin : Employees : Add Employees : Add Employee Details
Scenario: Verify that admin user is able to add new employee
Given Joe is an admin user
Given Joe is logged into the admin account
When Joe clicks "Add Emplyee" button
And Joe enters "Test Employee" in "Employee Name" text box
And Joe enters "12/05/1988" in "Birth Date" text box
And Joe selects "Male" from "Gender" radio button
And Joe clicks on "Submit" button
Then Joe gets message that says "Employee is added successfully."

The above test case can be easily understood by a non-programmer and he can perform each steps as performed by the test.

Hierarchy of folders for this test case will be feature/Admin/Employees/Add Employees/Add Employee Details

Hope this helps :)

0

I don't use TestLink. I think it is much easier to use a Jenkins job server to schedule my tests and it can do nearly the same job as testlink can and, im my opinion, is easier for other people to understand. I check my test code into Subversion and Jenkins checks out the latest code before it runs my tests. Jenkins has plugins to handle JUnit and TestNG report formats and has email capability, etc.

NOTE: The only Gotcha is that if you use RemoteWebDriver and a grid, the tests need to be ran by a Jenkins slave server that is running in a foreground process ( not in the background as a service). This is the case at least on Windows and might not be a problem on Linux.

0

We use Cucumber to create readable tests and have the results pulled back to Enterprise Tester, our Test Management platform. We can also pull Selenium tests and jUnit tests from Jenkins into Enterprise Tester, also for visibility across both manual and automated tests and traceability back to stories / requirements.

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.