Favourite Quote

Every artist was first an amateur. - Ralph Waldo Emerson The more difficulties one has to encounter, within and without, the more significant and the higher in inspiration his life will be. - Horace Bushnell

Wednesday, June 16, 2010

Agile Testing

Agile testing is a software testing practice that follows the principles of the agile manifesto, emphasizing testing from the perspective of customers who will utilize the system. Agile testing does not emphasize rigidly defined testing procedures, but rather focuses on testing iteratively against newly developed code until quality is achieved from an end customer's perspective. In other words, the emphasis is shifted from "testers as quality police" to something more like "entire project team working toward demonstrable quality."
The Word Agile means "Moving Quickly" and this explains the whole concept of Agile Testing. Testers have to adapt to rapid deployment cycles and changes in testing patterns.
Agile testing involves testing from the customer perspective as early as possible, testing early and often as code becomes available and stable enough from module/unit level testing.
Since working increments of the software are released often in agile software development, there is also a need to test often. This is commonly done by using automated acceptance testing to minimize the amount of manual labor involved. Undertaking only manual testing in agile development may result in either buggy software or slipping schedules, as it may not be possible to test the entire build manually before each release.
In Agile Testing, testers are no longer a form of Quality Police. Testing moves the project forward leading to new strategy called Test Driven Development.
Testers provide information, feedback and suggestions rather than being last phase of defense.
Testing is no more a phase; it integrates closely with Development.
Continuous testing is the only way to ensure continuous progress.
Reduce feedback loops, Manual regression tests take longer to execute and, because a resource must be available, may not begin immediately.
Feedback time can increase to days or weeks. Manual testing, particularly manual exploratory testing, is still important.
However, Agile teams typically find that the fast feedback afforded by automated regression is a key to detecting problems quickly, thus reducing risk and rework.
Keep the code clean. Buggy software is hard to test, harder to modify and slows everything down. Keep the code clean and help fix the bugs fast.
Lightweight Documentation Instead of writing verbose, comprehensive test documentation.
Agile testers:
• Use reusable checklists to suggest tests
• Focus on the essence of the test rather than the incidental details
• Use lightweight documentation styles/tools
• Capturing test ideas in charters for Exploratory Testing
• Leverage documents for multiple purpose automationwithselenium.blogspot.com-Google pagerank and Worth

Monday, June 14, 2010

PAIR AND REMOTE PROGRAMMING

PAIR PROGRAMMING
Pair programming is an agile software development technique in which two programmers work together at one work station.
One types in code while the other reviews each line of code as it is typed in. The person typing is called the driver. The person reviewing the code is called the observer (or navigator[1]).
The two programmers switch roles frequently (possibly every 30 minutes or less).
Its just like two University students sharing a single PC & coding together personally i did it whil e in University it was a great way of coding.
This is most acceptable at University level am not too sure if its in practice in the IT corporate world.

REMOTE PAIR PROGRAMMING :
Remote pair programming, also known as virtual pair programming or distributed pair programming, is the practice of pair programming where the two programmers comprising the pair are in different locations, working via a collaborative real-time editor, shared desktop, or a remote pair programming IDE plugin.
Remote pairing introduces difficulties not present in face-to-face pairing, such as extra delays for coordination, depending more on "heavyweight" task-tracking tools instead of "lightweight" ones like index cards, and loss of non-verbal communication resulting in confusion and conflicts over such things as who "has the keyboard".
Numerous tools, such as Eclipse plug-ins are available to support remote pairing. Some teams have tried VNC and RealVNC with each programmer using their own computer.This works well in our Organisation.
Others use the multi-display mode (-x) of the text-based GNU screen. Apple Inc. OSX has a built-in Screen Sharing application automationwithselenium.blogspot.com-Google pagerank and Worth

Would like to share possible interview questions on selenium

