Saturday, December 22, 2012

Simple Selenium UI web Testing

Simple Selenium UI web Testing:

1. Download Firefox Selenium from
https://addons.mozilla.org/en-us/firefox/addon/selenium-expert-selenium-ide/

2. Restart firefox.

3. Go the the web URL you want to test it (May be to your login screen if your website required login credential)

4. From that url just click 'Tools' ->  'Selenium IDE'

5. Selenium IDE will be opened, it will be in default start recording your website action.

6. Now in your website do any action like login followed by searching products etc.

7. Now come to selenium IDE, stop the recording and execute the command by clicking play.

8. Web-browser automatically open by selenium and do all the activities earlier manually performed!

Thansk to Selenium :)





Friday, December 14, 2012

Spring JMS ActiveMQ - Introduction/Perfomance

What is JMS?


Java Message Service(JMS) is a Specification/Interface/API provided by SUN for sending messages between two or more clients
JMS Producer (Client) ---> Provider/Broker/ActiveMQ ----> JMS Listener (Client)
Producer: In simple word it create message and send it to provider's destination Queue through JMSConnectionFactory
Destination: Destination is a .Queue where message resides in the provider.
Provider: Provide implements the JMS specification for sending messages between clients. ActiveMQ is one the well know provider. Provider is also known as broker as it does the job of transferring the message from producer to listener,
Listener: It listen to the queue when even there is a message in the queue listener process it inside onMessage method.
Persistence and Non-Persistence Mode: ActiveMQ in default runs in persistence mode. Persistence mode means message is persisted by the provider in file system or db. 
Why JMS Persistance Mode? 
Consider message is transferred from producer to provider, in persistence mode provider(ActiveMQ) will persist the message in file system. Consider listener is busy in processing other task or listener server is down. Due to some other issue if provider(ActiveMQ) server is also down if message is not persisted then message will be lost without reaching the listener. In our case since we run it in persistence mode message is persisted and it will be used by the listener when both provider and listener servers are up and running!  

JMS Performace:
Non-persistent delivery of message improves the performace of the overall system. 

When to use Non-Persistance mode:
For usage scenarios where only reliability is required we can go with non-persistance JMS, where as when we need guaranteed message delivery we can use persistance mode. Even in non-persistence mode JMS specification allows the messaging provider to make best efforts to deliver the message to currently active message consumers.