Sunday, November 30, 2014

Oracle BPM 12c: Exception thrown while creating a Business Object (BO) based on external XSD


I was working on  the oracle bpm and creating a bpmn process. while creating a Business Object I am getting an error and is something related to “unable to parse the external xsd”.
Well after that I continues to a bpmn process and create a data object, but in the data association mapping I can’t see all the elements under the root element which in the xsd. As you can see in the figure below:

No elements visible under CustomerBO and requestBMHeader.

This is a known issue in Oracle bpm 12c, you can check here : 
In this page search for : Exception thrown while creating a Business Object (BO) based on XSD

Solution:


Well you can bypass this problem by manually mapping or assigning the value into your BPMN process i.e. Process.bpmn in this example.
Or
You can use the transformation to map the elements.

I think mapping elements using transformation is simple way to do that and I have done using the same and it worked successfully.

Friday, October 31, 2014

Oracle MFT 12c: Getting started with Oracle Manage File Transfer 12c

In large organization sometimes there is a requirement to transfer the files from one location to another location and file in source location is in different format than at destination for example at source destination the file may be .zip and in the destination you have to save in .xml. Oracle Managed File Transfer is one of the utility which provide this functionality and many more.

Oralce MFT Features

  • You can schedule the file transfer.
  • Resubmitting the transfer to redeliver the file.
  • Compression and decompression of file.
  • Encryption and decryption of files.
  • Archiving, renaming and deletion.
  • you can pause and resume the file transfer.
  • Detailed auditing and reports of file transfer.
  • Transfer of files from single source to multiple targets.

Components of Oracle MFT

Oracle MFT Artifacts

There are three main artifacts which are used for Managed File Transfer:

Source: It defines the origin of file i.e. location of the file which is going to picked by MFT server.

Transfer: This artifacts links one source to one or more targets. You can also create the content filters or can perform the actions like encryption/decryption or compresseion/decompression.

Targets: It is the destination location where the transfer put the file or the content.



Embedded Ftp and sFtp server in weblogic

In Oracle MFT 12c these two servers are embedded to weblogic can be used as one of the source artifacts, you need to configure host, port, user access to the directories in the MFT console as shown below:

By default the Ftp server is up and running, the only thing required for the Ftp server is location i.e. you have to pass the source location of files, default location is set to /u01/app/oracle/Middleware/Oracle_Home/user_projects/domains/base_domain/mft/ftp_root/payloads. You can change this location if you want.

Monitoring and Reports

In Oracle MFT you get the separate page view or dashboard to monitor the mft instances. You can closely watch Source, Transfer and Targets instances separately. You can monitor the following things:

  • Success and failure instances for the source, transfer and target. You can also check the frequency of the statistics.
  • Dashboard got the separate error information table, so you can easily locate the error instances.
  • Separate view of active deliveries progress table.
  • Report generation for all or individual deliveries.


References:

http://docs.oracle.com/middleware/1213/mft/MFTUG/mftug_intro.htm#MFTUG269
http://docs.oracle.com/middleware/1213/mft/MFTUG/mftug_monitor.htm#CHDDGDAH


Wednesday, October 29, 2014

Oracle SOA: Sync Read of file in Oracle SOA using File Adapter

I was working on one of the requirement in which we need to read the file in between the Bpel process i.e. File Adapter is not triggering the bpel process but inside the bpel process file adapter is triggered to get the file.
Here in this post I am taking a small example to make you guys understand that what this option in file adapter means.

Scenario

In my example I am using a two file adapters one is writing of file and other is sync read of file. Well writing file adapter I used just to create a xml file so that I don't have to create manually. In the second adapter i.e. Sync Read File adapter I am passing the name of the file that is created by write file adapter. I put the same directory for write and read i.e. "G:\Anshul\SyncRead" and for archiving "G:\Anshul\Archive\SyncRead".

Steps:

  1. Create SOA Application and then SOA project.
  2. Create schema file, I have created Info.xsd.
  3. Drag n drop, File Adapter to reference lane and configure for write operation.
  4. Again drag n drop File Adapter to configure Sync Read File operation

  5. Create Bpel Process and exposed this bpel process as SOAP webservice. 
  6. After that wired all the components and you composite looks like below.
  7. Now Inside the bpel process, assign the filename to write the file and same file name to be passed to Sync Read File adapter. 
  8. Create a local variable i.e. FileNameVar and put the value concat("Info_",ora:getComponentInstanceId,".xml") this is xpath function which generates the file name like Info_10001.xml
  9. Now pass the above file name in Invoke activity of both the file adapter.
  10. Apply the Request/Response transformation to invoke variables.
  11. Save, deploy and test.
