Extending Keyword Automation Capabilities

Keyword Automation, by default, supports only a typical login screen using the Launch keyword. Because Siebel deployments often use Single Sign-On (SSO) and/or Multi-Factor Authentication and since SSO login screens are company-specific, you can now use the CustomExtension keyword to handle SSO login. Similarly, you can extend the keyword capabilities to address other, specific processing needs of your organization through CustomExtension.

You can use the CustomExtension keyword, which runs a custom extension JAR file, to enable support for custom requirements, such as the following:

  • Single Sign-On

  • Non-OpenUI controls

  • Embedded iFrames

  • Integration dependency processing

By using the CustomExtension keyword along with custom scripting, you can implement automation as part of the Siebel test script execution (ExecuteOperation). This helps to extend automation capabilities and increases overall test coverage.

The following subtopic shows how to build a CustomExtension plugin. For more information about using the CustomExtension keyword, see CustomExtension.

Building a CustomExtension Plugin

The typical instructions to build a CustomExtension plugin (for Login) are as follows:

  1. Locate the following files, and then add both JAR file paths to the class path while compiling the CustomExtension project:

    • Go to the <DISA_HOME>/DesktopIntSiebelAgent/plugins/SiebelTestAutomation/Framework folder and locate the SiebelTestAutomation.jar file.

    • Go to the <DISA_HOME>/DesktopIntSiebelAgent/plugins/SiebelTestAutomation/Framework\lib folder and locate the selenium_xxx.jar file (where xxx indicates the version number).

  2. Create a new Java Package with the new class implementing the interface KeywordActionHandler and other related files if any. To avoid any potential conflict, it is recommended that the custom extension class have a unique package name.

  3. Implement method ExecuteOperation in the new class with a return type boolean (true/false value) and the following parameters: InputVariables and OutputVariables.

    For example, the following sample login Java class implements the KeywordActionHandler interface as specified - the Java class is designed to handle a Web page with the following fields:
    • Input field called username

    • Input field called password

    • Anchor element with the value Login

    The ExecuteOperation function identifies the username field and uses the sendKeys API from Selenium to fill in the username for the login page, and similarly for the password field. Further, it identifies the anchor element with Login value and performs a click operation on it. Note that the keyword framework injects the relevant WebDriver object as it executes the plugin based on the keyword execution from the test script.

    package com.siebel.automation.keywordFrameworkcust;
     
    import com.siebel.automation.keywordFramework.KeywordActionHandler;
    import org.openqa.selenium.WebDriver;
    import org.openqa.selenium.By;
    import java.util.ArrayList;
     
    public class login implements KeywordActionHandler {
    
      public boolean ExecuteOperation(WebDriver driver,ArrayList<String> inputvariables,ArrayList<String> outvariables)
      {
        driver.findElement(By.xpath("//input[@name='username' ]")).sendKeys("username");
        driver.findElement(By.xpath("//input[@name='password' ]")).sendKeys("password");
        driver.findElement(By.xpath("//a[@value='Login' ]")).click();
        return true;
      }
    }
  4. Set META-INF for the newly created plugin. If META-INF does not exist:
    • Create a folder named META-INF in the plugin source folder (the root folder of package folders).

    • Create a new text file named meta.txt.

    Class-Path: ../../Framework/SiebelTestAutomation.jar ../../Framework/lib/selenium-serverstandalone-XXXX.jar where XXXX is the appropriate selenium server standalone version from your DISA installation.

  5. Compile the class and pack the META-INF folder in to a JAR file.

  6. Deploy the JAR file to the following folder:

    <DISA_HOME>/DesktopIntSiebelAgent/plugins/SiebelTestAutomation/Extensions
  7. Add a new CustomExtension test step with the appropriate classname extension to the test script and validate the functionality.