BDD using easyB, Selenium and Groovy by Rajiv Narula

Posted in Uncategorized with tags , , , , , , on January 12, 2012 by javaforweb

Today I got an opportunity to attend a session over BDD using easyB and Selenium.
Scripting language – Groovy.

It was “def test = new BDDMadeEasy(Selenium,EasyB,Groovy)” by Rajiv Narula.
www.rajivnarula.com

Rajiv is an Associate Director with Perceptive Informatics having 15 years of experience in dev, architectural road map, laying automation strategy etc.

This was my first appearance in a MeetUp group and I can say I am satisfied with my decision.
I knew some hands on stuff over Groovy and few things about JBehave like writing stories etc..

I would like to share my take aways from the Session.

In Rajiv’s words

BDD ( Behavior Driven Development ) is a way that can let 3 Amigos – BAs, Developers and Testers collaborate.
Software artifacts/documents like Requirement Specs, Use Cases, functional specs, flow charts, stories etc can be used to describe the content of the software but But “How software will behave under specific condition?? ” none of them answers it.

BDD gives an answer to “How should a software will work under specific situation.”

BDD offers a template for defining behavior.

Template :-
++++++++

Given Some precondition (Pre-conditions)

Some Action by actor (Steps)

Then some testable outcome is achieved (Expected Behavior)

Similar way we can have multiple conditions.

A Use Case can be defined as a set of scenarios and easyB scripts allow us to write stories that can implement those scenarios in a beautiful way thus giving a common platform to the Business Analyst and Tester to working on same ground.

Writing stories in easyB

writing stories… in easyB script

description “As simple as it gets”

scenario “Testing easyB setup”
{

given “there is some precondition”, {
myList = new ArrayList()
}
when “some steps are performed”, {
myList.add(‘Hello easyB’)
}
then “results can be validated”, {
myList.size.shouldBe 1
}

}

description, scenario, given, when and then are KEYWORDS. A business analyst can understand statements written in “” eg. “there is some precondition” and an Automation Tester can actually write automation code/test script with in {}e.g. { myList = new ArrayList() }

Greater Boston Selenium Users Group

Another example -

ThisIsSampleStory

description “”

scenario “search on google”, {
given “machine is connected to internet”
}

when “Search Rajiv on google” ,
{ selenium.open(“/search?q=rajiv narula”)
}

then “google result should bring something”, {
selenium.isTextPresent(“rajiv narula”).shouldBe true
}

So here a layer is written that will interpret this story file and execute it giving the excution results in the simple Story based format.
These results can be generated in the HTML or any other format.

There are many things we can achieve through easyB like prioritizing the test cases using Tags, parallel script execution etc.
To be frank I would like to learn more about BDD and tools like JBehave with selenium or RSpecs and Cucumber.

Though I personally had a feel that its a better way to let a BA and Tester work together and a way through which application behavior can be tested based on   requirement specifications.

Here are some of the useful links to learn BDD :-

JBehave and Selenium :-

http://blog.m.artins.net/acceptance-tests-with-jbehave-selenium-page-objects/

http://jbehave.org/reference/web/stable/using-selenium.html

http://siark.wordpress.com/2010/10/01/behaviour-driven-development-with-jbehave-web-3-selenium-and-maven-2-on-os-x-snow-leopard/

RSpec and Cucumber :-

http://blog.davidchelimsky.net/2007/05/14/an-introduction-to-rspec-part-i/

Test you SHIT please @Testing Yammer

Posted in Uncategorized on August 4, 2011 by javaforweb

Automation Idea

Posted in Uncategorized with tags on July 15, 2011 by javaforweb

Can we have a layer that will take care of all the Automation stuff in a smart way that it will take the manual regression test cases as commands to execute on AUT.
Anyone can write dumb scripts, time needs innovation and I will think about it.

Google+ Features Demystified – Part 1

Posted in Google, Uncategorized, Web 2.0 with tags , , , , , , , , , , , , on July 9, 2011 by javaforweb

First time I opened my Google+ page, I could see – An important note about Field Trial –

(To Best view Images please click on them)

You’re a part of a small group of people who are helping to test Google+.