You can download the code from here : com.codeconfuse.soa.FileSyncRead

Monday, October 27, 2014

How to uninstall default open jdk in Oracle Linux

When you install linux OS on either virtual machines or physical machines then it comes with open jdk version 1.6 or 1.7 or both (In my case both on oracle linux 6.5). Well this is not a problem but sometimes you required to install the products (OSB, SOA, Weblogic etc.) which is certified with different jdk vendor or version. In that case you are required to remove the open jdk and install the jdk version you required (although you can install the new jdk version without removing older one i.e. you need to set the environment variable JAVA_HOME which is pointing to new jdk).

Here are the steps:

Check JDK installation

Run the command: java -version


Removing JDK

Run the command: yum remove java*

This command will search for all the java version and will show you all the available jdk version and ask for permission if you want to remove Y/N.


Enter 'y' to remove the jdk. After that verify jdk by running the command "java -version", you will get the following out put : bash: /usr/bin/java: No such file or directory


Install the new JDK Version

Go to the following link for how to install jdk on linux


Sunday, October 26, 2014

Oracle SOA 12c: How to create Inline Bpel Subprocess

As from my previous blog post on Getting started with resuable bpel subprocesses, you get some basic idea of resuable subprocesses in Oracle SOA 12c. Here in this blog post I am going to show you how to create a Inline bpel subprocess in your soa composite application.

Scenario:

I am creating a Error handler service in which there two scope in the Error Bpel Process. 
  • Notification scope: In this process email notification is send to the user using the notificaiton service.
  • Logs scope: In this process logs is written in the external file system using the file adapter
Note: Only the scope activity can be converted into subprocess.

Create inline bpel subprocess
  1. Create a soa project in soa application i.e. CommonComponents and in that create a bpel 2.0 process i.e. "ErrorProcess"
  2. In the bpel process, create two scope logs and Alert (notification scope). Now in the log scope call the file adapter to write the logs on to the file system and in Alert scope call the notification service to send email.
  3. Now right click on the scope and select convert to subprocess
  4. After creating subprocess, you can see the subprocess in the components tab.
  5. Drag n drop the inline subprocess where ever you required.
  6. Save, deploy and test the process.


Oracle SOA 12c: Getting started with Resuable BPEL Subprocesses

Previously if any one wants to resuse the BPEL code then one has to build a logic into the separate process and this process is called by invoke activity through webservice in another process. Well we can't say this is the problem or not, but in Oracle SOA 12c there is more efficient way to make BPEL code reusable across the process. One scenario came to my mind is in BPEL process, sometimes you have to "log the messages for monitoring", "send notification to the process owners" etc. and this can be done at multiple times in a process, so calling subprocess is better way than invoking external http service etc.

Here are some of the benefits of Subprocess:

  • Reusability of BPEL code. Now don't have to write same code multiple times, just create subprocess and call that subprocess where ever you want.
  • You don't have to change the logic at multiple times, just change in the sub process i.e. at one place only.
  • Code looks more modularized and easy to understand by any other stakeholder.
  • It is better than calling the invoke activity.
Some points needs to be remember about subprocess
  • Subprocess is only supported with BPEL 2.0
  • Correlation sets are not supported with subprocess.
  • Subprocess can not be shared between multiple composites. But you can use the soa template to shared across the multiple composite.
  • Monitor view is not supported from inside the subprocess.

Oracle SOA 12c provides support for two types of resuable subprocesses.

Standalone BPEL Subprocess:

Standalone bpel process defined in a file with extension .sbpel (subprocess bpel extension). This process is out side the parent bpel process as shown in the figure below:

Here in the subprocess you can use any activities that is use in the bpel and you can use the subprocess by connecting through dotted wire with the parent bpel process. In figure above two sub process AlertNotificationProcess and LogsProcess are wired with Error bpel process.

See this post How to create standalone process.

Inline BPEL Subprocess

Inline subprocess are defined inside the parent bpel process that means we can't call the subprocess outside the parent bpel process. This subprocess may be useful in the situation where same activity happens at multiple times in single bpel process e.g.

  • Status updating in database or calling external webservice at multiple times in process at various levels.
  • logging of message at multiple times in a process.
  • Validation of message in a process.
see the figure below:

you can see the inline process under the components tab, here the log scope has been converted into subprocess. Here the log scope is converted into in line subprocess.


Note:  Always remember only the scope activity can be converted into inline subprocess.

Oracle SOA 12c: How to create Standalone Bpel Subprocess

As from my previous blog post on Getting started with resuable bpel subprocesses, you get some basic idea of resuable subprocesses in Oracle SOA 12c. Here in this blog post I am going to show you how to create a standalone bpel subprocess in your soa composite application.

Scenario:

I am creating a Error handler service in which there two subprocess 
  • AlerNotificationProcess: In this process email notification is send to the user using the notificaiton service.
  • LogsProcess: In this process logs is written in the external file system using the file adapter
  • Error Process: This is a parent process which is calling both the above process. 
  • Finally this process is exposing the soap webservice which is called by external client.
Note: In similar way you can create more bpel process and you can use the subprocess in each of your bpel process if required.

Create standalone bpel process
  1. Create a soa project in soa application i.e. CommonComponents and in that create a bpel 2.0 process i.e. "ErrorProcess".
  2. Now drag n drop the subprocess from the components tab and create two sub processes i.e. "AlertNotificationProcess" and "LogsProcess". 
  3. Now implement the logic one by one in subprocess,
  4. In the AlertNotificaitonProcess, just drag and drop the email notification activity and configure it. 
  5. Similary in the LogsProcess, Just drag and drop the file adapter and configure it.
  6. Now in the parent process just drag and drop these subprocesses to call  where ever required.
  7. Map the parameters.
  8. Save, deploy and test the project.

Sunday, October 12, 2014

Oracle OSB 12c: Pipeline templates in Oracle Service Bus 12c

One of the best thing for any developer is to write a code which can be used as many times in an enterprise application. Pipeline templates is one of such capability in Oracle Service Bus in which developer create a prototype of a  pipeline called as pipeline template and include all the component which can be use across the enterprise services. One such example can be a Error handler.

Here in this post I will try to explain and give an idea of how one can use the pipeline templates in its Oracle Service Bus application. I am going to create template in which I will include these components:

  • Validation
  • Error Handler
  • Logging
  • Alerts
  • Reports
As you can see these are the common components which can be used across all the Services in OSB.
Let me start with the basic.

Pipeline:

Pipeline component in OSB provides message processing capability i.e. defines logic for routing, validation, manipulation of messages (transformation) or error handling etc.
Primary elements for Pipeline are:
  • Start Node: It is a by default node define automatically when you connect to proxy service.
  • Pipeline Pair: node for request & response pair processing.
  • Branch Node: node to route the message based on condition either on type of operation or values.
  • Route Node: this node set the destination of message otherwise by default echo the request i.e. request is passed to the response.
  • Error Handler: handle errors either on stage or node.

Note: Minimum start node and route node required for pipeline.

Pipeline Template:

A template in pipeline is a prototype of message flow for proxy services. It defines the reusable activities that are common across the business process for example validations on business messages, error handling, transformation of request and response messages etc.

How to create pipeline templates in Jdeveloper

1.       Right click on the projectà NewàPipeline_Template
2.       Template wizard appears, Enter all the information.
3.       Click Next to select service type.
4.       Finish.
5.       Now in the pipeline template add the route node, error handler or any logic which is common across the service. (follow the example)

Note: you cannot create pipeline templates in OSB console.

Pipeline Template Example

Code Structure
  • Two projects i.e. SharedSB and ConsumeTemplate.
  • SharedSB is project in which we store all the common resources that can be used in all the service bus application and In ConsumeTemplate I will create a pipeline on the basis of pipeline template.

Create Pipeline Template (CommonComponent.ptx)
  1. Create pipeline template CommonComponent.ptx

  2. Drag and drop all the components that you think can be re-used in many services. In this case I am using Validity, Error handler, reports, logging, Alerts.
  3. After configuring all the activities, you can lock the activities so that the same configuration can be used in all the concrete pipeline i.e. in the pipeline where you are importing the pipleline template.

Creating concrete pipeline using template
  1. Create proxy service.
  2. Create pipleline using the template and use same signature as of your proxy service.
  3. After importing template, implement message flow logic if required.
  4. Save and deploy both the projects SharedSB and ConsumeTemplate on Oracle Service Bus server.
  5. Test your application.
References:

  • http://docs.oracle.com/middleware/1213/osb/develop/title.htm#BEGIN

Oracle OSB 12c: Break the pipeline template link from the concrete pipeline

