Upcoming Selenium Training Meet on 1st July 2012. Want to participate? Voice your opinion? Follow Discussion, Accept Meeting Request and view Meeting Agenda

Monday, June 4, 2012

Selenium Training Meet 3rd June - Video Recording

Yesterday was the second session of Selenium Training meet. There were 109 registrations for meeting and 54 users participated in it. We discussed on -
  • nth locator in CSS 
  • Selenium IDE
  • Firefox and Chrome Driver
  • Using TestNG with Selenium
You can access Video Recording here. I hope none of you encounters any issue with video recording this time. I have uploaded Java Project here, which we used during session.

Don't hesitate to ask me any question about session or if you face any other issue with Selenium.
Stay tuned for next session. As again a big thanks to AnyMetting for their wonderful resources.

Sunday, May 20, 2012

Selenium Training Meet 19th May - Video Recording

Just finished first on line Selenium meeting. There were about 120 registration received and more than 60 users participated in meeting which does not seem bad for a meeting held on weekend. Meeting recordings can be watched here. Feel free to share in your contacts.

A few of you complained about audio unavailability. If you are not able to hear audio then please reload/refresh the video URL.

The meeting was largely focused on xPath and CSS locators. If you participated in meeting and have an opinion/suggestion then please post it here

A few of you asked me to post questions I asked towards end of session. They are -

Thursday, April 26, 2012

Headless tests with Firefox WebDriver

There are times when you don't want a browser popping each time you execute the test. Or you just don't have privilege of having a browser display like in UNIX based system running your CI and not having any display. These are the times when you would find it right to execute your tests in headless browser mode.

What we need -
  • Xvfb: X virtual frame buffer is X11 server which does graphical operation in memory, hence no output is displayed. Wikipedia has more on it.
  • Firefox: World famous open source browser
  • A simple selenium test: As simple as launching Google in Firefox
First we need to install Xvfb and FF on Ubantu as -

sudo apt-get install Xvfb firefox

Not you can start Xvfb as -

Xvfb :1 -screen 0 1024x768x24 &

From manual of Xvfb -
-screen screennum WxHxD
           This option creates screen screennum and sets  its  width,  height,
           and  depth  to W, H, and D respectively.  By default, only screen 0
           exists and has the dimensions 1280x1024x8.
Now comes the selenium test. You need to guide Firefox so that it executes test in Xvfb started in previous steps.

Thursday, April 5, 2012

Finally some good news for Software Testers

Here are some of the latest Testing and IT news from our technical reporters -
  • IT managers consortium has agreed that software testers would no longer be blamed for a production defects. Though they are yet to find some one who they could put blame on (Johny the developer is said to be already suffering from ProductionDefectoPhobia)
  • Consortium has also agreed on having salary of software testers on par with software developer at least by 2020. There was an unanimous decision on increasing management salary by 23% from immediate effect
  • Consortium has barred developed from using phrase "It works locally". Violation of this rule would attract 1 night out in office. Continuous violation would attract exponential salary deductions
  • Speak and Automate - New era in automated testing. Voice Automation tool for web and windows application was released yesterday. This tool is capable of generating automation suites as you speak of application use cases.

Wednesday, February 8, 2012

Is it sane to compare Selenium with QTP?


I have seen many articles which compare Selenium (1 or 2) with QTP (or other commercial tools). But these articles miss very basic point that Selenium is a library available in variety of language while QTP has entire gamut of tools with it. So if you were to really compare QTP with Selenium then comparison should be based on the library of languages which is offered either of these tools, which in my opinion Selenium wins outright over QTP.
My only intention of writing this post is not claim Selenium victory of QTP but to demonstrate how badly Selenium is compared with QTP at times. There might be things QTP would be good at doing (I left QTP long ago hence can not name any) but to disregard Selenium on the factors I listed herein is highly biased.
  • Object spying - Sure, you have QTP recorder which does it for you but don't forget that you can test object locator using Selenium IDE and it is not limited to using only Selenium IDE. Firebug with Firefox can be used for same while Chrome has built in development tool bar to test element locator. In case you don't know you can use $$("cssLocator") to test css locator and $x("xpathLocator") to test xPath in both FF and chrome to test application objects. Can you use QTP to test object locators in FF and Chrome?
  • Debugging code - So QTP comes in with built-in editor and Selenium is defeated in this aspect. Is it? Given the variety of languages Selenium can be used with, you have far greater language editor options with Selenium than with QTP.

Which testing role are you playing and why