When you share something with people who are not yet able to use Google+,

they will receive it via email but won’t be able to comment or engage with

the content like other Google+ users. They’ll be able to join Google+ as

we let more users in over time.

OK so I am now a part of Google+ or Google Plus, HURRAY! I got it I got it… Eureka did you hear something??

So I thought why not write a Blog Entry – Google+ De-Mystified (Well not completely may be 20% who knows may b more :) )

This way they will recieve it via javaforwe Blog and will be able to comment and become familiar with some of the nice features.

For Google+ I am picking section by section on the screen and analysing the requirements and trying to understand the functionality and need

of incorporating the functionality.

First of all Top Right Section.

When I clicked the image(Looks like Account Settings actually it is Google+ Settings) on the Top Right Corner I could see 4 links.

Google+ Settings and Google+ Help in one section and Send feedback and Web History in second and third section.

I could also see Send feedback feature at the bottom right of screen and I think I am doing it one way by writing this blog post at 1:43 a.m.

Now I know that Google maintain a database of searches done by the users when they are logged in to their Google account.

IMPRESSIVE. Web History comes from it.

Data for an other application Google Trends also comes collectivelty from these searches.

Lets Go to Web History Link( Its little out of target from Google+, since it appears on Google+ page, I would like to touch it).

I hope it will be a good one.

Here I am on their Web History Page that opens in a new tab.

Url: https://www.google.com/history/….

This page is full of some very useful system that may help almost everyone in this world who uses more than 1 computers.

Need not to be dependent on Local browser Bookmarking, Google will maintain them. – Super !

This page has whole bunch of features related to web history or searches done using google search engine while one is logged in to ts account.

They have a Calander control on the right, to give functionality to user to check what they searched on a particular date.

They have functionality for Pause web history, Remove selected web history OR clean entire web history.

They have a link for Expand your Web History and I am not going to touch it at 2:44 a.m. After all curious users also love to sleep, Infact more than anyone else like to.

Google Trends link also appears on it.

I see a Bookmark Link and Lets click and see whats there :)

Woah.. I land on Social Bookmarking ye ye with an import provided for Delicious…

We can create List, A set of tools for bookmarking is provided. But Ashutosh+ or in general Google+ is missing from the Bookmark page.

May be because it is not the part of Google+ project but still provides and external link from Google+ page. Good.

I still have to touch Google+ Setting link which has got couple of features before that I will come back to Google+ home page

Now Comes Share  functionality.. Share your image, video, link or your location :-

Notification Functionality.

Number of Notifications will be represented by the Numeric digit. Same way as they are represented in Facebook

I see some bad behaviour here. I clicked Notification link and my profile Image’s color changed. ????

Also I noticed a blur rendering of my profile image ..

Why?

Account Settings.(My last entry in this blog)

Clicking it we will land on Setting page with Account settings are highlighted.

I will keep on mining google+ features in my coming posts.

Its 4:03 now and this is Ashutosh Signing off from Google+

and going to his Bed+ mode. Caio.

Madness started at 9 p.m. – Android .. TADAAAA !

Posted in Android, Google, java, SWT, Uncategorized with tags , , , , , , on July 5, 2011 by javaforweb

Midnight madness ……  started at 9 p.m. to install Android and launch a sample application !

It all started with installing pandora on my android and as usual itching started…

Quickly installed mamoth size Android SDK… let me check the size….   2.39 GB with plugins…

After that installed ADT on eclipse and associated sdk with the project…   fetched a sample application JetBoy in to workspace…

There was a lil time consumption in adding AVD to project

Finally got success after adding third part Add-ons

Got help from

http://developer.android.com/guide/developing/devices/managing-avds.html

And launched JetBoy.java

It is a game app….  Lost badly :)

Now I am happy… this weekend ends in a good way….  its 12:43 a.m. and a curious mind is fed aptly ! its a good start and in coming days postmortem of Android SDK will start !

Happy to see console