In Oracle Service Bus if template that you use to create a concrete pipeline is no longer required than there is an option to break the link between the template and concrete pipeline. But remember this is a irreversible action so you can't go back and link again the template and concrete pipeline.

Here are the steps:

  1. Open the configuration of concrete pipeline.
  2. In the configuration of template, click on the break button as shown below.
  3. Click yes.
  4. Now concrete pipeline is converted into regular pipeline.
Note: As this is an irreversible action so please think before doing it whether it is required or not.

Monday, September 8, 2014

Ten Useful Javascript Tips and Best Practices

In this presentation there are ten useful JavaScript techniques which can be included in your application easily with less friction along with some AngularJs tips and best practices as a bonus. These tips and best practices are accompanied by examples & will cover script loading, design pattern, performance optimization and other areas.

Since best practices are very subjective topics, proper benchmarking needs to be done.


Monday, August 25, 2014

Oracle Internet Directory: Not able to create OID while installing on windows server 2008

I was trying to install Oracle Internet directory on Windows Server 2008 R2 64-bit, but at the configuration step where the all the components are created and installed the OID is not created and configurations fails and stops at that point.
Actually the main reason is OID is not able to start after creation and following error occurs:

Error creating ASComponent oid1.
Cause: 
An internal operation has failed: Failed to start the component
Action: 
See logs for more details.

oracle.as.config.ProvisionException: Failed to start the component
at oracle.as.provisioning.fmwadmin.ASComponentProv.createComponent(ASComponentProv.java:157)
at oracle.as.provisioning.fmwadmin.ASComponentProv.createComponent(ASComponentProv.java:73)
at oracle.as.provisioning.fmwadmin.ASInstanceProv._createComponent(ASInstanceProv.java:401)
at oracle.as.provisioning.fmwadmin.ASInstanceProv.createComponent(ASInstanceProv.java:364)
at oracle.as.provisioning.fmwadmin.ASInstanceProv.createInstanceAndComponents(ASInstanceProv.java:136)
at oracle.as.provisioning.engine.WorkFlowExecutor._createASInstancesAndComponents(WorkFlowExecutor.java:523)
at oracle.as.provisioning.engine.WorkFlowExecutor.executeWLSWorkFlow(WorkFlowExecutor.java:439)

Solution:
  1. Once the configurations failed, then closed the installation wizard.
  2. deinstall instance, domain and remove all the services.
  3. Create the directory in oracle home i.e Oracle/Middleware/Oracle_IDM1/log/diag/clients
  4. Add the parameter "DIAG_ADR_ENABLED = OFF" in sqlnet.ora present in the directory E:\Oracle\Middleware\Oracle_IDM1\network\admin
  5. Now run the OID setup.exe and select Install only if you want configure oid later or select Install and configure, you will not get the error again.
Note: For more information please follow the Oracle Support Document Doc ID 1561852.1

Saturday, August 23, 2014

Weblogic: Not able to start weblogic server with Ldap configuration

I was working with Microsoft AD Ldap and weblogic, after configuring the ad ldap in weblogic I have re-ordered the authenticator and after that while restarting the weblogic server I am getting the following error:

oracle.security.jps.service.idstore.IdentityStoreException: JPS-00056: Failed to create identity store service instance idstore.ldap.provider:idstore.ldap. Reason: oracle.security.jps.JpsRuntimeException: JPS-00027: internal error You configured a generic WLS LDAPAuthenticator. The identity store type cannot be determined. Please choose an LDAP Authentication provider that matches your LDAP server.

This error is coming because when you configured the AD Ldap and save the file then by default generic ldap authenticator is set in the configuration file.

Solution:
To solve this issue follow the steps

  1. Go to the config folder in domain directory i.e. Oracle/Middleware/user_projects/domain/domain_name/config/ and open config.xml.
  2. Now under security configuration you can see the generic ldap is configured.
  3. Now manually change authenication-provider type to "wls:active-directory-authenticatorType".
  4. Save the file and restart the server.

Note: Fore more information refer the oracle support document Doc ID 1331981.1

Oracle Webcenter Content: Could not start up IDC server deployment

Sometimes while starting the webcenter content server (UCM) in cluster mode we are getting the following error:

