@Deprecated public class SeleneseTestCase extends junit.framework.TestCase
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.
| 构造器和说明 |
|---|
SeleneseTestCase()
已过时。
|
SeleneseTestCase(String name)
已过时。
|
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
assertEquals(Object s1,
Object s2)
已过时。
Like JUnit's Assert.assertEquals, but knows how to compare string arrays
|
static void |
assertEquals(String[] s1,
String[] s2)
已过时。
Asserts that two string arrays have identical string contents
|
static void |
assertEquals(String s1,
String s2)
已过时。
Like JUnit's Assert.assertEquals, but handles "regexp:" strings like HTML Selenese
|
static void |
assertEquals(String s1,
String[] s2)
已过时。
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)
已过时。
Asserts that two booleans are not the same
|
static void |
assertNotEquals(Object obj1,
Object obj2)
已过时。
Asserts that two objects are not the same (compares using .equals())
|
void |
checkForVerificationErrors()
已过时。
Asserts that there were no verification errors during the current test, failing immediately if
any are found
|
void |
clearVerificationErrors()
已过时。
Clears out the list of verification errors
|
String |
getText()
已过时。
|
String |
join(String[] array,
char c)
已过时。
|
void |
pause(int millisecs)
已过时。
Sleeps for the specified number of milliseconds
|
void |
runBare()
已过时。
Runs the bare test sequence, capturing a screenshot if a test fails
|
static boolean |
seleniumEquals(Object expected,
Object actual)
已过时。
Compares two objects, but handles "regexp:" strings like HTML Selenese
|
static boolean |
seleniumEquals(String expected,
String actual)
已过时。
Compares two strings, but handles "regexp:" strings like HTML Selenese
|
void |
setUp()
已过时。
Calls this.setUp(null)
|
void |
setUp(String url)
已过时。
Calls this.setUp with the specified url and a default browser.
|
void |
setUp(String url,
String browserString)
已过时。
Creates a new DefaultSelenium object and starts it using the specified baseUrl and browser
string
|
void |
setUp(String url,
String browserString,
int port)
已过时。
Creates a new DefaultSelenium object and starts it using the specified baseURL, browser string
and port
|
void |
tearDown()
已过时。
checks for verification errors and stops the browser
|
void |
verifyEquals(boolean arg1,
boolean arg2)
已过时。
Like assertEquals, but fails at the end of the test (during tearDown)
|
void |
verifyEquals(Object s1,
Object s2)
已过时。
Like assertEquals, but fails at the end of the test (during tearDown)
|
void |
verifyEquals(String[] s1,
String[] s2)
已过时。
Like assertEquals, but fails at the end of the test (during tearDown)
|
void |
verifyFalse(boolean b)
已过时。
Like assertFalse, but fails at the end of the test (during tearDown)
|
void |
verifyNotEquals(boolean s1,
boolean s2)
已过时。
Like assertNotEquals, but fails at the end of the test (during tearDown)
|
void |
verifyNotEquals(Object s1,
Object s2)
已过时。
Like assertNotEquals, but fails at the end of the test (during tearDown)
|
void |
verifyTrue(boolean b)
已过时。
Like assertTrue, but fails at the end of the test (during tearDown)
|
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, countTestCases, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, setName, toStringpublic SeleneseTestCase()
public SeleneseTestCase(String name)
public void checkForVerificationErrors()
public void clearVerificationErrors()
public String getText()
public void pause(int millisecs)
millisecs - number ofpublic void setUp()
throws Exception
setUp 在类中 junit.framework.TestCaseExceptionsetUp(String)public void setUp(String url) throws Exception
url - the baseUrl to use for your Selenium testsException - yep, generic ExceptionsetUp(String, String)public void setUp(String url, String browserString) throws Exception
url - the baseUrl for your testsbrowserString - the browser to use, e.g. *firefoxException - yep, generic Exceptionpublic void setUp(String url, String browserString, int port) throws Exception
url - the baseUrl for your testsbrowserString - the browser to use, e.g. *firefoxport - the port of Selenium RCException - yep, generic Exceptionpublic void tearDown()
throws Exception
tearDown 在类中 junit.framework.TestCaseExceptionpublic void verifyEquals(boolean arg1,
boolean arg2)
arg1 - to compare to arg2arg2 - to compare to arg1public void verifyEquals(Object s1, Object s2)
s1 - to compare to s2s2 - to compare to s1public void verifyEquals(String[] s1, String[] s2)
s1 - to compare to s2s2 - to compare to s1public void verifyFalse(boolean b)
b - boolean to check is falsepublic void verifyNotEquals(boolean s1,
boolean s2)
s1 - to compare to s2s2 - to compare to s1public void verifyNotEquals(Object s1, Object s2)
s1 - to compare to s2s2 - to compare to s1public void verifyTrue(boolean b)
b - boolean to verify is truepublic static void assertEquals(Object s1, Object s2)
s1 - to compare to s2s2 - to compare to s1public static void assertEquals(String s1, String s2)
s1 - to compare to s2s2 - to compare to s1public static void assertEquals(String s1, String[] s2)
s1 - to compare to s2s2 - to compare to s1public static void assertEquals(String[] s1, String[] s2)
s1 - to compare to s2s2 - to compare to s1public static void assertNotEquals(boolean b1,
boolean b2)
b1 - to compare to b2b2 - to compare to b1public static void assertNotEquals(Object obj1, Object obj2)
obj1 - to compare to obj2obj2 - to compare to obj1public static boolean seleniumEquals(Object expected, Object actual)
expected - expression of expectedactual - expression of actualseleniumEquals(String, String)public static boolean seleniumEquals(String expected, String actual)
expected - expression of expectedactual - expression of actualpublic void runBare()
throws Throwable
runBare 在类中 junit.framework.TestCaseThrowable - if any exception is thrown