com.thoughtworks.selenium
Class SeleneseTestCase

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by com.thoughtworks.selenium.SeleneseTestCase
All Implemented Interfaces:
junit.framework.Test

Deprecated. Please consider updating to junit 4 or above

@Deprecated
public class SeleneseTestCase
extends junit.framework.TestCase

Provides a JUnit TestCase base class that implements some handy functionality for Selenium testing (you are not required to extend this class).

This class adds a number of "verify" commands, which are like "assert" commands, but they don't stop the test when they fail. Instead, verification errors are all thrown at once during tearDown.

Author:
Nelson Sproul ([email protected]) Mar 13-06

Field Summary
protected  com.thoughtworks.selenium.Selenium selenium
          Deprecated. Use this object to run all of your selenium tests
 
Constructor Summary
SeleneseTestCase()
          Deprecated.  
SeleneseTestCase(String name)
          Deprecated.  
 
Method Summary
static void assertEquals(Object s1, Object s2)
          Deprecated. Like JUnit's Assert.assertEquals, but knows how to compare string arrays
static void assertEquals(String[] s1, String[] s2)
          Deprecated. Asserts that two string arrays have identical string contents
static void assertEquals(String s1, String s2)
          Deprecated. Like JUnit's Assert.assertEquals, but handles "regexp:" strings like HTML Selenese
static void assertEquals(String s1, String[] s2)
          Deprecated. Like JUnit's Assert.assertEquals, but joins the string array with commas, and handles "regexp:" strings like HTML Selenese
static void assertNotEquals(boolean b1, boolean b2)
          Deprecated. Asserts that two booleans are not the same
static void assertNotEquals(Object obj1, Object obj2)
          Deprecated. Asserts that two objects are not the same (compares using .equals())
 void checkForVerificationErrors()
          Deprecated. Asserts that there were no verification errors during the current test, failing immediately if any are found
 void clearVerificationErrors()
          Deprecated. Clears out the list of verification errors
 String getText()
          Deprecated. Returns the body text of the current page
protected  boolean isCaptureScreenShotOnFailure()
          Deprecated.  
 String join(String[] array, char c)
          Deprecated.  
 void pause(int millisecs)
          Deprecated. Sleeps for the specified number of milliseconds
 void runBare()
          Deprecated. Runs the bare test sequence, capturing a screenshot if a test fails
protected  String runtimeBrowserString()
          Deprecated.  
static boolean seleniumEquals(Object expected, Object actual)
          Deprecated. Compares two objects, but handles "regexp:" strings like HTML Selenese
static boolean seleniumEquals(String expected, String actual)
          Deprecated. Compares two strings, but handles "regexp:" strings like HTML Selenese
protected  void setCaptureScreenShotOnFailure(boolean b)
          Deprecated.  
protected  void setTestContext()
          Deprecated.  
 void setUp()
          Deprecated. Calls this.setUp(null)
 void setUp(String url)
          Deprecated. Calls this.setUp with the specified url and a default browser.
 void setUp(String url, String browserString)
          Deprecated. Creates a new DefaultSelenium object and starts it using the specified baseUrl and browser string
 void setUp(String url, String browserString, int port)
          Deprecated. Creates a new DefaultSelenium object and starts it using the specified baseURL, browser string and port
 void tearDown()
          Deprecated. checks for verification errors and stops the browser
 void verifyEquals(boolean arg1, boolean arg2)
          Deprecated. Like assertEquals, but fails at the end of the test (during tearDown)
 void verifyEquals(Object s1, Object s2)
          Deprecated. Like assertEquals, but fails at the end of the test (during tearDown)
 void verifyEquals(String[] s1, String[] s2)
          Deprecated. Like assertEquals, but fails at the end of the test (during tearDown)
 void verifyFalse(boolean b)
          Deprecated. Like assertFalse, but fails at the end of the test (during tearDown)
 void verifyNotEquals(boolean s1, boolean s2)
          Deprecated. Like assertNotEquals, but fails at the end of the test (during tearDown)
 void verifyNotEquals(Object s1, Object s2)
          Deprecated. Like assertNotEquals, but fails at the end of the test (during tearDown)
 void verifyTrue(boolean b)
          Deprecated. Like assertTrue, but fails at the end of the test (during tearDown)
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

selenium

protected com.thoughtworks.selenium.Selenium selenium
Deprecated. 
Use this object to run all of your selenium tests

Constructor Detail

SeleneseTestCase

public SeleneseTestCase()
Deprecated. 

SeleneseTestCase

public SeleneseTestCase(String name)
Deprecated. 
Method Detail

checkForVerificationErrors

public void checkForVerificationErrors()
Deprecated. 
Asserts that there were no verification errors during the current test, failing immediately if any are found


clearVerificationErrors

public void clearVerificationErrors()
Deprecated. 
Clears out the list of verification errors


getText

public String getText()
Deprecated. 
Returns the body text of the current page