javax.servlet.ServletException: Could not start up IDC server deployment.
at idcservlet.ServletUtils.initializeContentServer(ServletUtils.java:1253)
at idcservlet.ServletUtils.startAndConfigureServer(ServletUtils.java:542)
at idcservlet.ServletUtils.initializeAllServers(ServletUtils.java:455)
at idcservlet.IdcFilter.initContentServer(IdcFilter.java:132)
at idcservlet.IdcFilter.init(IdcFilter.java:124)
Caused By: java.io.IOException: UCM Server failed to initialize inside its servlet environment.
at intradoc.idcwls.IdcIntegrateWrapper.initializeServer(IdcIntegrateWrapper.java:138)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
Caused By: intradoc.common.ServiceException: 
at intradoc.server.IdcServerManager.init(IdcServerManager.java:224)
at intradoc.idcwls.IdcServletRequestUtils.initializeServer(IdcServletRequestUtils.java:624)
at intradoc.idcwls.IdcServletRequestUtils.initializeServer(IdcServletRequestUtils.java:455)
at intradoc.idcwls.IdcIntegrateWrapper.initializeServer(IdcIntegrateWrapper.java:102)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Caused By: java.lang.NullPointerException
at intradoc.data.ResultSetUtils.getIndexMustExist(ResultSetUtils.java:445)
at intradoc.server.utils.ComponentInstallHistory.compareAndUpdateComponents(ComponentInstallHistory.java:139)
at intradoc.server.IdcInstallInfo.buildComponentList(IdcInstallInfo.java:874)
at intradoc.server.IdcSystemLoader.finishInit(IdcSystemLoader.java:354)
at intradoc.server.IdcSystemLoader.init(IdcSystemLoader.java:336)
at intradoc.server.IdcServerManager.init(IdcServerManager.java:120)
at intradoc.idcwls.IdcServletRequestUtils.initializeServer(IdcServletRequestUtils.java:624)


This error occurs due to missing idccs_components.hda file in the shared file directory or sometimes this file got corrupted and ucm server is not able to start.

Solution:
To solve this issue there is idccs_components.hda.old file in the same directory i.e. cs/data/components/ now just rename that file and restart the webcenter content server.

Note: This is bug 13877118 and already raised in oracle support. For more information about this bug and fixes please follow this oracle support document Doc ID 1512338.1

Thursday, August 21, 2014

Oracle Webcenter Content: Using page debugger to customize the ucm instance

As you know that Oracle Webcenter Content formerly known as Oracle UCM is content management system which provides many out of box functionality to manage the content of an organization. But some times it happens that you required some features or functionality which is not provided by the product and you need to customize it. Like you need to alter the layout or look and feel, or need to change the functionality of the existing feature however in every case you need to change the source code of the applications or product.
Here in this blog post I am not going to tell you how to customize or add new features or functionality, but I will tell you about debugger that webcenter content provides which may help you in customizing you content server instance.
Well to customize the page it is very important to locate the source code of that feature or component.
For example: let say we need to add a column at folder level (refer my post add column at folder level in ucm)
Here are the steps:

  1. First we need to identify the page to modify the source code.
  2. Now for this you can use the page debugger in ucm to identify the page. Although it is time consuming activity but you have to deal with that (there may be other possibilities but I did like this). To use the debugger you need to append the &IsPageDebug=1 to the url of the page.
  3. In the example I have shown the tender folder page, so right click and copy the link address of this folder and append &IsPageDebug=1 i.e. http://x.x.x.x:16200/cs/idcplg?IdcService=COLLECTION_DISPLAY&hasCollectionID=true&dCollectionID=875446151231000004&&IsPageDebug=1
  4. You will see the page debugger tab at the right-bottom of the page.
  5. On the Debug tab click on "idocscript trace", and then try to look for the page you need to modify. Well I have search for body in that page to locate the page to be modified because generally the content is placed in the body element of a html page and there I got the folders_list_resource.htm page.
  6. Rest you can read it in the blog post (add column at folder level in ucm).

Other Debugging Options

In ucm there are other debugging options like

  • IsJava: Display the local data of a content server page
  • IsSoap: Display the local SOAP data of a content server page
  • For more debugging option go to http://docs.oracle.com/cd/E17904_01/doc.1111/e10726/c07_config_u_and_t.htm#BHAIFFGA

Oracle Webcenter Content: Adding column at folder level in UCM

I was working on one of the requirement asked by client that they need Content ID column at folder level i.e when user move to one folder then Content ID of the content present in that folder should be visible.

What is happening :  see the below figure in which there is no column for Content ID.




What is required :  In the below figure Content ID column is added


Solution:

Well this is not the out of box feature in oracle webcenter content, you have to think to find the source code and edit the source code  manually to achieve this funcationality.
  1. I have found the page i.e. folders_list_resource.htm which contains source code of folder content view shown above (using the debug view in oracle webcenter content).
  2. This file you will find in the folder %MW_HOME%/Oracle_ECM1/ucm/idc/components/Folders_g/resources
  3. In the source code go to line number 75 (in my case) you will find a code some thing like this <$rsMakeFromString("ListFields","dBindingName,dFileSize,dInDate,dDocAuthor","name")$>
  4. In this line add "dDocName"  i.e. <$rsMakeFromString("ListFields","dDocName,dBindingName,dFileSize,dInDate,dDocAuthor","name")$>
  5. Save the file and put back into folder (path specified in Step2).
  6. Refresh the page.

Note: I have done this customization in Oracle UCM 11.1.1.5.0, If there is something different in other version please share.

Thursday, August 14, 2014

Oracle Webcenter Content: Displaying only release content to the user

In Webcenter content when you check in the content, put the user in the user access list or roles in the roles access list and then send the content into workflow then by default user/roles that you have provided at the time of check-in can access the content before the content is approved by the approver. You can restrict this default behaviour but adding the variable in the general configuration of the wcc server i.e.

CollectionReleasedOnly=true

Steps to add the variable.:

  1. In the left navigation under Administration --> AdminServer.
  2. In the component manager window, go to General Configuration and add the CollectionReleasedOnly=true in Additional variable text box.
  3. Save the configuration.
  4. Restart the webcenter content server.

Webcenter Content: Export/Import of Content Server Configuration using Configuration Migration Utility (CMU)

Configuration Migration Utility (CMU) is a useful tool in webcenter content to migrate the wcc configuration from one environment to another. The CMU is installed by default when you installed the webcenter content server or if it is not installed you can install it from the advance component manager.
Configuration migration is a error prone process so while migrating if some components or configuration failed so just mark that component and later on create the configuration manually on to that server. Also it is recommended that if there is a lot of content server configuration so instead of creating one bundle you can go for multiple bundles to complete the configuration migration successful.

Export of Content Server Configuration:
  1. In the left navigation go to Administration -> Config Migration Admin --> configuration templates
  2. In the action menu, select Create New Template.
  3. Under child section, select the content server sections.
  4. Now under the content server sections, select the under child section what you want to migrate.
  5. Now let say we have to migrate content metadata, then click on the content metadata link under Items for section select items to be migrated or you can select all from the Action menu.
  6. From the action menu click save to save the configuration.
  7. In the Add Export Rule window give the name of the template and description of the template.
  8. Repeat step 5 to add more content migration items.
  9. After adding all the items, export the bundle from Action menu.
  10. Copy the Bundle from the server i.e. <CS path>/cmu/<Instance>/bundles/<bundle name>


Import of Content Server Configuration:
  1. In the left navigation go to Administration -> Config Migration Admin --> Upload Bundle
  2. Browse the bundle file, select forced overwrite and click on upload.
  3. In the Action menu click on Import.

Monday, May 12, 2014

Complete testing of log in , Big picture !

Cracking an interview is not a Rocket Science to be frank , but yes for some it could be :D

Lets talk in general , what is the expectation of an interviewer from an interviewee. Interviewer just want the best answer which is unique and different from the rest of the world. Err...What does that mean ?

For each answer there should be an approach which a tester should mention while answering any question. And that is Always Start With Positive approach .!! Be it writing test cases , or reading requirements , executing test cases , thinking of a scenario in testing ,etc

Lets discuss how can we take an approach of writing test cases with an example which is asked in almost all QA - interviews.

How to design test cases for Log-in functionality..?
This is easy .. no ?
Lets try to think in a broader and better way.
Start with open questions :

  1. Why , on earth , user needs to Log into any system ?
  2. Why he would go for log in if:.. he is new to web ?
  3. What he will miss if he does not log into the system ?
  4. Why log is required to anyone ?
  5. What all process he has to go through if he opts for logging in?
  6. What is the process to log into system?
  7. What all credentials are required to get into the system ?
  8. What all basic information check is required to authenticate a user?
Now go more into depth and think more about the architecture as in how MVC will work in this case as Log in is all- web based and service oriented process. So try applying Service Oriented Architecture Concepts:
  1. How service oriented tests can be applied on log in.
  2. How session will be maintained when user log into system.
  3. How session will be maintained when user log out from system.
  4. How session will be maintained when user switch logging in and out from system.
  5. How system will behave when user opens a new tab , after logging into the system.
  6. What kind of response is expected when submit button is hit by system.
