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.
http://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

Follow

Get every new post delivered to your Inbox.