Oracle Fusion Middleware extensions for Applications Core API Reference
11g Release 1 (11.1.1.5)

E22562-01

oracle.apps.fnd.applcore.test.selenium
Class ApplcoreSeleneseTestCase

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by com.thoughtworks.selenium.SeleneseTestCase
              extended by oracle.apps.fnd.applcore.test.selenium.ApplcoreSeleneseTestCase
All Implemented Interfaces:
junit.framework.Test

public class ApplcoreSeleneseTestCase
extends com.thoughtworks.selenium.SeleneseTestCase


Field Summary
static java.lang.String fileName
           
protected  ApplcoreSelenium selenium
           
 
Constructor Summary
ApplcoreSeleneseTestCase()
           
ApplcoreSeleneseTestCase(java.lang.String string)
           
 
Method Summary
 boolean canRun()
          This is used to control whether the test will run or not.
 void loginAndWaitPageToLoad(java.lang.String username, java.lang.String password)
          Login to an application with the given username and password and wait for the page to load.
 void run(junit.framework.TestResult result)
           
 void setUp()
           
 void tearDown()
           
protected  void verifyTitle(java.lang.String expected)
          Verifies that the real page title is what we expect it to be.
protected  void verifyTitle(java.lang.String message, java.lang.String expected)
          Verifies that the real page title is what we expect it to be.
 
Methods inherited from class com.thoughtworks.selenium.SeleneseTestCase
assertEquals, assertEquals, assertEquals, assertEquals, assertNotEquals, assertNotEquals, checkForVerificationErrors, clearVerificationErrors, getText, isCaptureScreenShotOnFailure, isCaptureScreetShotOnFailure, join, pause, runBare, runtimeBrowserString, seleniumEquals, seleniumEquals, setCaptureScreenShotOnFailure, setCaptureScreetShotOnFailure, setTestContext, setUp, setUp, verifyEquals, verifyEquals, verifyEquals, verifyFalse, verifyNotEquals, verifyNotEquals, verifyTrue
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, 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

fileName

public static java.lang.String fileName

selenium

protected ApplcoreSelenium selenium
Constructor Detail

ApplcoreSeleneseTestCase

public ApplcoreSeleneseTestCase()

ApplcoreSeleneseTestCase

public ApplcoreSeleneseTestCase(java.lang.String string)
Method Detail

setUp

public void setUp()
Overrides:
setUp in class com.thoughtworks.selenium.SeleneseTestCase

verifyTitle

protected final void verifyTitle(java.lang.String expected)
Verifies that the real page title is what we expect it to be. This is useful for catching unexpected exceptions, as the page text will be dumped into the failure text.

Parameters:
expected - what we expected the title to be.

verifyTitle

protected final void verifyTitle(java.lang.String message,
                                 java.lang.String expected)
Verifies that the real page title is what we expect it to be. This is useful for catching unexpected exceptions, as the page text will be dumped into the failure text.

Parameters:
message - custom message to include in the junit report
expected - what we expected the title to be.

loginAndWaitPageToLoad

public void loginAndWaitPageToLoad(java.lang.String username,
                                   java.lang.String password)
Login to an application with the given username and password and wait for the page to load. Login is done via a html login page like this:
 <html>
  <head>
    <title>Login</title>
  </head>
  <body>
    Login
    <form method="POST" action="j_security_check">
      <table cellspacing="2" cellpadding="3" border="1">
        <tr>
          <th>Username:</th>
          <td>
            <input type="text" name="j_username" id="j_username"/>
          </td>
        </tr>
        <tr>
          <th>Password:</th>
          <td>
            <input type="password" name="j_password" id="j_password"/>
          </td>
        </tr>
      </table>
      <p>
        <input type="submit" name="submit" value="Submit"/
      </p>
    </form>
  </body>
</html>
 
This is set as the login page for the application by setting up standard adf security usinf the Form Based Security option. Note that a Title and ids have been added to the login.html for Selenium to access:
     
        FORM
        
            /login.html
            /error.html
        
    
   

Parameters:
username - name of user. Cannot be null.
password - password. Cannot be null.

canRun

public boolean canRun()
This is used to control whether the test will run or not. In users' testcases, this function needs to be overriden to implement conditional testing.


run

public void run(junit.framework.TestResult result)
Specified by:
run in interface junit.framework.Test
Overrides:
run in class junit.framework.TestCase

tearDown

public void tearDown()
              throws java.lang.Exception
Overrides:
tearDown in class com.thoughtworks.selenium.SeleneseTestCase
Throws:
java.lang.Exception

Oracle Fusion Middleware extensions for Applications Core API Reference
11g Release 1 (11.1.1.5)

E22562-01

Copyright © 2011 Oracle. All Rights Reserved.