What all testing approach you can apply, try thinking as much as you can and categorize your test cases:
Boundary values:
  1. Check length of user name
  2. Check length of password

Equivalent partition
Create a group of test cases including positive cases
  • Enter the correct user-id and password and click on submit button
  • It should display welcome page
and negative cases:
  • Enter the correct user-id and wrong password and click on Submit button
  • It should display error
  • Enter the wrong user-id and correct password and click on Submit button
  • It should display error


Compatibility Testing
  • Check application should work on different Operating systems.
  • Check application should work on different browsers.

Comparison Testing
  • Check application should work on different resolutions.

Usability Testing
  • Check the auto focus of mouse
  • Mouse auto focus should be at UserId
  • Check the password with Lower case and upper case
  • Password should be case sensitive
  • Check the auto focus of mouse
  • Mouse auto focus should be at UserId
Security Testing
  • After login with valid credentials, click on back button
  • The page should be expired
  • After login with valid credentials copy the url and paste in another browser
  • It should not display the user's welcome page
  • Check the password with Lower case and upper case
  • Password should be case sensitive
And others could be :

  • Integration Testing
  • Functional Testing
  • End-to-end Testing
  • Performance Testing
  • Unit testing

There is still lot to test , and testing is a never ending process. So , all I can say Think more , Think Big ,Think Better !!

Thursday, May 8, 2014

Oracle SOA : java.lang.NoClassDefFoundError: Could not initialize class org.apache.myfaces.trinidadinternal.convert.ColorConverter

In Oracle SOA 11g (11.1.1.7.0) when you try to access the oracle worklist application or custom created worklist application to access the Human workflow tasks you get the following error:

java.lang.NoClassDefFoundError: Could not initialize class org.apache.myfaces.trinidadinternal.convert.ColorConverter
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
Truncated. see log file for complete stacktrace

java.lang.UnsatisfiedLinkError: Can't load library: /app1/oracle/middleware/Oracle_SOA1/soa/thirdparty/edifecs/XEngine/bin/headless/libmawt.so
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1706)
at java.lang.Runtime.load0(Runtime.java:770)
at java.lang.System.load(System.java:1003)
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1807)
Truncated. see log file for complete stacktrace

This is due to the missing "libmawt.so" in /soa/app/Oracle/product/fmw/Oracle_SOA1/soa/thirdparty/edifecs/XEngine/bin/headless

Solution:

Copy the libmawt.so library file from the JRockit installation directory (normally found in /lib/headless/) to the following directory:
%Middleware_HOME%/Oracle_SOA1/soa/thirdparty/edifecs/XEngine/bin/headless/

Note: Please refer document (Doc ID 1633015.1) on oracle support for further information.

Monday, May 5, 2014

Oracle SAP Adapter : ERROR com.ibi.bse.ConfigWorker:java.lang.NoClassDefFoundError: oracle/tip/adapter/api/exception/PCResourceException

I was working on a SAP integration with Oracle SOA Suite, configuring the Oracle Application Adapter for SOA. Then after starting the ae.cmd ( E:\Oracle\Middleware\Oracle_SOA1\soa\thirdparty\ApplicationAdapters\tools\iwae\bin\ae.cmd ) I am getting the following exception:

ERROR com.ibi.bse.ConfigWorker:java.lang.NoClassDefFoundError: oracle/tip/adapter/api/exception/PCResourceException

This is due to the missing libraries i.e jca-binding-api.jar and adapter_xbeans.jar

Solution:

  1. Copy the missing libraries i.e. jca-binding-api.jar and adapter_xbeans.jar from the location "E:\Oracle\Middleware\Oracle_SOA1\soa\modules\oracle.soa.adapter_11.1.1"
  2. Paste the copied files into the folder i.e. "E:\Oracle\Middleware\Oracle_SOA1\soa\thirdparty\ApplicationAdapters\lib"

Monday, April 28, 2014

Test 'me' ..err cookies are not that complex to test with Selenium.

If we talk in simple terms Cookies are some thing which parents always teach their child 'Not to have'.
And same applies to some web sites .They can make life tougher of user when cookies are hiding in the web pages and no one can understand 'what the heck is making my web page to react so weird!!!'