[2011-07-04 23:47:24 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Unable to read C:\AndroidManifest.xml: java.io.FileNotFoundException: C:\AndroidManifest.xml (The system cannot find the file specified)
[2011-07-04 23:47:24 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Unable to read C:\AndroidManifest.xml: java.io.FileNotFoundException: C:\AndroidManifest.xml (The system cannot find the file specified)
[2011-07-04 23:52:11 - JetBoy] ------------------------------
[2011-07-04 23:52:11 - JetBoy] Android Launch!
[2011-07-04 23:52:11 - JetBoy] adb is running normally.
[2011-07-04 23:52:11 - JetBoy] Performing com.example.android.jetboy.JetBoy activity launch
[2011-07-04 23:52:11 - JetBoy] Failed to find an AVD compatible with target 'Android 1.5'.
[2011-07-04 23:53:13 - JetBoy] Still no compatible AVDs with target 'Android 1.5': Aborting launch.
[2011-07-04 23:53:13 - JetBoy] Performing com.example.android.jetboy.JetBoy activity launch
[2011-07-04 23:53:39 - JetBoy] Launch canceled!
[2011-07-04 23:58:20 - JetBoy] ------------------------------
[2011-07-04 23:58:20 - JetBoy] Android Launch!
[2011-07-04 23:58:20 - JetBoy] adb is running normally.
[2011-07-04 23:58:20 - JetBoy] Performing com.example.android.jetboy.JetBoy activity launch
[2011-07-04 23:58:20 - JetBoy] Failed to find an AVD compatible with target 'Android 1.5'.
[2011-07-04 23:58:42 - JetBoy] Still no compatible AVDs with target 'Android 1.5': Aborting launch.
[2011-07-04 23:58:42 - JetBoy] Performing com.example.android.jetboy.JetBoy activity launch
[2011-07-04 23:58:53 - JetBoy] Launch canceled!
[2011-07-04 23:59:39 - JetBoy] ------------------------------
[2011-07-04 23:59:39 - JetBoy] Android Launch!
[2011-07-04 23:59:39 - JetBoy] adb is running normally.
[2011-07-04 23:59:39 - JetBoy] Performing com.example.android.jetboy.JetBoy activity launch
[2011-07-05 00:00:42 - JetBoy] Launch canceled!
[2011-07-05 00:12:37 - JetBoy] ------------------------------
[2011-07-05 00:12:37 - JetBoy] Android Launch!
[2011-07-05 00:12:37 - JetBoy] adb is running normally.
[2011-07-05 00:12:37 - JetBoy] Performing com.example.android.jetboy.JetBoy activity launch
[2011-07-05 00:12:37 - JetBoy] Failed to find an AVD compatible with target 'Android 1.5'.
[2011-07-05 00:14:22 - SDK Manager] Created AVD 'FirstTest' based on Google APIs (Google Inc.), ARM (armeabi) processor,
[2011-07-05 00:14:22 - SDK Manager] with the following hardware config:
[2011-07-05 00:14:22 - SDK Manager] hw.sdCard=yes
[2011-07-05 00:14:22 - SDK Manager] hw.lcd.density=240
[2011-07-05 00:14:22 - SDK Manager] vm.heapSize=24
[2011-07-05 00:17:11 - JetBoy] Still no compatible AVDs with target 'Android 1.5': Aborting launch.
[2011-07-05 00:17:11 - JetBoy] Performing com.example.android.jetboy.JetBoy activity launch
[2011-07-05 00:17:14 - JetBoy] Launch canceled!
[2011-07-05 00:17:29 - JetBoy] ------------------------------
[2011-07-05 00:17:29 - JetBoy] Android Launch!
[2011-07-05 00:17:29 - JetBoy] adb is running normally.
[2011-07-05 00:17:29 - JetBoy] Performing com.example.android.jetboy.JetBoy activity launch
[2011-07-05 00:17:29 - JetBoy] Automatic Target Mode: launching new emulator with compatible AVD 'FirstTest'
[2011-07-05 00:17:29 - JetBoy] Launching a new emulator with Virtual Device 'FirstTest'
[2011-07-05 00:17:35 - JetBoy] New emulator found: emulator-5554
[2011-07-05 00:17:35 - JetBoy] Waiting for HOME ('android.process.acore') to be launched...
[2011-07-05 00:19:14 - JetBoy] HOME is up on device 'emulator-5554'
[2011-07-05 00:19:14 - JetBoy] Uploading JetBoy.apk onto device 'emulator-5554'
[2011-07-05 00:19:16 - JetBoy] Installing JetBoy.apk...
[2011-07-05 00:20:25 - JetBoy] Success!
[2011-07-05 00:20:25 - JetBoy] Starting activity com.example.android.jetboy.JetBoy on device emulator-5554
[2011-07-05 00:20:30 - JetBoy] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.android.jetboy/.JetBoy }
Few useful links to start with :-
http://www.talkandroid.com/android-sdk-install-guide/
other tabs I closed :(
Have to sleep now.. Tomorrow have to get back to my Manual Testing task !
And the Song I listen to all this time is
Walk Away - Five Fingers
Just walk away make it easy on yourself, 
Just walk away please release me from this hell, 
Just walk away there's just nothing left to feel, 
Just walk away pretend that none of this is real !

Chrome Voice recognition an insight !

Posted in Google, Uncategorized, Web 2.0 with tags , , , , , , , , , on June 18, 2011 by javaforweb

As I promised myself to dig more about Chrome’s Voice recognition, I have started it already after having a cup of tea and Honey Nut Cherios. By the way I found them very tasty.
Coming back to Chrome, first thing I found is their code trunk :

http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/speech/

Here is the link to speech recognition speech_recognizer.cc

http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/speech/speech_recognizer.cc?view=log

Mugging it more I came to know they are using FLAC – Free Lossless Audio Codec, here is the link

http://en.wikipedia.org/wiki/Free_Lossless_Audio_Codec

Checking more about FLAC I came to know it compress audio by 50% but the good thing is it does not lose a single bit during the process.

If you want to test Chrome Voice Recognition, checkout this out

http://slides.html5rocks.com/#speech-input

Then I scratched my itching and started to search for a site where I can find some phonetic sounds that I used on HTML5Rocks.

Here is the Link

http://www.uiowa.edu/~acadtech/phonetics/english/frameset.html

I used Phonetics in American English, Spanish and German

I tried few words like ball, taboo, rub , goose, ago, dear and much more .. here are the results

ball – lol
taboo – taboo
rub – various attempts give krupp, growth,
goose – who is
ago – google and piccola (God what is this?)
dear – dear

Results are not impressive !!! Damn………….. !

My sincere advice to them, please please please do a sincere alpha testing… get people on board from various countries and see if they can extend support for
various phonetics.. BEFORE that see what improvements are required in the original APIs.

Chrome’s Voice recognition – could it be messy?

Posted in Google, Uncategorized, Web 2.0 with tags , , , , , , , , , on June 17, 2011 by javaforweb

Now that Google Chrome is out with the voice recognition support and I am curious about many things e.g. like how they are handling accents around the world. The biggest challenge(they must be have accessed it already) could be Indian, Chinese, Spanish, German english and accent.

Google Chrome Voice Recognition Support

I tested various words with my Beats earphone/microphone and testing it over Lenovo T410 with genuine Audio driver (I am not sure if they care about all this). But the results came are not good. Few word that Chrome detected clearly on the first go were “Hello” & “John”.

One thing I am sure about is auto search suggestions below original search given by it are absolutely vague .. like below “Hello” it suggests “I will” Below “Dance” it gives “Jazz” and below that “Dancing”.
One thing is really freaky… please check the Image

I would like to know about the APIs and algorithms they are using for Voice Recognition. Weekend is coming and I will be after it. That gives me ultimate pleasure wor

TremendousX – Beyond The Imagination !!

Posted in tremendousx with tags , , , , on August 30, 2009 by javaforweb

Hello Friends

After one year of long time I am here again. This time to tell you about Our Web Design and Software development Unit.

Please visit –  http://www.tremendousx.com/

In this one year we got a good experience in the local market. We are exploring more opportunities in India and Abroad too. We have an experienced team of very good developers and good service providers. I started as an IT consultant in the same.

MDA- Model Driven Architecture for Software Devlopment

Posted in MDA, OMG with tags , , , on June 8, 2008 by javaforweb

In this post I will discuss about Model Driven Architecture and its potential in building big projects at rapid pace with high proficiency.

Experienced application developers often invest more time in building models than they do in actually writing code. Well-constructed models make it easier to deliver large, complex enterprise systems on time and within budget.
            MDA-OMG

MDA is a framework advanced by the Object Management Group (OMG) allows developers to build systems according to their core business logic and data—independently of any particular hardware, operating system, or middleware.

 This framework is based on UML and other industry standards for visualizing, storing, and exchanging software designs and models.This Framework emphasizes on importance of models in the software development process.

 In MDA the software development is done by evolving models of the system to be developed.

               MDA software development life cycle

             MDA Devlopment Cycle

MDA identifies same process that is present in traditional software development for developing a System.

 The following three models are at the core of the MDA.

 

 

 

 

 1) Platform Independent Model

2) Platform Specific Model

