Alexey
Alexey

Reputation: 517

Running Selenium WebDriver tests using Web interface or any Visual tool

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.

Upvotes: 1

Views: 1981

Answers (4)

Ripon Al Wasim
Ripon Al Wasim

Reputation: 37766

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

Upvotes: 0

cL83
cL83

Reputation: 489

To Simplify:

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

Upvotes: 2

Arran
Arran

Reputation: 25056

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.

Upvotes: 1

eugene.polschikov
eugene.polschikov

Reputation: 7339

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)

Upvotes: 0

Related Questions