Let me first start why cookies are required and why/ when are not required. There are several types of cookies (of course not chocolate , strawberry , butter ,etc ) which can comes and lives on the web.
For an example, if I want to log into a system and want to stay in the system for ever until I explicitly log out from it , then to maintain this session go live I always requires some sort of cookies which will make this happen for me. This you can count as an advantage , with out a doubt !
But what about this , when I am working on a web page and trying to search for some one and it will navigate me to some stranger's profile which has no connection with the name i searched for . It is all about the game which cookies does for us :)
Without a doubt such behaviour will cause multiple issues when we talk in terms of automation.
Lets talk more in terms of selenium , how we can get rid of extra unwanted cookies from web page which are not required at all while executing test cases.
Ofcourse there are some manual actions which we can do to remove cookies from browser but yeah its a tedious task and then it will not add any value to our test automation framework.
We can start making a new maven project (following the concepts of Page Object model) and make a class in such format:

Now make a class which can test cookies in the application you are testing, or any sample application like http://www.compendiumdev.co.uk/selenium/search.php.
Now all you need to do is some basic set up require to make your application interact with selenium server.
You will require Junit to write test cases and class as a template to write test cases.
Start with instantiating the driver:
@BeforeClass
public static void startChrome() {
driver = new FirefoxDriver();
}
 
@AfterClass
public static void closeFireFox() {
driver.quit();
}
Now you need to open the application such that it will navigate user to the required URL. For this you need a method :
@Before
public void openTestURL() {
driver.navigate().to(testURL); // navigate to URl which is required.

And then what you need to do is to wait for page to get load and then delete all cookies which will come on run time on this web page

wait = new WebDriverWait(driver, 10); //Implicit wait appiled to driver
driver.manage().deleteAllCookies();// delete all cookies which is in browser for fresh start

Thats not all , what if the page has more cookies ?
For this you need to make a set of all such cookies and remove them like this :
@Test
public void searchAndCheckForCookies() {
queryBox = driver.findElement(By.cssSelector("input[title='Search']"));
queryButton = driver.findElement(By.name("btnG"));
queryBox.clear();
queryBox.sendKeys("monkey buns");
queryButton.click();

Set<Cookie> cookies = driver.manage().getCookies();
for (Cookie aCookie : cookies) {
if (aCookie.getName().contentEquals(
"seleniumSimplifiedSearchNumVisits")) {
assertEquals("should be my first visit", "1",
aCookie.getValue());
}
if (aCookie.getName().contentEquals(
"seleniumSimplifiedSearchLastSearch")) {
assertEquals("should equal 'monkey buns'", "monkey buns",
aCookie.getValue());
}
}
}

And if you want to remove any specific cookie/s from the web page then you can use this method :

@Test
public void getOneSpecificCookie() {
queryBox.clear();
queryBox.sendKeys("monkey buns");
queryButton.click();
refreshPageObjects();
queryBox.clear();
queryBox.sendKeys("testing 123");
queryButton.click();

Cookie cookie = driver.manage().getCookieNamed(
"seleniumSimplifiedLastSearch");
// %20 is a space in the raw data that is returned
assertEquals("should equal 'testing 123'", "testing%20123",
cookie.getValue());
}
}


Lets do Fitnium together!

In my last post on fitnium , I have described all the basic needs which one need to know when he/she is starting or even thinking to work on fitnium.
Those are some very basic concepts which user should know before getting into the technicalities of the tool.
So as of now , we know why and when to use fitnium and along with this the base tools which fitnium uses in the backend while executing the test cases.
Lets start with how we can start working with this weapon of testing.
Fitnium is a free tool and can be downloaded from the fitnium website (Source http://www.fitnesse.org/ ).
It is a simple , very easy-to-use tool on which you can start writing test cases if you have some basic knowledge of any one the popular programming languages like Java, Ruby , etc.
It requires a sinlge click download to start working on fitnium , you can download the jar from http://sourceforge.net/projects/fitnium/files/latest/download
. Once its downloaded at your local all you need to do is to extract this rar file into a folder.
You will get a structure like this :

Here you can get 2 executables , one is fitnium librarry having all libraries fitnium requires to run test suites and cases. The other jar is the one which will be of more importance , all we need is to execute this jar. Like this:
java -jar fitnesse.jar
It will give some obvious problems like :

As generally in local systems everything by default works on 8080 port , so no two person can sit on one seat . Hence system will complain and ask for some new port, You can simply change the port to some other port by using -p command :

Once this is done , you can see awesome UI on your local system and can explore new things . UI will looks like this :

Will continue how we can write our test scripts in next blog, till then stay tuned :)