3) Code

Platform Independent Model

The first model that MDA defines is a model with a high level of abstraction that is independent of any implementation technology. This is called a Platform Independent Model (PIM).

Platform Specific Model

PIM is transformed into one or more Platform Specific Models (PSMs). A PSM is tailored to specify your system in terms of the implementation constructs that are available in one specific implementation technology. For example, an EJB PSM is a model of the system in terms of EJB structures. It typically contains EJB-specific terms like “home interface,” “entity bean,” “session bean,” and so on. A relational database PSM includes terms like “table,” “column,” “foreign key,” and so on.

Code

This is the final step in the development is the transformation of each PSM to code. Because a PSM fits its technology rather closely, this transformation is relatively straightforward.

At every step the level of Abstraction increases. PIM, PSM, and code are shown as artifacts of different steps in the development life cycle.

 

                       The three major steps in the MDA development process

             MDA Devloment Cycle

 Rational product support for MDAs

IBM Rational software has several products that support MDA and Model Driven Development (MDD) in varying capacities. These tools fall into the following basic categories:

 

 

 

 

 

 

 

 

General-purpose

 

Domain-specific

Supporting

Rational Software Architect supports both the principles of MDA as well as the standards upon which MDA is based. It adds full support for MDD, including UML Version 2.0 modeling, code generation, patterns and model transformations, and a new approach to implementing the MDA style of development.