Which category of software tester do you fall in?
  • Manual tester: who gets the requirements (or some times not), works along with development team when they are using non verbal languages (read - java, c#, php etc) and you are using most sophisticated language (read english) to jot down the same thing - client expectations.
  • Work delegation Engineer:  You assign work to fellow testers, question them when they miss deadline or defects, make sure they have enough work for entire week and probably more after heading home. Now you know which category you fall in.
  • Tool analysis and recommendation engineer: You job is to recommend tools for various situations. Tool could be as simple as xenu link checker or those zillions of automated UI testing and performance tools.
  • UI Automation test engineer: You automate most pressing use case scenarios so that you and you team could spend time in rational manual testing find valuable defects.
  • Time pass tester (aka Facebook tester)

Friday, January 20, 2012

An open billet doux to beloved manager

Dear manager,

I never imagined that I would ever write an open love letter to you but having worked with you for so long I am drowning in the sea of love and can not help but let the world know of my feelings for you. Since you like the bullet points I am following the same. (Sorry, could not do Microsoft excel for this. Please bear with me for not letting you create pivot table this time). Here I go -
  • Some time quick and dirty is good. We should have followed it in stand up meetings at least! Those meeting which soon became Sitting Meetings and later Sleeping Meeting.
  • Forcing me to find significant improvement areas in project every fortnight (sigh). Dear, if there were possibilities to do it so frequently then there must have been some thing badly wrong with project.
  • You wanted me to test 24/7. Your Keep Testing arguments are always roaming on my mind. And if that was not enough you asked me to write that stupid certificate. I wish I had done that as there are enough foolish companies which consider testing certificate no less than bible. And I would have broken the shackles of this relation.
  • You asked me for test status every half an hour. I understand your feelings for me but some times we need to be more patient with things.

Friday, January 6, 2012

Selenium 2 methods are no more Weird!!!

tl;dr A long post about using Selenium 1 sort syntax with Selenium 2/WebDriver.

I have seen automation teams suffering from verbosity of web driver way of writing code. One automation guy told me once that he does not want to use Selenium 2 on a brand new project because he finds its syntax utterly weird. But before discussing "Weirdness" of Selenium 2 syntax, let us agree on fact that teams migrating from pure manual testing to automation code find it more weird than ever. While selenium.type("elementLocator", "testData") looks simple to them. Using driver.findElement(By.xPath).sendKeys("testData") looks excessive coding to be able to perform same operation.
Herein I am illustrating the way to wrap Selenium 1 and Selenium 2/WebDriver methods. Don't consider this as the only way of wrapping, I am sure there are better solutions than this.

This is how Selenium1 code (Google again) goes. In the following example there are 5 basic entities -

  • SelTestCase class - which sets up test bed for Selenium
  • ActionDriver class - which carries out operations on page
  • Page element classes - which store element locators
  • Page object classes - which represents services offered by page and

Thursday, January 5, 2012

What ??? - "com.thoughtworks.selenium.SeleniumException: syntax error"

At times during development of Selenium tests you come across errors which don't give you any clue what so ever. One such error is -

com.thoughtworks.selenium.SeleniumException: syntax error
or -
missing ) after argument list

One such occurnce of this error is when you use waitForCondition method.
This is one awesome selenium method which saved you from using ugly sleep statements in your scripts. Having read it's API you might consider using it as -

waitForCondition("selenium.isElementPresent(//a[text()='Dashboard'])", "60000");

where first argument - selenium.isElementPresent(//a[text()='Dashboard']), is the condition you expect to be true. And second argument - 60000, is the max wait period till selenium would wait for condition to be true (You don't hard code time in your scripts, do you?).

Tuesday, January 3, 2012

Updating Sauce Labs dashboard with Selenium 2 test results


If you have not yet known of Sauce Labs, Sauce Labs specialises in executing Selenium tests on cloud. If you don't want to manage those umpteen configurations for executing your Selenium tests, then Sauce Labs is the answer. I am not going to explain executing your Selenium tests on Sauce Labs as there is enough documentation on Sauce Labs which already explains this. What I was stuck with is updating test results on Sauce Labs dashboard. Status "finished" does not indicate about success/failure of tests and you may probably not have time to see log/video of each and every finished tests.



I posted query to Sauce Labs and got to know about the Sauce Labs REST api. But things were still not very clear as I was not sure of on what basis I could update test results in Sauce Labs dashboard.

Friday, December 30, 2011

2012 - Software Testing Trends

Don't be taken aback if you see following changes in software testing (read people perception) in 2012 -

Management's Disillusionments
  • Tester != Bots
  • Testing != Monkeying around
  • Tester != Project delivery blockers
  • More tester != More defect discoveries
  • Testing != Just keep testing
  • More tester != Less time needed for testing
  • Automation tool != Less manual testing needed != Less testers needed
  • Tester salary = Dev salary (sigh)
  • Testing certificate != Expertise
  • Automated tester !> Manual tester (though vice versa may be true)