How I started With PHP
Khayrattee( @7php) of 7php.com recently published an interview with me, do read and let know your feedback.
Filed under general | Comment (1)
Why PHP is So Popular on Web?
If you ever wondered why the hell PHP is so popular on the web when there are better and powerful languages available?
Well, the answer is very simple, It is only language that allows even musicians to build sites for themselves.
By the way that is also the reason why WordPress has become the king of CMS and my choice for starting a WordPress development team – WPoets.
Filed under general | Comment (0)
The Pune effect on Indian Tech Events
Do you know about ‘The Pune Effect’ which influences all the Tech events in India, if not go read.
And if you are an event organiser then consider Pune as venue for your next event.
Filed under general | Comment (0)
Get An Introduction To Functional Programming At TechWeekend 5
5th edition of the TechWeekend is going to be about Functional Programming and if are hearing this term for first time, or if you are like me who has heard about it, but never got time to look into the details then you should definitely attend it.![]()
Event is on 18th Dec 2010, ie this Saturday from 10 AM – 1 PM, at 505, A-Wing, Ground Floor MCCIA Trade Tower( ICC ) on SB Road.
Here is the quick agenda,
- Why you should care about functional programming – by Dhananjay Nene. His id on twitter is @dnene and he currently writes code for and advises Vayana Enterprises in his role as its Chief Architect.
- An Introduction to Erlang – by Bhasker Kode. On twitter he is @bosky101 and he is the CEO and Co-Founder of Pune-based Hover Technologies.
- Clojure & its solution to the Expression Problem – By Baishampayan Ghose. On Twitter he is @ghoseb, and he is the co-founder & CTO of http://Paisa.com
Ohh.. and before I forget you need to register( don’t worry it is free) for the event.
See you guys on Saturday.
Filed under general | Comment (0)
Testing Extjs Application With Selenium : Few Pointers
On a project that I am working on we needed to create few automated tests using selenium. Our frontend is completely written in Extjs.
Being new to testing using selenium, I searched the web and here are few useful advices that I found.
The most comprehensive one was by Ates Goral on stackoverflow.
The biggest hurdle in testing ExtJS with Selenium is that ExtJS doesn’t render standard HTML elements and the Selenium IDE will naively (and rightfully) generate commands targeted at elements that just act as decor — superfluous elements that help ExtJS with the whole desktop-look-and-feel. Here are a few tips and tricks that I’ve gathered while writing automated Selenium test against an ExtJS app.
General Tips
Locating Elements
When generating Selenium test cases by recording user actions with Selenium IDE on Firefox, Selenium will base the recorded actions on the ids of the HTML elements. However, for most clickable elements, ExtJS uses generated ids like “ext-gen-345″ which are likely to change on a subsequent visit to the same page, even if no code changes have been made. After recording user actions for a test, there needs to be a manual effort to go through all such actions that depend on generated ids and to replace them. There are two types of replacements that can be made:
Replacing an Id Locator with a CSS or XPath Locator
CSS locators begin with “css=” and XPath locators begin with “//” (the “xpath=” prefix is optional). CSS locators are less verbose and are easier to read and should be preferred over XPath locators. However, there can be cases where XPath locators need to be used because a CSS locator simply can’t cut it.
Executing JavaScript
Some elements require more than simple mouse/keyboard interactions due to the complex rendering carried out by ExtJS. For example, a Ext.form.CombBox is not really a
<select>element but a text input with a detached drop-down list that’s somewhere at the bottom of the document tree. In order to properly simulate a ComboBox selection, it’s possible to first simulate a click on the drop-down arrow and then to click on the list that appears. However, locating these elements through CSS or XPath locators can be cumbersome. An alternative is to locate the ComoBox component itself and call methods on it to simulate the selection:var combo = Ext.getCmp('genderComboBox'); // returns the ComboBox components combo.setValue('female'); // set the value combo.fireEvent('select'); // because setValue() doesn't trigger the eventIn Selenium the
runScriptcommand can be used to perform the above operation in a more concise form:with (Ext.getCmp('genderComboBox')) { setValue('female'); fireEvent('select'); }Coping with AJAX and Slow Rendering
Selenium has “*AndWait” flavors for all commands for waiting for page loads when a user action results in page transitions or reloads. However, since AJAX fetches don’t involve actual page loads, these commands can’t be used for synchronization. The solution is to make use of visual clues like the presence/absence of an AJAX progress indicator or the appearance of rows in a grid, additional components, links etc. For example:
Command: waitForElementNotPresent Target: css=div:contains('Loading...')Sometimes an element will appear only after a certain amount of time, depending on how fast ExtJS renders components after a user action results in a view change. Instead of using arbitary delays with the
pausecommand, the ideal method is to wait until the element of interest comes within our grasp. For example, to click on an item after waiting for it to appear:Command: waitForElementPresent Target: css=span:contains('Do the funky thing') Command: click Target: css=span:contains('Do the funky thing')Relying on arbitrary pauses is not a good idea since timing differences that result from running the tests in different browsers or on different machines will make the test cases flaky.
Non-clickable Items
Some elements can’t be triggered by the
clickcommand. It’s because the event listener is actually on the container, watching for mouse events on its child elements, that eventually bubble up to the parent. The tab control is one example. To click on the a tab, you have to simulate amouseDownevent at the tab label:Command: mouseDownAt Target: css=.x-tab-strip-text:contains('Options') Value: 0,0Field Validation
Form fields (Ext.form.* components) that have associated regular expressions or vtypes for validation will trigger validation with a certain delay (see the
validationDelayproperty which is set to 250ms by default), after the user enters text or immediately when the field loses focus — or blurs (see thevalidateOnDelayproperty). In order to trigger field validation after issuing the type Selenium command to enter some text inside a field, you have to do either of the following:
- Triggering Delayed Validation ExtJS fires off the validation delay timer when the field receives keyup events. To trigger this timer, simply issue a dummy keyup event (it doesn’t matter which key you use as ExtJS ignores it), followed by a short pause that is longer than the validationDelay:
Command: keyUp Target: someTextArea Value: x Command: pause Target: 500- Triggering Immediate Validation You can inject a blur event into the field to trigger immediate validation:
Command: runScript Target: someComponent.nameTextField.fireEvent("blur")Checking for Validation Results
Following validation, you can check for the presence or absence of an error field:
Command: verifyElementNotPresent Target: //*[@id="nameTextField"]/../*[@class="x-form-invalid-msg" and not(contains(@style, "display: none"))] Command: verifyElementPresent Target: //*[@id="nameTextField"]/../*[@class="x-form-invalid-msg" and not(contains(@style, "display: none"))]Note that the “display: none” check is necessary because once an error field is shown and then it needs to be hidden, ExtJS will simply hide error field instead of entirely removing it from the DOM tree.
Element-specific Tips
Clicking an Ext.form.Button
- Option 1
Command: click Target: css=button:contains('Save') Selects the button by its captionOption 2 Command: click Target: css=#save-options button Selects the button by its idSelecting a Value from an Ext.form.ComboBox
Command: runScript Target: with (Ext.getCmp('genderComboBox')) { setValue('female'); fireEvent('select'); }First sets the value and then explicitly fires the select event in case there are observers.
Second useful tip was about how to continue to run the test when some test fails, it was by Patrick Lightbody
try {
selenium.waitForPageToLoad(timeout);
} catch (e) {
// this will happen after 90 seconds
// todo: recover and send the browser to the the next URL
Another useful tip that I found was by radu that solved the issues caused by auto-generated id by ExtJS.
Selenium tests for ExtJS should rely on CSS selectors.
//table[contains(@class,'seleniumOkButton')]
Finally the most important and useful is the documentation of Testing_Selenium which lists all the supported functions of selenium RC.
One more thing version 0.4.4 of Testing_Selenium pear pacakge has a missing function getNumber check this bug report to get that function.
Filed under general | Comments (4)
CodeIgniter 2.0 Is Baking
Just when I was loosing all hopes about CodeIgniter, yesterday EllisLab announced about their move to assembla and mercurial, in that there was a small but significant news about CodeIgniter 2.0.
A quick look into the change log revealed
PHP 4 support is deprecated. Features new to 2.0.0 may not be support PHP 4, and all legacy features will no longer support PHP 4 as of 2.1.0.
This is what I was waiting for. What it means, as pointed by Phil Sturgeon and Elliot Haughin, is that CI 2.0 will not run on PHP 4, but more importantly, it can now take full advantages of PHP 5.
One other thing that I liked is
Added ability to set "Package" paths - specific paths where the Loader and Config classes should try to look first for a requested file. This allows distribution of sub-applications with their own libraries, models, config files, etc. in a single "package" directory.
Which means that now we can create common area where we can keep helpers, views and libraries that needs to be shared between two applications.
While there are many more updates these two got me excited.
For now let’s wait for them to release, meanwhile you can sign up for Bitbucket and follow the updates for CodeIgniter Project.
Filed under general, php | Comments (6)
One Year Of Writing
On 25th February this blog turned 1 year old.
I am happy to say that in my 3rd attempt to be a blogger I have finally succeded.
Thank you every one for commenting and reading which kept my interest alive.
Filed under general | Comments (2)
How do I find out more about the startup ecosystem in Pune?
Their was a very good discussion that happened at Pune startups mailing list. Topic of discussion was how do students find a way to get inside startup fraternity. Result of that discussion is that, we now have POCC-students group and mailing list created to help fill the gap.
What is the most interesting is, we were discussing how to get students invlove in open source, while techstart.in group was formed to give students mentoring.
Anyways, I thought I will just put action points from that mailing list as a blog post so that few more people could find it.
Here is what Navin and other’s believe should be done by students to connect with Pune startup faternity.
To stay plugged in to the Pune startup ecosystem, I suggest the following:
1. Subscribe to the PuneStartups (POCC) mailing list:
http://groups.google.com/group/punestartups
2. If you are a student, or interested in students, subscribe to the
POCC mailing list: http://groups.google.com/group/pocc-students
3. Stay in touch with Pune tech community events and other information
via PuneTech: http://punetech.com/subscribe
4. Join twitter. I’ve found that twitter is a great place to get
information about Pune Startups. On twitter follow @punetech
As startups always look for passion and skill in people they hire, so being active on one of the forums mentioned below can increase you chance of getting hired and also to interact and find mentors in local community.
Please choose according to your interest
- Join PHPCamp mailing list http://groups.google.com/group/phpcamp
- Join Drupal India Community mailing list at http://groups.drupal.org/india
- Join Joomla User Group Pune mailing list at http://groups.google.com/group/jugpune
- Join Barcamp pune mailing list at http://tech.groups.yahoo.com/group/barcamp-pune
- If mailing list is to much for you, then follow some of the most active pune techies and tech events on twitter.
Again, I am biased towards PHP and PHP Community, so I have very limited knowledge of other tech events and their mailing list, So if any one of you are active on any other mailing list that is useful for students than please leave a comment I will update the post.
Update
Here are few more groups for you
- Join Null group at http://null.co.in/, they talk only about cyber security and hacking.
- Join Flex users mailing list at http://groups.google.co.in/group/pune-flex-users
- Join Pune Linux User group at http://www.plug.org.in/mailman/listinfo/plug-mail
- For Techie Girls out their, Join LinuxChix http://mailman.linuxchix.org/mailman/listinfo/indichix
- Join Ruby users mailing list at http://tech.groups.yahoo.com/group/puneruby/
- Join Pune Java User Group http://groups.google.com/group/Pune-Java
So many options, and still students ask where to look?
Filed under general | Comments (2)
Round off
Their are lot’s of tech events happening in Pune.
Recently Concluded was IdeaCamp 2, you can read about it on Bhavya’s blog post.
Upcoming events that I know of
- WATBlog Wednesday Pune on 21st January,
- Drupal Camp Pune, it is going to happen on 31st January,
- On 13th – 14 Feb( yes !!!) we are having Gnunify’09. and
- Joomla Day India, for the first time in India, we will have a day dedicated to Joomla. This will happen on 25th April. Announcement about it should happen in a day or two.
Too know about more tech events that are happening or happen in Pune, keep checking Pune Tech Events Calendar.
For last few week I have been doing lot of things and learned a lot, stay tuned.. till then
Have fun
Filed under drupal, general | Comments (3)
India I Care, So Let’s Be Social..
We are happy to announce the success of Opensocial Developer Garage.
We were able to prototype the ‘India I Care’ orkut app for IOFC. It will be soon released for everyone to use. We build this app with active contribution from Shardule, Rohan, Parag and our speaker Shishir.
Priyank and Aman has already covered the event in detail, also check what another speaker Arpana has to say about it.
Photos of the event :
http://picasaweb.google.co.in/thecancerus/OpensocialDeveloperGarage08
| From Opensocial Developer garage’08 |
I would like to thank everyone who made this event possible.
Have fun.
Filed under general | Comments (3)