In general purpose category for Java™-based MDA applications IBM provide

MDA toolkit for Rational XDE Java which is an Eclipse plug-in that complements existing patterns and code template features and adds some additional capabilities.

In the domain-specific category IBM Rational System Developer provides a complete UML-based design and development environment optimized for engineering and other types of technical applications developed in C or C++.

In the supporting category, IBM WebSphere Business Modeler is used to model and simulate business processes. As new business processes are developed, models can be exported from the tool and imported into Rational Software Architect or Rational Rose XDE Developer to drive an MDA development process.

MDA Faq’s Visit

http://www.omg.org/mda/faq_mda.htm

Java Tutorials by Ashutosh Sharma pls visit:

http://sharma.ashutosh84.googlepages.com

 

 

 

 

 

 

Tomcat – Is this an Application Server ?

Posted in J2EE with tags , , , on June 5, 2008 by javaforweb

In this post i’ll discuss about Apache Tomcat Web Server and look in to its extent for support in J2EE Environment.

Apache Tomcat is one of the most popular options for lightweight development scenarios,and in many cases meets the need for an application server, even though it is technically a Web server.Java EE extends Java Platform, Standard Edition (Java SE) to support Web services, an enterprise component model, management APIs, and communication protocols for designing and implementing service-oriented architectures, distributed applications, and Web applications.

A compliant Java EE application server must support features such as an Enterprise JavaBeans (EJB) server and container; JNDI capabilities; a Java Message Service (JMS) framework; a Java Transaction API (JTA) framework; and J2EE Connector Architecture. Java EE servers usually support a hierarchical classloader architecture enabling such functionality as EJB loading/reloading, WAR loading/reloading, manifest-specified utilities, and so on.

Java EE defines containers for client applications, servlets, and EJB components. These containers provide structure and functionality that facilitate the deployment, persistence, and execution of supported components. The J2EE Connector Architecture enables a provider of an enterprise system to expose the system using a standard interface known as a resource adapter.