pause

public void pause(int millisecs)
Deprecated. 
Sleeps for the specified number of milliseconds


setUp

public void setUp()
           throws Exception
Deprecated. 
Calls this.setUp(null)

Overrides:
setUp in class junit.framework.TestCase
Throws:
Exception
See Also:
setUp(String)

setUp

public void setUp(String url)
           throws Exception
Deprecated. 
Calls this.setUp with the specified url and a default browser. On Windows, the default browser is *iexplore; otherwise, the default browser is *firefox.

Parameters:
url - the baseUrl to use for your Selenium tests
Throws:
Exception
See Also:
setUp(String, String)

setUp

public void setUp(String url,
                  String browserString)
           throws Exception
Deprecated. 
Creates a new DefaultSelenium object and starts it using the specified baseUrl and browser string

Parameters:
url - the baseUrl for your tests
browserString - the browser to use, e.g. *firefox
Throws:
Exception

setUp

public void setUp(String url,
                  String browserString,
                  int port)
           throws Exception
Deprecated. 
Creates a new DefaultSelenium object and starts it using the specified baseURL, browser string and port

Parameters:
url - the baseUrl for your tests
browserString - the browser to use, e.g. *firefox
port - the port of Selenium RC
Throws:
Exception

tearDown

public void tearDown()
              throws Exception
Deprecated. 
checks for verification errors and stops the browser

Overrides:
tearDown in class junit.framework.TestCase
Throws:
Exception

verifyEquals

public void verifyEquals(boolean arg1,
                         boolean arg2)
Deprecated. 
Like assertEquals, but fails at the end of the test (during tearDown)


verifyEquals

public void verifyEquals(Object s1,
                         Object s2)
Deprecated. 
Like assertEquals, but fails at the end of the test (during tearDown)


verifyEquals

public void verifyEquals(String[] s1,
                         String[] s2)
Deprecated. 
Like assertEquals, but fails at the end of the test (during tearDown)


verifyFalse

public void verifyFalse(boolean b)
Deprecated. 
Like assertFalse, but fails at the end of the test (during tearDown)


verifyNotEquals

public void verifyNotEquals(boolean s1,
                            boolean s2)
Deprecated. 
Like assertNotEquals, but fails at the end of the test (during tearDown)


verifyNotEquals

public void verifyNotEquals(Object s1,
                            Object s2)
Deprecated. 
Like assertNotEquals, but fails at the end of the test (during tearDown)


verifyTrue

public void verifyTrue(boolean b)
Deprecated. 
Like assertTrue, but fails at the end of the test (during tearDown)


assertEquals

public static void assertEquals(Object s1,
                                Object s2)
Deprecated. 
Like JUnit's Assert.assertEquals, but knows how to compare string arrays


assertEquals

public static void assertEquals(String s1,
                                String s2)
Deprecated. 
Like JUnit's Assert.assertEquals, but handles "regexp:" strings like HTML Selenese


assertEquals

public static void assertEquals(String s1,
                                String[] s2)
Deprecated. 
Like JUnit's Assert.assertEquals, but joins the string array with commas, and handles "regexp:" strings like HTML Selenese


assertEquals

public static void assertEquals(String[] s1,
                                String[] s2)
Deprecated. 
Asserts that two string arrays have identical string contents


assertNotEquals

public static void assertNotEquals(boolean b1,
                                   boolean b2)
Deprecated. 
Asserts that two booleans are not the same


assertNotEquals

public static void assertNotEquals(Object obj1,
                                   Object obj2)
Deprecated. 
Asserts that two objects are not the same (compares using .equals())


seleniumEquals

public static boolean seleniumEquals(Object expected,
                                     Object actual)
Deprecated. 
Compares two objects, but handles "regexp:" strings like HTML Selenese

Returns:
true if actual matches the expectedPattern, or false otherwise
See Also:
seleniumEquals(String, String)

seleniumEquals

public static boolean seleniumEquals(String expected,
                                     String actual)
Deprecated. 
Compares two strings, but handles "regexp:" strings like HTML Selenese

Parameters:
expected -
actual -
Returns:
true if actual matches the expectedPattern, or false otherwise

isCaptureScreenShotOnFailure

protected boolean isCaptureScreenShotOnFailure()
Deprecated. 

runtimeBrowserString

protected String runtimeBrowserString()
Deprecated. 

setCaptureScreenShotOnFailure

protected void setCaptureScreenShotOnFailure(boolean b)
Deprecated. 

setTestContext

protected void setTestContext()
Deprecated. 

runBare

public void runBare()
             throws Throwable
Deprecated. 
Runs the bare test sequence, capturing a screenshot if a test fails

Overrides:
runBare in class junit.framework.TestCase
Throws:
Throwable - if any exception is thrown

join

public String join(String[] array,
                   char c)
Deprecated. 


Copyright © 2012. All Rights Reserved.