1

I have a set of Selenium WebDriver tests written in Java.

Is there framework with web interface where I can run them?

This web interface should display list of all tests, ability to run one or all tests and display results of their running.

4 Answers 4

2

To Simplify:

You can use Jenkins (CI Tools) > Work with ANT (BUILD.xml) > Running with TestNG Framework > Incorporate with your WebDriver Script.

Sign up to request clarification or add additional context in comments.

Comments

1

There is no readily available "web interface" per say, but this is the kind of thing that CI (Continuous Integration) servers and software do very well.

TeamCity, for example, can do exactly what you are after, but there is nothing available to you with just Selenium and your testing framework (NUnit, Junit etc) alone.

Comments

0

Hm. Can not definitely say about web interface, but it seems to me you shoulda investigate deeper in @Category annotation direction. for my project I use maven build manager. And using @Category notation you are able to show maven what category of tests is supposed to be included in the build and what category is supposed to be exclueded.

here is my example of structure I use in my project:

  rms-web pom:

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.11</version>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.surefire</groupId>
                        <artifactId>surefire-junit47</artifactId>
                        <version>2.12</version>
                    </dependency>
                </dependencies>
                                <configuration>
                    <!--<includes>-->
                        <!--<include>**/*.class</include>-->
                    <!--</includes>-->
                    <excludedGroups>com.exadel.rms.selenium.SeleniumTests</excludedGroups>

                </configuration>

            </plugin>



PassTest.java
package com.exadel.rms.selenium;

import org.junit.Test;

import java.io.IOException;

import static org.junit.Assert.assertTrue;

/**
 * Created with IntelliJ IDEA.
 * User: ypolshchykau
 * Date: 8/28/12
 * Time: 8:38 PM
 * To change this template use File | Settings | File Templates.
 */
public class PassTest {


    @Test
    public void pass() throws IOException, InterruptedException {
        assertTrue(true);
    }
}


SeleniumTests.java

package com.exadel.rms.selenium;

/**
 * Created with IntelliJ IDEA.
 * User: ypolshchykau
 * Date: 8/27/12
 * Time: 6:49 PM
 * To change this template use File | Settings | File Templates.
 */
public class SeleniumTests {
}


LoginPageTestSuite.java
package com.exadel.rms.selenium;

import org.junit.Assert;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.openqa.selenium.By;

import java.io.IOException;

@Category(SeleniumTests.class)
public class LoginPageTestSuite extends BaseSeleniumTest {


    @Test
    public void pressLoginButton() throws IOException, InterruptedException {
        doLogout();
        fluentWait(By.cssSelector(propertyKeysLoader("login.loginbutton"))).click();

        Assert.assertTrue(fluentWait(By.cssSelector(propertyKeysLoader("login.validator.invalidautentication"))).getText().trim().equals("Invalid authentication"));
    }
…..........
}

and I checked with maven my test categories with the following:

mvn -Dmaven.buildNumber.docheck=false -Dmaven.buildNumber.doUpdate=false clean test

maven check

Suppose additional info you can get here here and about maven surefire plugin Hope this helps you)

Comments

0

You can make Test Suite by Using Ant (build.xml) with TestNG framework. build.xml is run by Ant in 2 ways: 1. with an IDE (such as Eclipse) 2. from command prompt

3 Comments

Maven instead of Apache Ant can also be used to run Test Suite
A set of tests can also be run programmaticaly with Java by using TestNG
Considering Web interface, you can use Jenkins. Tests in Jenkins can be configured by Ant or Maven

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.