Package com.thoughtworks.selenium
Class SeleneseTestNgHelper
- java.lang.Object
 - 
- com.thoughtworks.selenium.SeleneseTestBase
 - 
- com.thoughtworks.selenium.SeleneseTestNgHelper
 
 
 
- 
public class SeleneseTestNgHelper extends SeleneseTestBase
 
- 
- 
Field Summary
- 
Fields inherited from class com.thoughtworks.selenium.SeleneseTestBase
selenium, verificationErrors 
 - 
 
- 
Constructor Summary
Constructors Constructor Description SeleneseTestNgHelper() 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidassertEquals(java.lang.Object actual, java.lang.Object expected)static voidassertEquals(java.lang.String[] actual, java.lang.String[] expected)static voidassertEquals(java.lang.String actual, java.lang.String expected)static voidassertEquals(java.lang.String actual, java.lang.String[] expected)voidattachScreenshotListener(java.lang.String host, java.lang.String port, org.testng.ITestContext context)voidcheckForVerificationErrors()Asserts that there were no verification errors during the current test, failing immediately if any are foundvoidgetSelenium(boolean restartSession)voidselectDefaultWindow()static booleanseleniumEquals(java.lang.Object actual, java.lang.Object expected)static booleanseleniumEquals(java.lang.String actual, java.lang.String expected)voidsetTestContext(java.lang.reflect.Method method)voidsetUp(java.lang.String url, java.lang.String browserString)Creates a new DefaultSelenium object and starts it using the specified baseUrl and browser string.voidtearDown()checks for verification errors and stops the browservoidverifyEquals(java.lang.Object actual, java.lang.Object expected)Like assertEquals, but fails at the end of the test (during tearDown)voidverifyEquals(java.lang.String[] actual, java.lang.String[] expected)Asserts that two string arrays have identical string contents (fails at the end of the test, during tearDown)- 
Methods inherited from class com.thoughtworks.selenium.SeleneseTestBase
assertFalse, assertFalse, assertNotEquals, assertNotEquals, assertTrue, assertTrue, clearVerificationErrors, fail, getDefaultPort, getText, isCaptureScreenShotOnFailure, join, pause, runtimeBrowserString, setCaptureScreenShotOnFailure, setUp, setUp, setUp, verifyEquals, verifyFalse, verifyNotEquals, verifyNotEquals, verifyTrue 
 - 
 
 - 
 
- 
- 
Method Detail
- 
setUp
@BeforeTest public void setUp(java.lang.String url, java.lang.String browserString) throws java.lang.ExceptionDescription copied from class:SeleneseTestBaseCreates a new DefaultSelenium object and starts it using the specified baseUrl and browser string. The port is selected as follows: if the server package's RemoteControlConfiguration class is on the classpath, that class' default port is used. Otherwise, if the "server.port" system property is specified, that is used - failing that, the default of 4444 is used.- Overrides:
 setUpin classSeleneseTestBase- Parameters:
 url- the baseUrl for your testsbrowserString- the browser to use, e.g. *firefox- Throws:
 java.lang.Exception- throws them all!- See Also:
 SeleneseTestBase.setUp(String, String, int)
 
- 
getSelenium
@BeforeClass public void getSelenium(boolean restartSession)
 
- 
setTestContext
@BeforeMethod public void setTestContext(java.lang.reflect.Method method)
 
- 
attachScreenshotListener
@BeforeSuite public void attachScreenshotListener(java.lang.String host, java.lang.String port, org.testng.ITestContext context) 
- 
checkForVerificationErrors
@AfterMethod public void checkForVerificationErrors()
Description copied from class:SeleneseTestBaseAsserts that there were no verification errors during the current test, failing immediately if any are found- Overrides:
 checkForVerificationErrorsin classSeleneseTestBase
 
- 
selectDefaultWindow
@AfterMethod(alwaysRun=true) public void selectDefaultWindow()
 
- 
tearDown
@AfterTest(alwaysRun=true) public void tearDown() throws java.lang.ExceptionDescription copied from class:SeleneseTestBasechecks for verification errors and stops the browser- Overrides:
 tearDownin classSeleneseTestBase- Throws:
 java.lang.Exception- actually, just AssertionError, but someone was lazy?
 
- 
assertEquals
public static void assertEquals(java.lang.Object actual, java.lang.Object expected) 
- 
assertEquals
public static void assertEquals(java.lang.String actual, java.lang.String expected) 
- 
assertEquals
public static void assertEquals(java.lang.String actual, java.lang.String[] expected) 
- 
assertEquals
public static void assertEquals(java.lang.String[] actual, java.lang.String[] expected) 
- 
seleniumEquals
public static boolean seleniumEquals(java.lang.Object actual, java.lang.Object expected) 
- 
seleniumEquals
public static boolean seleniumEquals(java.lang.String actual, java.lang.String expected) 
- 
verifyEquals
public void verifyEquals(java.lang.Object actual, java.lang.Object expected)Description copied from class:SeleneseTestBaseLike assertEquals, but fails at the end of the test (during tearDown)- Overrides:
 verifyEqualsin classSeleneseTestBase- Parameters:
 actual- object that you want to compare to actualexpected- the actual object expected
 
- 
verifyEquals
public void verifyEquals(java.lang.String[] actual, java.lang.String[] expected)Description copied from class:SeleneseTestBaseAsserts that two string arrays have identical string contents (fails at the end of the test, during tearDown)- Overrides:
 verifyEqualsin classSeleneseTestBase- Parameters:
 actual- object that you want to compare to actualexpected- the actual object expected
 
 - 
 
 -