Monday, December 22, 2014

Custom SSO redirect page for WSO management console

When we enable Single-Sign-On Across Different WSO2 Products[1] we get a default SAML SSO redirect page which displays text "Loading WSO2 StratosLive..."

Currently we cannot customize this code directly.

Therefore, I have written a new osgi component registering a filter which redirects URL requests for the default "redirect_ajaxprocessor.jsp" to a custom jsp. With this approach I was able to change the SSO redirect "Loading WSO2 StratosLive..." to "Redirecting to SSO Login..." using this custom jsp. I have tested this with IS 5.0.0 and DSS 3.2.2.
Hence, you can do desired customizations to this SSO redirect page using a custom ('/org.wso2.carbon.sso.redirector.custom.ui/src/main/resources/web/stratos-auth-custom/redirect_ajaxprocessor.jsp') by implementing a custom component. 

You can checkout sample code (valid for wso2 products in carbon 4.2.0) of the above mentioned component from git repo.

  • Checkout the code from https://github.com/ayshsandu/custom-sso-redirector-wso2.git.
  • Do any custom changes u need to see in t redirect page in /org.wso2.carbon.sso.redirector.custom.ui/src/main/resources/web/stratos-auth-custom/redirect_ajaxprocessor.jsp
  • After building '/org.wso2.carbon.sso.redirector.custom.ui' component, copy the .jar into CARBON_HOME/repository/components/dropins.
  • Restart the server.

You have to do this for every WSO2 product in the cluster.
[1] https://docs.wso2.com/display/IS500/Configuring+SAML2+Single-Sign-On+Across+Different+WSO2+Products
Read More

Sunday, December 21, 2014

Generate Selenium UI tests into a Custom format

  1. Install Firefox
  2. Install Selenium plugin for firefox [1]
  3. Start a firefox browser and start selenium IDE. (tools> Selenium IDE)
  4. Goto Options>Options>Formats of Selenium IDE user interface.
  5. Select one from the list of formats which is closely related to your test platform.
    1. ex: select Java/Junit4/Webdriver and click on source.

  1. Copy and save the code from Selenium IDE Format Source to a local location and close the window.
  2. Click on Add in Selenium IDE Options
  3. Give a proper name for the new format (ex: Jave/ CustomJunit/ WebDriver)
  4. Copy the content of the step 6 in to the “Selenium IDE Format Source” window.
  5. Save and restart the Selenium IDE.
  6. You can edit this template as per your preference. Edit relevant formating as mentioned in below image. 
    1. change package name
    2. add/remove imports
    3. etc


  7. Now you are done with a custom format for your test generation. 
    Perform UI actions you need to add in your test case.Now you will see that those actions get recorded in Selenium IDE. [2]
  8. Now File> Export Test Case as> Jave/ Custom/ WebDriver
  9. Save the test-case into your test project and execute it 



[1] http://docs.seleniumhq.org/projects/ide
Read More
Designed ByBlogger Templates