Using a Java EE server(Application Server) gives you the convenience of hosting a system in a pre-tested environment that offers all of the Java enterprise development services. In some cases, however, the Java EE server brings unnecessary overhead to an execution environment that only requires one or two of these services.

For instance, many Java-based Web applications are deployed to environments that only support the technologies found in a Web server/container, such as servlets, JSPs, and JDBC. In these scenarios you might choose to construct a system piecemeal, using sundry frameworks and providers.

Some developers would choose to use Tomcat in place of the Java EE application server given these environmental constraints.

Web applications vs. enterprise applications

For some, the confusion over Tomcat’s definition points to the deeper question of what differentiates an enterprise application from a Web application. Traditionally, a Java enterprise application is defined as a combination of the following components and technologies:

  • EAR files
  • Java Servlets
  • JavaServer Pages or JavaServer Faces
  • Enterprise JavaBeans (EJB)
  • Java Authentication and Authorization Service (JAAS)
  • J2EE Connector Architecture
  • JavaBeans Activation Framework (JAF)
  • JavaMail
  • Java Message Service (JMS)
  • Java Persistence API (JPA)
  • Java Transaction API (JTA)
  • The Java Management Extensions (JMX) API
  • Java API for XML Processing (JAXP)
  • The Java API for XML-based RPC (JAX-RPC)
  • The Java Architecture for XML Binding (JAXB)
  • The SOAP with Attachments API for Java (SAAJ)
  • Java Database Connectivity (JDBC) framework

A Java Web application, meanwhile, is said to combine a subset of Java enterprise application components and technologies, namely:

  • WAR files
  • Java Servlets
  • JavaServer Faces or JavaServer Pages
  • Java Database Connectivity (JDBC) framework

In a typical Java EE Web application, an HTML client posts a request to a server where the request is handled by the Web container of the application server. The Web container invokes the servlet that is configured to handle the specific context of the request.

Once the servlet has received the initial request, some form of request dispatching ensues in order to perform the necessary business logic for completing the request. One or more business services or components are then invoked to perform business logic.

Most business services or components require access to some form of data storage or information system. Oftentimes an abstraction layer between the business service and the data store is provided in order to protect against future changes in the data store. DAOs (data access objects) are often employed as data abstraction components in this situation.

When the DAO invocation step is complete, the response data is passed back up the chain of command, usually as one or more Java beans. The Java beans are then passed to some type of state machine and/or view manager in order to organize and format the markup response. When processing is complete for a given request, a formatted response is passed back to the HTML client.

Now, suppose we add a requirement to the application for asynchronous messaging between business service components. In a Java-based system, this would typically be handled using the Java Message Service (JMS) as shown in figure :

JMS in J2EE Architecture

Most Web servers do not offer JMS as a standard feature, but it is simple enough to add a JMS implementation to a Web server environment.

The application scenario depicted in Figure above could be handled quite easily with just a Web server providing a servlet engine and JSP engine.

Now we add the requirement for connectivity between business services and disparate enterprise information systems. Java EE offers the Java Connector Architecture as a common standard to meet this challenge.

EIS in J2EE Architecture

The architecture is now approaching a complexity that is arguably better suited for a Java EE application server.

A Web server such as Tomcat could possibly be used in combination with other frameworks to meet the requirements, but system management and monitoring complications might make the server/framework mix impractical.

Figure presents a moderately complex, Java-based, service-oriented architecture employing all of the technologies along with communication between multiple WAR deployments, EJBs, and Web services.

Webservices, EJBs, Multiple WAR in J2EE Architecture

The architecture in Figure above has entered the realm of complexity that requires a tested, scalable, manageable Java EE enterprise application server. Once again, a development team with the proper skill level could use Tomcat for the Web tier and piece together technologies and frameworks to support the business and data tiers.

What i personally feel is to support this type of architecture using web server is Impractical. But Most of the tasks that are involved in J2EE environment can be supported by Apache Tomcat Web Server !!

Java Tutorials by Ashutosh Sharma, please visit :

http://sharma.ashutosh84.googlepages.com

Follow

Get every new post delivered to your Inbox.

Join 66 other followers