Q1. What is Selenium?
Ans. Selenium is a set of tools that supports rapid development of test automation scripts for web based applications. Selenium testing tools provides a rich set of testing functions specifically
designed to fulfil needs of testing of a web based application.
Q2. What are the main components of Selenium testing tools?
Ans. Selenium IDE, Selenium RC and Selenium Grid
Q3. What is Selenium IDE?
Ans. Selenium IDE is for building Selenium test cases. It operates as a Mozilla Firefox add on and provides an easy to use interface for developing and running individual test cases or entire test
suites. Selenium-IDE has a recording feature, which will keep account of user actions as they are
performed and store them as a reusable script to play back.
Q4. What is the use of context menu in Selenium IDE?
Ans. It allows the user to pick from a list of assertions and verifications for the selected location.
Q5. Can tests recorded using Selenium IDE be run in other browsers?
Ans. Yes, Although Selenium IDE is a Firefox add on, however, tests created in it can also be run in other browsers by using Selenium RC (Selenium Remote Control) and specifying the name of the test suite in command line.
Q6. What are the advantage and features of Selenium IDE?
Ans.
1. Intelligent field selection will use IDs, names, or XPath as needed
2. It is a record & playback tool and the script format can be written in various languages including C#, Java, PERL, Python, PHP, HTML
3. Auto complete for all common Selenium commands
4. Debug and set breakpoints
5. Option to automatically assert the title of every page
6. Support for Selenium user-extensions.js file
Q7. What are the disadvantage of Selenium IDE tool?
Ans.
1. Selenium IDE tool can only be used in Mozilla Firefox browser.
2. It is not playing multiple windows when we record it.
Q8. What is Selenium RC (Remote Control)?
Ans. Selenium RC allows the test automation expert to use a programming language for maximum flexibility and extensibility in developing test logic. For example, if the application under test returns a result set and the automated test program needs to run tests on each element in the result set, the iteration / loop support of programming language’s can be used to iterate through the result set,calling Selenium commands to run tests on each item.
Selenium RC provides an API and library for each of its supported languages. This ability to use
Selenium RC with a high level programming language to develop test cases also allows the automated testing to be integrated with the project’s automated build environment.
Q9. What is Selenium Grid?
Ans. Selenium Grid in the selenium testing suit allows the Selenium RC solution to scale for test suites that must be run in multiple environments. Selenium Grid can be used to run multiple instances of Selenium RC on various operating system and browser configurations.
Q10. How Selenium Grid works?
Ans. Selenium Grid sent the tests to the hub. Then tests are redirected to an available Selenium RC, which launch the browser and run the test. Thus, it allows for running tests in parallel with the entire test suite.
Q 11. What you say about the flexibility of Selenium test suite?
Ans. Selenium testing suite is highly flexible. There are multiple ways to add functionality to Selenium framework to customize test automation. As compared to other test automation tools, it is Selenium’s strongest characteristic. Selenium Remote Control support for multiple programming and scripting languages allows the test automation engineer to build any logic they need into their automated testing and to use a preferred programming or scripting language of one’s choice. Also, the Selenium testing suite is an open source project where code can be modified and enhancements can be submitted for contribution.
Q12. What are the types of test can Selenium do?
Ans. Selenium is basically used for the functional testing of web based applications. It can be used for testing in the continuous integration environment. It is also useful for agile testing
It's great as a Regression Testing tool.
Q13. What is the cost of Selenium test suite?
Ans. Selenium test suite a set of open source software tool, it is free of cost.
Q14. What browsers are supported by Selenium Remote Control?
Ans. The test automation expert can use Firefox, IE 7/8, Safari and Opera browsers to run tests in Selenium Remote Control.
Q15. What programming languages can you use in Selenium RC?
Ans. C#, Java, Perl, PHP, Python, Ruby
Q16. What are the advantages and disadvantages of using Selenium as testing tool?
Ans. Advantages: Free, Simple and powerful DOM (document object model) level testing, can be used for continuous integration; great fit with Agile projects.
Disadvantages: Tricky setup; dreary errors diagnosis; can not test client server applications.
Q17. What is difference between QTP and Selenium?
Ans. Only web applications can be testing using Selenium testing suite. However, QTP can be used for testing client server applications. Selenium supports following web browsers: Internet Explorer, Firefox, Safari, Opera on different Operating Systems Windows, Mac OS X and Linux. However, QTP is limited to Internet Explorer on Windows.QTP uses scripting language implemented on top of VB Script. However, Selenium test suite has the flexibility to use many languages like Java, .Net, Perl, PHP, Python, and Ruby.
Q18. What is difference between Borland Silk test and Selenium?
Ans. Selenium is completely free test automation tool, while Silk Test is not. Only web applications can be testing using Selenium testing suite. However, Silk Test can be used for testing client server applications. Selenium supports following web browsers: Internet Explorer, Firefox, Safari, Opera on different Operating systems Windows, Mac OS X and Linux. However, Silk Test is limited to Internet Explorer and Firefox.
Silk Test uses 4Test scripting language. However, Selenium test suite has the flexibility to use many languages like Java, .Net, Perl, PHP, Python, and Ruby. automationwithselenium.blogspot.com-Google pagerank and Worth

Wednesday, June 9, 2010

Executing selenium scripts

on command prompt execute perl amazon.pl
C:\Selenium>perl amazon.pl
ok 1 - open, /
ok 2 - type, twotabsearchtextbox, Microscope USB
ok 3 - click, //input[@alt='Go']
ok 4 - wait_for_page_to_load, 30000
ok 5 - is_text_present, Veho
ok 6 - click, link=Veho VMS004DELUXE USB Powered Microscope
ok 7 - wait_for_page_to_load, 300001..7
So here's how it happens
Selenium server waits there & launches the browser
So have a succesful first testcase.

I 'll add more of Data driven approach & executing a test suite. automationwithselenium.blogspot.com-Google pagerank and Worth

Writing first test case in perl

I created a test script in perl
All it does is gets into amazon.co.uk & searches for a microscope verifies if the brand exists & clicks on that link.

use strict;use warnings;
use Time::HiRes qw(sleep);
use Test::WWW::Selenium;
use Test::More "no_plan";
use Test::Exception;
my $sel = Test::WWW::Selenium->new( host => "localhost",
port => 4444,
browser => "*iexplore",
browser_url => "http://www.amazon.com/" );
$sel->open_ok("/");
$sel->type_ok("twotabsearchtextbox", "Microscope USB");
$sel->click_ok("//input[\@alt='Go']");
$sel->wait_for_page_to_load_ok("30000");
$sel->is_text_present_ok("Veho");
$sel->click_ok("link=Veho VMS004DELUXE USB Powered Microscope");
$sel->wait_for_page_to_load_ok("30000"); automationwithselenium.blogspot.com-Google pagerank and Worth

Easy steps to go with installing Selenium RC for Perl

These steps are specific to Windows Box.I am on Win XP
1.Start your Selenium server
You can create a batch file as below & just double click with start the server
add java -jar selenium-server.jar to a file & name that as seleniumserver.bat
2. Download Active Perl
3.Now you gotto install Test-WWW-Selenium packages.
4.Invoke perl package manager from your command prompt like this ppm
5.A GUI will open up search for Test-WWW
once you locate the selenium package on the list Run the marked actions.
So you are all set with the selenium packages that are required for you to get going. automationwithselenium.blogspot.com-Google pagerank and Worth